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

# Create a connector connection

> Creates a workspace connector connection. For manual Planday setup, set authMode = manual to return an Erna-hosted credential form. Trusted callers can still send auth.kind = customer_token with the customer portal app id and refresh token. Omit authMode to start OAuth when it is configured.



## OpenAPI

````yaml /openapi.json post /v1/workspaces/{workspaceId}/connections
openapi: 3.1.0
info:
  title: Erna API
  version: 1.0.0
  description: >-
    AI business operations platform API.


    Erna uses a reusable pipeline lifecycle: Playbook -> Pipeline -> Revision ->
    Run.


    - A playbook defines the repeatable task type, generation behavior, and run
    input/output contract.

    - A pipeline stores reusable instructions and configuration for one
    playbook. Do not create a new pipeline for every execution.

    - A revision is the built executable version of a pipeline definition.

    - A run executes the latest ready revision with playbook-specific input.


    For scheduling, create one pipeline with the reusable business rules, staff
    context, and constraints. Then run that pipeline repeatedly with
    date-specific input such as { "input": { "dateRange": { "start":
    "2026-05-11", "end": "2026-05-17" } } }.
servers:
  - url: https://api.erna.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/workspaces/{workspaceId}/connections:
    post:
      tags:
        - Connections
      summary: Create a connector connection
      description: >-
        Creates a workspace connector connection. For manual Planday setup, set
        authMode = manual to return an Erna-hosted credential form. Trusted
        callers can still send auth.kind = customer_token with the customer
        portal app id and refresh token. Omit authMode to start OAuth when it is
        configured.
      operationId: createConnection
      parameters:
        - schema:
            type: string
            example: ws_123
          required: true
          name: workspaceId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectionRequest'
      responses:
        '201':
          description: Connection ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionResponse'
        '202':
          description: Authorization required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationRequiredResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  connector:
                    type: string
                  flow:
                    type: string
                  providerError:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                  message:
                    type: string
                  reason:
                    type: string
                  runId:
                    type: string
                  requiredActions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - connect_service
                        connector:
                          type: string
                        href:
                          type: string
                        request:
                          type: object
                          properties: {}
                          default: {}
                          additionalProperties: {}
                      required:
                        - id
                        - type
                        - connector
                        - href
                      additionalProperties: false
                  billing:
                    type: object
                    properties:
                      checkoutPath:
                        type: string
                    required:
                      - checkoutPath
                required:
                  - error
                additionalProperties: false
        '403':
          description: Missing write access
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  connector:
                    type: string
                  flow:
                    type: string
                  providerError:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                  message:
                    type: string
                  reason:
                    type: string
                  runId:
                    type: string
                  requiredActions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - connect_service
                        connector:
                          type: string
                        href:
                          type: string
                        request:
                          type: object
                          properties: {}
                          default: {}
                          additionalProperties: {}
                      required:
                        - id
                        - type
                        - connector
                        - href
                      additionalProperties: false
                  billing:
                    type: object
                    properties:
                      checkoutPath:
                        type: string
                    required:
                      - checkoutPath
                required:
                  - error
                additionalProperties: false
        '404':
          description: Workspace, connector, or pipeline not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  connector:
                    type: string
                  flow:
                    type: string
                  providerError:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                  message:
                    type: string
                  reason:
                    type: string
                  runId:
                    type: string
                  requiredActions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - connect_service
                        connector:
                          type: string
                        href:
                          type: string
                        request:
                          type: object
                          properties: {}
                          default: {}
                          additionalProperties: {}
                      required:
                        - id
                        - type
                        - connector
                        - href
                      additionalProperties: false
                  billing:
                    type: object
                    properties:
                      checkoutPath:
                        type: string
                    required:
                      - checkoutPath
                required:
                  - error
                additionalProperties: false
        '500':
          description: Connector configuration error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  connector:
                    type: string
                  flow:
                    type: string
                  providerError:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                  message:
                    type: string
                  reason:
                    type: string
                  runId:
                    type: string
                  requiredActions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - connect_service
                        connector:
                          type: string
                        href:
                          type: string
                        request:
                          type: object
                          properties: {}
                          default: {}
                          additionalProperties: {}
                      required:
                        - id
                        - type
                        - connector
                        - href
                      additionalProperties: false
                  billing:
                    type: object
                    properties:
                      checkoutPath:
                        type: string
                    required:
                      - checkoutPath
                required:
                  - error
                additionalProperties: false
        '501':
          description: Connector authorization unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  connector:
                    type: string
                  flow:
                    type: string
                  providerError:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                  message:
                    type: string
                  reason:
                    type: string
                  runId:
                    type: string
                  requiredActions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - connect_service
                        connector:
                          type: string
                        href:
                          type: string
                        request:
                          type: object
                          properties: {}
                          default: {}
                          additionalProperties: {}
                      required:
                        - id
                        - type
                        - connector
                        - href
                      additionalProperties: false
                  billing:
                    type: object
                    properties:
                      checkoutPath:
                        type: string
                    required:
                      - checkoutPath
                required:
                  - error
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  schemas:
    CreateConnectionRequest:
      type: object
      properties:
        connector:
          type: string
          minLength: 1
        authMode:
          type: string
          enum:
            - oauth
            - manual
        pipeline:
          type: string
          minLength: 1
        service:
          type: string
          minLength: 1
        returnUrl:
          type: string
          minLength: 1
        auth:
          oneOf:
            - type: object
              properties:
                kind:
                  type: string
                  enum:
                    - customer_token
                appId:
                  type: string
                  minLength: 1
                refreshToken:
                  type: string
                  minLength: 1
              required:
                - kind
                - appId
                - refreshToken
              additionalProperties: false
      required:
        - connector
      additionalProperties: false
    ConnectionResponse:
      type: object
      properties:
        id:
          type: string
        connector:
          type: string
        status:
          type: string
          enum:
            - ready
            - authorization_required
        displayName:
          type: string
        grantedCapabilities:
          type: array
          items:
            type: string
        metadata:
          type: object
          properties: {}
          additionalProperties: {}
      required:
        - id
        - connector
        - status
    AuthorizationRequiredResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - authorization_required
        connector:
          type: string
        authorization:
          type: object
          properties:
            url:
              type: string
            expiresAt:
              type: string
          required:
            - url
            - expiresAt
        requiredActions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
                enum:
                  - connect_service
              connector:
                type: string
              href:
                type: string
              request:
                type: object
                properties: {}
                default: {}
                additionalProperties: {}
            required:
              - id
              - type
              - connector
              - href
            additionalProperties: false
      required:
        - status
        - connector
        - authorization
        - requiredActions
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth2 access token or API key

````