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

# Issue a publishable tracking key



## OpenAPI

````yaml https://api.develop.fourdos.dev/openapi/partner.json post /v1/engagement/keys
openapi: 3.1.0
info:
  title: 4D OS Partner API
  version: 0.1.0
  description: >-
    REST API for 4D OS partners. Authenticate with your organization API key:
    `Authorization: Bearer <key>`.


    Requests and responses are JSON with `snake_case` field names. Errors share
    one envelope: `{ "error": { "code", "status", "message", "details"? } }`.


    Mutating endpoints that declare it accept an `Idempotency-Key` header so
    retries are safe.


    Bulk-migrating members? See the [Migrating to 4D
    guide](https://docs.fourdos.dev/walkthroughs/migrate-existing-members) for
    the canonical import schema, a worked example, and the `/v1/imports`
    sequence.
servers: []
security:
  - partnerApiKey: []
tags:
  - name: Users
    description: Create, read, and manage users and their org membership
  - name: Imports
    description: Bulk member import jobs (staging → validate → commit)
  - name: Engagement
    description: Browser event tracking (publishable keys) and tracking-key management
paths:
  /v1/engagement/keys:
    post:
      tags:
        - Engagement
      summary: Issue a publishable tracking key
      operationId: createTrackingKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTrackingKeyBody'
      responses:
        '201':
          description: Tracking key created (token included)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingKeyResponse'
        '401':
          description: Authentication is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateTrackingKeyBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
        allowed_origins:
          default: []
          maxItems: 20
          type: array
          items:
            type: string
            minLength: 1
      required:
        - name
    TrackingKeyResponse:
      type: object
      properties:
        id:
          type: string
        organization_id:
          type: string
        name:
          type: string
        key:
          type: string
          description: The publishable `ek_live_…` token
        allowed_origins:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - active
            - revoked
        last_used_at:
          type:
            - string
            - 'null'
          format: date-time
        revoked_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - organization_id
        - name
        - key
        - allowed_origins
        - status
        - last_used_at
        - revoked_at
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            status:
              type: integer
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - status
            - message
      required:
        - error
  securitySchemes:
    partnerApiKey:
      type: http
      scheme: bearer
      description: >-
        Organization API key (`org_…`), sent as `Authorization: Bearer <key>`.
        Keys are scoped to one organization; every request operates within that
        tenant.

````