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

# Create an integration and its connect link

> Effective workspace members and admins (sessions, or API keys whose scope reaches the workspace with at least the member role). The integration starts `pending`; send `connectUrl` to the client who will authorize the access — it stays readable on the integration until used or replaced.



## OpenAPI

````yaml /api/openapi.json post /v1/organizations/{orgSlug}/workspaces/{workspaceSlug}/integrations
openapi: 3.1.0
info:
  title: 01Advertising Platform API
  version: 0.1.0
  description: >-
    HTTP API of the 01Advertising Platform: organizations, workspaces, API keys,
    audit logs, and the integrations that connect workspaces to advertising
    systems.


    ## Base URL and versions


    Production is `https://api.01ads.com`. Business endpoints live under `/v1`;
    `/health`, `/version`, and `/openapi.json` are unversioned. Before 1.0,
    breaking changes are made in place under `/v1` and shipped together with the
    Portal and CLI; from 1.0 on, a breaking change becomes a `/v2` sibling.
    Operation ids and schema names are stable identifiers. Local development
    runs at `http://127.0.0.1:3000` (`make api`).


    ## Authentication


    Three ways in, declared as security schemes and on every operation: a
    **session cookie** (browsers, set by the sign-in routes), the same session
    as **`Authorization: Bearer`** (the CLI and scripts), or an
    organization-bound **API key** as `x-api-key` (integrations and automation).
    Operations that declare no security requirement are public; operations that
    list only the two session schemes refuse API keys — administrative and
    account changes stay with people.


    ## Errors


    Every non-2xx answer is `application/problem+json` (RFC 9457): `type`,
    `title`, `status`, `detail`, `instance`, and `requestId`; validation
    failures add `errors: [{ path, message }]`. Browser flows answer 302 with no
    body.


    ## Collections, rate limits, and system administration


    Collections are returned whole; `GET /v1/organizations/{orgSlug}/audit-logs`
    is cursor-paginated (`cursor`, `limit`, `nextCursor`). Sign-in emails and
    sign-ups are limited per client address and per email, invitations created
    through an API key per key, and the public connect flow per address and per
    token: a limited request answers 429 with `Retry-After` in seconds.


    Guides, playbooks, and the embedding walkthrough:
    https://docs.01advertising.com.
  termsOfService: https://www.01advertising.com/legal/terms/
  contact:
    name: 01Advertising API support
    email: support@01advertising.com
    url: https://docs.01advertising.com
  license:
    name: Proprietary
    url: https://www.01advertising.com/legal/terms/
servers:
  - url: https://api.01ads.com
    description: Production
security:
  - bearerAuth: []
  - apiKey: []
tags:
  - name: account
    description: The caller's own profile, sign-up, and the invitations addressed to them
    externalDocs:
      url: https://docs.01advertising.com/guides/account
      description: Account guide
  - name: auth
    description: Sign-in methods, magic links, provider sign-in, sessions, and sign-out
    externalDocs:
      url: https://docs.01advertising.com/guides/auth
      description: Authentication guide
  - name: organizations
    description: Organization membership and invitation management
    externalDocs:
      url: https://docs.01advertising.com/guides/organizations
      description: Organizations guide
  - name: workspaces
    description: 'Workspaces: isolated partitions within an organization'
    externalDocs:
      url: https://docs.01advertising.com/guides/workspaces
      description: Workspaces guide
  - name: api-keys
    description: Programmatic access credentials
    externalDocs:
      url: https://docs.01advertising.com/guides/api-keys
      description: API keys guide
  - name: audit
    description: Organization audit trail (cursor-paginated)
    externalDocs:
      url: https://docs.01advertising.com/guides/audit-logs
      description: Audit log guide
  - name: integrations
    description: Workspace integrations with external advertising systems
    externalDocs:
      url: https://docs.01advertising.com/guides/integrations
      description: Integrations guide
  - name: connect
    description: >-
      The public connect flow a client uses to authorize an integration (no
      session)
    externalDocs:
      url: https://docs.01advertising.com/guides/integrations-embedding
      description: Embedding the connect flow
  - name: infra
    description: Health, build information, and this document
    externalDocs:
      url: https://docs.01advertising.com/guides/api-conventions
      description: API conventions
