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

# Create integration

> Create a workspace integration with upstream platform credentials. Credential values are write-only: accepted in the request body and **never** returned in the response. Does not call the upstream platform — use `POST /integrations/{id}/test` to verify.



## OpenAPI

````yaml /openapi/program.openapi.json post /integrations
openapi: 3.1.0
info:
  title: Questra Program API
  version: 0.0.1
  description: >-
    REST API for the Questra Program product. Browser users authenticate through
    Questra Auth SSO; automation uses workspace-scoped API keys (`Authorization:
    Bearer qpk_live_…`). API keys carry scopes enforced before handlers.
    Outbound webhooks follow Standard Webhooks (at-least-once delivery;
    consumers must be idempotent).
servers:
  - url: /v1
    description: Program API base path
security: []
paths:
  /integrations:
    post:
      tags:
        - Integrations
      summary: Create integration
      description: >-
        Create a workspace integration with upstream platform credentials.
        Credential values are write-only: accepted in the request body and
        **never** returned in the response. Does not call the upstream platform
        — use `POST /integrations/{id}/test` to verify.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIntegrationRequest'
      responses:
        '201':
          description: Integration created (without credential values)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorBody'
        '403':
          description: Feature disabled (e.g. Questra Publish target not enabled)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
components:
  schemas:
    CreateIntegrationRequest:
      oneOf:
        - type: object
          properties:
            name:
              type: string
              minLength: 1
            platform:
              type: string
              enum:
                - questra
            config:
              type: object
              properties:
                api_base_url:
                  type: string
                  format: uri
                  example: https://publish.example.com
                  description: Questra Publish API origin.
              required:
                - api_base_url
              description: Non-secret Questra Publish settings.
            credentials:
              type: object
              properties:
                api_key:
                  type: string
                  minLength: 1
                  example: qpub_live_…
                  description: Publish admin API key. Write-only.
              required:
                - api_key
              description: Secret credential fields. Never returned.
          required:
            - name
            - platform
            - config
            - credentials
        - type: object
          properties:
            name:
              type: string
              minLength: 1
            platform:
              type: string
              enum:
                - decipher
            config:
              type: object
              properties:
                base_url:
                  type: string
                  format: uri
                  example: https://tenant.decipherinc.com
              required:
                - base_url
            credentials:
              type: object
              properties:
                api_key:
                  type: string
                  minLength: 1
              required:
                - api_key
          required:
            - name
            - platform
            - config
            - credentials
        - type: object
          properties:
            name:
              type: string
              minLength: 1
            platform:
              type: string
              enum:
                - confirmit
            config:
              type: object
              properties:
                base_url:
                  type: string
                  format: uri
                  example: https://tenant.confirmit.com
              required:
                - base_url
            credentials:
              type: object
              properties:
                username:
                  type: string
                  minLength: 1
                password:
                  type: string
                  minLength: 1
              required:
                - username
                - password
          required:
            - name
            - platform
            - config
            - credentials
        - type: object
          properties:
            name:
              type: string
              minLength: 1
            platform:
              type: string
              enum:
                - qualtrics
            config:
              type: object
              properties:
                datacenter:
                  type: string
                  minLength: 1
                  example: iad1
                base_url:
                  type: string
                  format: uri
                  example: https://iad1.qualtrics.com
              description: >-
                Provide `datacenter` and/or `base_url`. At least one is
                required.
            credentials:
              type: object
              properties:
                api_token:
                  type: string
                  minLength: 1
              required:
                - api_token
          required:
            - name
            - platform
            - config
            - credentials
        - type: object
          properties:
            name:
              type: string
              minLength: 1
            platform:
              type: string
              enum:
                - alchemer
            config:
              type: object
              properties:
                datacenter:
                  type: string
                  enum:
                    - us
                    - eu
                    - ca
                  example: us
                base_url:
                  type: string
                  format: uri
            credentials:
              type: object
              properties:
                api_token:
                  type: string
                  minLength: 1
                api_token_secret:
                  type: string
                  minLength: 1
              required:
                - api_token
                - api_token_secret
          required:
            - name
            - platform
            - credentials
    IntegrationResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Integration'
      required:
        - data
    ValidationErrorBody:
      type: object
      properties:
        error:
          type: string
          enum:
            - validation_error
        message:
          type: string
        details: {}
      required:
        - error
    ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        resource:
          type: string
        slug:
          type: string
        file_id:
          type: string
        endpoint_id:
          type: string
        event_id:
          type: string
        delivery_id:
          type: string
        api_key_id:
          type: string
        integration_id:
          type: string
        audit_id:
          type: string
        status:
          type: string
        details: {}
        question_ids:
          type: array
          items:
            type: string
        survey_ids:
          type: array
          items:
            type: string
        revisions:
          type: array
          items:
            type: number
      required:
        - error
    Integration:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          example: community-decipher
          description: >-
            UUID for workspace-owned integrations, or a stable slug for managed
            virtual integrations.
        name:
          type: string
          example: Prod Qualtrics
        platform:
          type: string
          enum:
            - questra
            - decipher
            - confirmit
            - qualtrics
            - alchemer
          example: qualtrics
        config:
          type: object
          additionalProperties:
            type: string
          example:
            datacenter: iad1
            base_url: https://iad1.qualtrics.com
          description: >-
            Non-secret platform settings (e.g. base_url, datacenter,
            account_id). Safe to return to clients.
        credentials_configured:
          type: boolean
          description: >-
            True when at least one credential field is stored for this
            integration.
        credential_fields:
          type: array
          items:
            type: string
          example:
            - api_token
          description: >-
            Names of stored credential keys only. Values are write-only and
            never returned after create or update.
        last_tested_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When credentials were last known-good or known-bad (explicit test or
            successful/auth-failed upstream call). Null when never verified
            since create or credential change.
        last_test_status:
          $ref: '#/components/schemas/IntegrationTestStatus'
        managed:
          type: boolean
          description: >-
            True for Questra-managed virtual integrations (e.g. Community
            Decipher).
        managed_kind:
          $ref: '#/components/schemas/IntegrationManagedKind'
        capabilities:
          $ref: '#/components/schemas/IntegrationCapabilities'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - name
        - platform
        - config
        - credentials_configured
        - credential_fields
        - last_tested_at
        - last_test_status
        - managed
        - managed_kind
        - capabilities
        - created_at
        - updated_at
    IntegrationTestStatus:
      type: string
      enum:
        - ok
        - failed
        - untested
      description: >-
        `ok` = last decisive observation succeeded; `failed` = credentials
        rejected (auth); `untested` = unknown since create or credential/config
        change. Transient network errors do not change this.
    IntegrationManagedKind:
      type:
        - string
        - 'null'
      enum:
        - community_decipher
        - null
    IntegrationCapabilities:
      type: object
      properties:
        can_update_credentials:
          type: boolean
        can_delete:
          type: boolean
        can_view_dashboard:
          type: boolean
        survey_list_scope:
          type: string
          enum:
            - all
            - workspace_created
      required:
        - can_update_credentials
        - can_delete
        - can_view_dashboard
        - survey_list_scope

````