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

# Create a sign-in link

> Swaps a token you signed with HS256 and your SSO secret (claims `sub` = the customer's `external_id`, `email`, optional `name`, and a short `exp`) for a sign-in link that works once, within 5 minutes. A `sub` that was never provisioned is provisioned first. No partner key is sent. 20 requests a minute per client address. See [Single sign-on](/partner/single-sign-on).



## OpenAPI

````yaml /api-reference/partner.openapi.json post /sso/generate-auth-url
openapi: 3.1.0
info:
  title: Partner API
  version: 1.0.0
  description: >-
    Provision your customers, sign them in with single sign-on, issue their
    workspace API keys and connect their messaging channels. Authenticated by
    your partner key as `X-API-KEY`, from your backend only.
servers:
  - url: https://app.onlysocial.io/api
    description: OnlySocial
security:
  - partnerKey: []
tags:
  - name: Customers
    description: Create or refresh a customer's account and workspace.
  - name: Single sign-on
    description: Swap a token signed with your SSO secret for a one-time sign-in link.
  - name: Workspace API keys
    description: Issue, list and revoke the `osk_` keys of a workspace you provisioned.
  - name: Channel Connect
    description: Hosted links that connect a customer's own messaging channels.
paths:
  /sso/generate-auth-url:
    post:
      tags:
        - Single sign-on
      summary: Create a sign-in link
      description: >-
        Swaps a token you signed with HS256 and your SSO secret (claims `sub` =
        the customer's `external_id`, `email`, optional `name`, and a short
        `exp`) for a sign-in link that works once, within 5 minutes. A `sub`
        that was never provisioned is provisioned first. No partner key is sent.
        20 requests a minute per client address. See [Single
        sign-on](/partner/single-sign-on).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - token
                - partner
              properties:
                token:
                  type: string
                  description: The signed JWT.
                  example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…
                partner:
                  type: string
                  description: Your partner identifier.
                  example: acme
      responses:
        '200':
          description: The sign-in link
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      authentication_url:
                        type: string
                        format: uri
                        description: >-
                          Send the customer's browser here. Add `redirect` to
                          choose where they land.
                        example: https://app.onlysocial.io/sso/authenticate?token=…
                      expires_in:
                        type: integer
                        description: Seconds the link stays valid.
                        example: 300
                      user:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 184
                          email:
                            type: string
                            example: sales@acmemotors.test
                          name:
                            type: string
                            example: Acme Motors
        '400':
          description: >-
            Missing parameters, or the token was rejected: expired, wrong
            signature, missing `email`, an e-mail mismatch or domain
            restriction, or a provisioning conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                message: Invalid SSO token signature.
        '404':
          description: Unknown or inactive partner identifier.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                message: Invalid or inactive SSO partner.
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security: []
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
        error_code:
          type: string
  responses:
    TooManyRequests:
      description: Rate limited. Wait for `Retry-After` seconds.
  securitySchemes:
    partnerKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your partner API key, `pk_…`. Backend only.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.