externalDocs:
  url: https://docs.01advertising.com
  description: Developer documentation
paths:
  /v1/organizations/{orgSlug}/workspaces/{workspaceSlug}/integrations:
    post:
      tags:
        - integrations
      summary: Create an integration and its connect link
      description: >-
        Effective workspace members and admins (sessions, or API keys whose
        scope reaches the workspace with at least the member role). The
        integration starts `pending`; send `connectUrl` to the client who will
        authorize the access — it stays readable on the integration until used
        or replaced.
      operationId: createIntegration
      parameters:
        - schema:
            type: string
          required: true
          name: orgSlug
          in: path
        - schema:
            type: string
          required: true
          name: workspaceSlug
          in: path
      requestBody:
        required: true
        content:
          application/json:
            examples:
              googleAds:
                summary: A Google Ads integration for one customer
                value:
                  provider: google_ads
                  name: Customer 42 — Google Ads
                  settings:
                    customerId: 123-456-7890
                  returnUrl: https://app.acme.com/integrations/done?customer=42
                  linkExpiresInDays: 7
            schema:
              $ref: '#/components/schemas/CreateIntegration'
      responses:
        '201':
          description: Created
          content:
            application/json:
              examples:
                created:
                  summary: The integration and the connect link to hand to the client
                  value:
                    id: 5b1f2c3d-8e4a-4c6b-9d0e-1f2a3b4c5d6e
                    workspaceId: ws_7f3c2a
                    provider: google_ads
                    providerName: Google Ads
                    category: wg
                    authMethod: oauth
                    name: Customer 42 — Google Ads
                    status: pending
                    statusDetail: null
                    statusCheckedAt: null
                    lastError: null
                    lastErrorAt: null
                    settings:
                      customerId: 123-456-7890
                    connectedAt: null
                    connectedAccount: null
                    returnUrl: https://app.acme.com/integrations/done?customer=42
                    connectLink:
                      connectUrl: >-
                        https://platform.01ads.com/connect/8f3c1a2b4d5e6f7a8b9c0d1e2f3a4b5c
                      expiresAt: '2026-09-08T09:00:00.000Z'
                      expired: false
                    createdByEmail: ada@acme-corp.com
                    createdAt: '2026-09-01T09:00:00.000Z'
                    updatedAt: '2026-09-01T09:00:00.000Z'
                    connectUrl: >-
                      https://platform.01ads.com/connect/8f3c1a2b4d5e6f7a8b9c0d1e2f3a4b5c
              schema:
                $ref: '#/components/schemas/CreatedIntegration'
        '400':
          description: >-
            Validation failed, provider unavailable, invalid settings or return
            URL
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              examples:
                validationFailed:
                  summary: A request that does not match its schema
                  value:
                    type: about:blank
                    title: Validation Failed
                    status: 400
                    detail: The request does not match the expected schema.
                    instance: /v1/organizations/acme-corp/workspaces
                    requestId: 7c1b0c1e-5b7d-4b2a-9f1e-3c2d1a0b9e8f
                    errors:
                      - path: name
                        message: 'Too small: expected string to have >=1 characters'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              examples:
                unauthorized:
                  summary: No usable credential
                  value:
                    type: about:blank
                    title: Unauthorized
                    status: 401
                    detail: Authentication required. Sign in and try again.
                    instance: /v1/organizations
                    requestId: 2f6a9c3d-1e4b-4a8c-b7d2-5e0f1a2b3c4d
        '403':
          description: Workspace viewers cannot create
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Organization, workspace, or integration not accessible
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              examples:
                notFound:
                  summary: Nothing accessible at that path
                  value:
                    type: about:blank
                    title: Not Found
                    status: 404
                    detail: Organization not found.
                    instance: /v1/organizations/no-such-org
                    requestId: a1b2c3d4-9e8f-4d7c-8b6a-5f4e3d2c1b0a
