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

# Start a browser sign-in for an agent

> Start the device sign-in that gives an agent an API key without the user copying one. No credentials are needed. Show the user verificationUriComplete and userCode, then call exchangeDeviceAuthorization with deviceCode every interval seconds until the user approves. A signed-in user of the workspace approves the request in the browser. Requests expire after expiresIn seconds. Each call starts a new request; nothing is created for the user until they approve.



## OpenAPI

````yaml /openapi.json post /device-authorizations
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.effectiveai.app/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /device-authorizations:
    post:
      tags:
        - Device sign-in
      summary: Start a browser sign-in for an agent
      description: >-
        Start the device sign-in that gives an agent an API key without the user
        copying one. No credentials are needed. Show the user
        verificationUriComplete and userCode, then call
        exchangeDeviceAuthorization with deviceCode every interval seconds until
        the user approves. A signed-in user of the workspace approves the
        request in the browser. Requests expire after expiresIn seconds. Each
        call starts a new request; nothing is created for the user until they
        approve.
      operationId: createDeviceAuthorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2CreateDeviceAuthorizationRequest'
      responses:
        '201':
          description: Sign-in started. Show the link and code to the user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2DeviceAuthorization'
        '400':
          description: 'invalid_request: clientName or workspace is missing or invalid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '415':
          description: 'unsupported_media_type: use application/json.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '429':
          description: 'rate_limited: too many sign-ins started from this address.'
          headers:
            Retry-After:
              required: true
              schema:
                type: integer
                minimum: 0
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '500':
          description: 'internal_error: unexpected server error.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: 'temporarily_unavailable: respect Retry-After.'
          headers:
            Retry-After:
              required: true
              schema:
                type: integer
                minimum: 0
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security: []
components:
  schemas:
    V2CreateDeviceAuthorizationRequest:
      type: object
      properties:
        clientName:
          type: string
          minLength: 1
          maxLength: 80
          pattern: ^[^\p{Cc}"\\]+$/u
          description: >-
            What is asking for access, shown to the user on the approval page
            and used as the API key name, such as "Claude Code".
          example: Claude Code
        workspace:
          type: string
          pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
          description: >-
            The workspace to sign in to: the first part of the address the user
            opens Effective at, such as acme for acme.effectiveai.app. Only a
            user of this workspace can approve the request.
          example: acme
      required:
        - clientName
        - workspace
      additionalProperties: false
    V2DeviceAuthorization:
      type: object
      properties:
        deviceCode:
          type: string
          description: >-
            Secret for exchangeDeviceAuthorization. Keep it private and never
            show it to the user.
        userCode:
          type: string
          description: Short code the user confirms on the approval page.
          example: BCDF-GHJK
        verificationUri:
          type: string
          format: uri
          description: Approval page, where the user can type the code.
          example: https://acme.effectiveai.app/device
        verificationUriComplete:
          type: string
          format: uri
          description: Approval page with the code filled in. Show this link to the user.
          example: https://acme.effectiveai.app/device?code=BCDF-GHJK
        expiresAt:
          type: string
          format: date-time
          description: When the request expires if nobody approves it.
        expiresIn:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Seconds until expiresAt.
          example: 600
        interval:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Minimum seconds between exchangeDeviceAuthorization calls.
          example: 5
      required:
        - deviceCode
        - userCode
        - verificationUri
        - verificationUriComplete
        - expiresAt
        - expiresIn
        - interval
      additionalProperties: false
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
            dataset:
              type: string
              enum:
                - naic
                - osha
              description: Dataset needed for dataset_not_enabled.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: >-
                Where to add the product to your account, for
                product_access_required.
          required:
            - code
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

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