> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useparagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Setup Link

> Create a hosted link where a user connects the sources Agent OS can search.

Call this endpoint from your backend to create a Setup Link for a Connected User. Send the returned `url` to your user. They open it, connect their accounts, and choose what content to sync.

This endpoint is served from `https://zeus.useparagon.com` (US Cloud) or `https://zeus.eu.paragon.so` (EU Cloud), not the Agent OS base URL used by [Search Context](https://docs.useparagon.com/agent-os/context/search.md). Use the server dropdown in the API playground to switch regions.

## Authentication

Authenticate with either of the following in the `Authorization` header:

| Credential | `endUserId` |
| - | - |
| A Paragon API key with the **Setup Links API** scope (`api_key_...`) | Required. The link is created for that Connected User. |
| A Paragon User Token | Optional. It must match the token's `sub` claim, and defaults to it. |

Setup Links must be enabled for your project. If they aren't, the request returns a `403` with the error code `56016`.

## Expiration

Links expire after 1 hour by default. Set `expiresIn` (in seconds) to change this, up to a maximum of 24 hours.

The `url` contains a signed token. Treat it like a credential and share it only with the intended user.

## Limiting integrations

By default, a Setup Link offers every integration enabled for the project. Pass `integrations` to limit it to specific ones, using the same type names as the Connect SDK. If any name isn't enabled for the project, the request returns a `400` with the error code `56004`.

When you authenticate with a Paragon User Token that restricts integration permissions, the link only offers integrations the token allows.

```javascript theme={null}
const response = await fetch(
  `https://zeus.useparagon.com/projects/${projectId}/setup-links`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${paragonApiKey}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      endUserId: "user@example.com",
      expiresIn: 3600,
      integrations: ["googledrive", "sharepoint"],
    }),
  },
);

const { url, expiresAt } = await response.json();
```


## OpenAPI

````yaml agent-os/openapi/context.json POST /projects/{projectId}/setup-links
openapi: 3.1.0
info:
  title: Agent OS Context API
  version: 1.0.0
  description: Search your users' synced content and read the text around a search result.
servers:
  - url: https://agentos.useparagon.com
    description: Production US Cloud
  - url: https://agentos.eu.paragon.so
    description: Production EU Cloud
security:
  - bearerAuth: []
paths:
  /projects/{projectId}/setup-links:
    post:
      summary: Create Setup Link
      operationId: createSetupLink
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Your Paragon Project ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSetupLinkRequest'
            example:
              endUserId: user@example.com
              expiresIn: 3600
              integrations:
                - googledrive
                - sharepoint
      responses:
        '201':
          description: The Setup Link was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSetupLinkResponse'
              example:
                url: >-
                  https://<connect-host>/project/6f1c0b2e-1a2b-4c3d-8e9f-0a1b2c3d4e5f/setup?token=eyJhbGciOi...
                expiresAt: '2026-10-14T22:51:00.000Z'
        '400':
          description: >-
            The request was invalid. `endUserId` is missing (`56003`), an
            integration is unknown or not enabled for the project (`56004`), or
            `expiresIn` is not a positive integer (`56005`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetupLinkError'
        '401':
          description: The API key or Paragon User Token is missing or invalid.
        '403':
          description: >-
            Setup Links are not enabled for the project (`56016`), `endUserId`
            doesn't match the Paragon User Token (`56014`), or the token's
            permissions don't allow any of the requested integrations (`56015`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetupLinkError'
      security:
        - apiKeyAuth: []
        - bearerAuth: []
      servers:
        - url: https://zeus.useparagon.com
          description: Production US Cloud
        - url: https://zeus.eu.paragon.so
          description: Production EU Cloud
components:
  schemas:
    CreateSetupLinkRequest:
      type: object
      properties:
        endUserId:
          type: string
          description: >-
            The Connected User the Setup Link is for. Required when you
            authenticate with an API key. When you authenticate with a Paragon
            User Token, it must match the token's `sub` claim, and defaults to
            it when omitted.
        expiresIn:
          type: integer
          minimum: 1
          maximum: 86400
          default: 3600
          description: >-
            How long the link stays valid, in seconds. Values above 86400 (24
            hours) are capped at 86400.
        integrations:
          type: array
          items:
            type: string
          description: >-
            Limit the link to these integrations, using the same type names as
            the Connect SDK (for example, `googledrive`). Every integration must
            be enabled for the project. Omit to allow all enabled integrations.
    CreateSetupLinkResponse:
      type: object
      required:
        - url
        - expiresAt
      properties:
        url:
          type: string
          description: >-
            The hosted Setup Link URL to send to your user. The URL carries a
            signed token, so treat it like a credential.
        expiresAt:
          type: string
          format: date-time
          description: When the link expires, as an ISO 8601 timestamp.
    SetupLinkError:
      type: object
      properties:
        code:
          type: string
          description: A numeric Paragon error code, such as `56003`.
        message:
          type: string
          description: A human-readable description of what went wrong.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Your [Paragon User
        Token](/getting-started/installing-the-connect-sdk#setup) (JWT), which
        you can generate using your project's signing keys.
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        A Paragon API key (starting with `api_key_`) that has the Setup Links
        API scope. Create one in the Paragon dashboard.

````