Terapi Integrations API

Manage available integration configurations

OpenAPI Specification

terapi-integrations-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Terapi Actions Integrations API
  description: Terapi is an open-source embedded integration platform for building native product integrations. The REST API provides endpoints for managing integration connections, synchronizing data between third-party services, triggering actions on external APIs, and managing authentication tokens. Terapi enables SaaS products to offer native integrations to their customers without building each connector from scratch.
  version: '1.0'
  contact:
    name: Terapi Team
    url: https://terapi.dev
servers:
- url: https://api.terapi.dev
  description: Terapi Cloud API
- url: http://localhost:3003
  description: Terapi Self-Hosted API
security:
- SecretKeyAuth: []
tags:
- name: Integrations
  description: Manage available integration configurations
paths:
  /integration:
    get:
      operationId: listIntegrations
      summary: List Integrations
      description: Returns a list of all configured integrations (provider configurations) in your Terapi environment.
      tags:
      - Integrations
      responses:
        '200':
          description: Integrations retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createIntegration
      summary: Create Integration
      description: Creates a new integration configuration with credentials for a third-party provider. This enables end-users to connect to this provider.
      tags:
      - Integrations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIntegrationRequest'
      responses:
        '200':
          description: Integration created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Integration'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /integration/{provider_config_key}:
    get:
      operationId: getIntegration
      summary: Get Integration
      description: Returns details of a specific integration configuration.
      tags:
      - Integrations
      parameters:
      - name: provider_config_key
        in: path
        required: true
        description: The unique key for this integration configuration
        schema:
          type: string
      responses:
        '200':
          description: Integration retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Integration'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteIntegration
      summary: Delete Integration
      description: Deletes an integration configuration. All associated connections will also be deleted.
      tags:
      - Integrations
      parameters:
      - name: provider_config_key
        in: path
        required: true
        description: The unique key for this integration configuration
        schema:
          type: string
      responses:
        '204':
          description: Integration deleted successfully
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    IntegrationListResponse:
      type: object
      properties:
        integrations:
          type: array
          items:
            $ref: '#/components/schemas/Integration'
    Integration:
      type: object
      description: An integration configuration for a third-party provider
      properties:
        unique_key:
          type: string
          description: Your unique key for this integration configuration
        provider:
          type: string
          description: The provider name (e.g., github, salesforce, slack)
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        connection_count:
          type: integer
          description: Number of active connections using this integration
    CreateIntegrationRequest:
      type: object
      required:
      - provider_config_key
      - provider
      properties:
        provider_config_key:
          type: string
          description: Your unique key for this integration configuration
        provider:
          type: string
          description: The provider name from Terapi's supported providers list
        oauth_client_id:
          type: string
          description: OAuth client ID for OAuth2 providers
        oauth_client_secret:
          type: string
          description: OAuth client secret for OAuth2 providers
        oauth_scopes:
          type: string
          description: Comma-separated list of OAuth scopes to request
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Human-readable error message
  responses:
    Unauthorized:
      description: Authentication failed - invalid or missing secret key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Invalid request parameters or body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    SecretKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Secret key from Terapi environment settings. Passed as 'Bearer {secret_key}'
externalDocs:
  description: Terapi Documentation
  url: https://docs.terapi.dev