components:
  schemas:
    CreateIntegration:
      type: object
      properties:
        provider:
          type: string
          enum:
            - the_trade_desk
            - amazon_dsp
            - walmart_dsp
            - beeswax
            - google_dv360
            - openx
            - google_ad_manager
            - google_ads
            - meta
            - tiktok
            - snapchat
            - x
            - reddit
            - openai_ads
            - roku
            - iqm
            - yahoo_dsp
            - mediamath
            - linkedin
            - pinterest
        name:
          type: string
          minLength: 1
          maxLength: 100
        settings:
          type: object
          additionalProperties: {}
          description: >-
            Non-secret provider configuration, validated against the provider's
            settings fields: GET /v1/integrations/providers/{provider} lists
            them, and the `<Provider>Settings` schemas describe each shipped
            provider
        returnUrl:
          type: string
          maxLength: 2048
          description: >-
            Where the client is sent after authorizing; https (http on loopback
            in development)
        linkExpiresInDays:
          type: integer
          minimum: 1
          maximum: 30
          description: Connect-link lifetime, default 7
      required:
        - provider
        - name
      additionalProperties: false
    CreatedIntegration:
      allOf:
        - $ref: '#/components/schemas/Integration'
        - type: object
          properties:
            connectUrl:
              type: string
              description: >-
                The connect link for the client (also in
                `connectLink.connectUrl`)
              examples:
                - https://portal.example.com/connect/…
          required:
            - connectUrl
    Problem:
      type: object
      properties:
        type:
          type: string
          examples:
            - about:blank
        title:
          type: string
          examples:
            - Unauthorized
        status:
          type: integer
          examples:
            - 401
        detail:
          type: string
        instance:
          type: string
          examples:
            - /v1/me
        requestId:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
          description: Field-level problems of a validation failure
      required:
        - type
        - title
        - status
        - instance
    Integration:
      type: object
      properties:
        id:
          type: string
          format: uuid
        workspaceId:
          type: string
        provider:
          type: string
          examples:
            - google_ads
        providerName:
          type: string
          examples:
            - Google Ads
        category:
          type:
            - string
            - 'null'
          enum:
            - dsp
            - ssp
            - wg
            - null
        authMethod:
          type:
            - string
            - 'null'
          enum:
            - oauth
            - credentials
            - null
        name:
          type: string
          examples:
            - Acme Google Ads
        status:
          type: string
          enum:
            - pending
            - active
            - error
            - disabled
        statusDetail:
          type:
            - string
            - 'null'
          description: Why the status is `error`
        statusCheckedAt:
          type:
            - string
            - 'null'
        lastError:
          type:
            - string
            - 'null'
          description: Last transient failure, if any
        lastErrorAt:
          type:
            - string
            - 'null'
        settings:
          type: object
          additionalProperties: {}
          description: >-
            Non-secret provider configuration, validated against the provider's
            settings fields: GET /v1/integrations/providers/{provider} lists
            them, and the `<Provider>Settings` schemas describe each shipped
            provider
        connectedAt:
          type:
            - string
            - 'null'
        connectedAccount:
          type:
            - string
            - 'null'
          description: The external account that authorized access
        returnUrl:
          type:
            - string
            - 'null'
        connectLink:
          type:
            - object
            - 'null'
          properties:
            connectUrl:
              type: string
              description: Readable until the link is used or replaced
            expiresAt:
              type: string
            expired:
              type: boolean
          required:
            - connectUrl
            - expiresAt
            - expired
          description: The live connect link; null when none was issued or it was used
        createdByEmail:
          type:
            - string
            - 'null'
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - workspaceId
        - provider
        - providerName
        - category
        - authMethod
        - name
        - status
        - statusDetail
        - statusCheckedAt
        - lastError
        - lastErrorAt
        - settings
        - connectedAt
        - connectedAccount
        - returnUrl
        - connectLink
        - createdByEmail
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Session token as `Authorization: Bearer` (the CLI and scripts).'
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Organization-bound API key; accepted on /v1 routes other than
        /v1/auth/*.

````