Connect API

Enhanced Advanced

Create Connect API integration in Posit Connect

The Posit Connect administrator creates an integration through the dashboard’s Integrations settings. Once the integration has been created in Connect, it is available for use by all publishers.

The Connect API integration operates on the publisher trust model. Once this integration is enabled, publishers can associate it with their content. This allows them to write applications that can interact with the Connect API on behalf of the users visiting their applications.

API keys confer both a set of content access permissions and a server role (in decreasing order of privileges: Administrator, Publisher, and Viewer). The integration can be configured to limit the role that content can assume, and it is important to set this as restrictively as possible. The role assumed by the ephemeral API key is the minimum of the configured maximum role and the content visitor’s role.

For example, configuring the integration with a maximum role of Administrator would let published content make API calls with Administrator privileges when an Administrator uses it. Configuring the integration with the maximum role of Publisher would limit the ephemeral API key’s role to Publisher, even when used by an Administrator.

Create Connect API integration.

Alternatively, the example below shows how to create a Connect API integration with a maximum authorization role of Viewer using curl and the Connect Server API. Replace connect.example.org with the address of the Connect server.

Terminal
curl -H "Authorization: Key ${CONNECT_API_KEY}" \
  -XPOST https://connect.example.org/__api__/v1/oauth/integrations \
  --data '{
    "template": "connect",
    "name": "Connect API integration",
    "description": "A helpful description for publishers to use when choosing an integration for their content.",
    "config": {
      "max_role": "Viewer"
    }
  }'
# 200 OK
# {"guid": "<integration-guid>", ... }