APIGen Deployments API

Deploy APIs to target environments.

OpenAPI Specification

apigen-deployments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: APIGen Connectors Deployments API
  description: The APIGen API provides programmatic access to the APIGen AI-powered API generation platform. It allows you to manage projects, design and generate APIs, define endpoints and schemas, configure connectors to external data sources, deploy APIs to various environments, run automated tests, and manage users and API tokens.
  version: 1.0.0
  contact:
    name: APIGen Support
    url: https://www.apigen.com/support
    email: support@apigen.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://api.apigen.com/v1
  description: Production
security:
- bearerAuth: []
- apiKey: []
tags:
- name: Deployments
  description: Deploy APIs to target environments.
paths:
  /projects/{projectId}/apis/{apiId}/deployments:
    get:
      operationId: listDeployments
      summary: APIGen List Deployments
      description: Returns all deployments for an API.
      tags:
      - Deployments
      parameters:
      - $ref: '#/components/parameters/ProjectId'
      - $ref: '#/components/parameters/ApiId'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          description: A list of deployments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Deployment'
                  total:
                    type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createDeployment
      summary: APIGen Create a Deployment
      description: Deploys an API to a target environment.
      tags:
      - Deployments
      parameters:
      - $ref: '#/components/parameters/ProjectId'
      - $ref: '#/components/parameters/ApiId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentInput'
      responses:
        '201':
          description: Deployment initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
  /projects/{projectId}/apis/{apiId}/deployments/{deploymentId}:
    get:
      operationId: getDeployment
      summary: APIGen Get a Deployment
      description: Returns a single deployment by ID including its current status.
      tags:
      - Deployments
      parameters:
      - $ref: '#/components/parameters/ProjectId'
      - $ref: '#/components/parameters/ApiId'
      - $ref: '#/components/parameters/DeploymentId'
      responses:
        '200':
          description: A deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteDeployment
      summary: APIGen Tear Down a Deployment
      description: Tears down a deployment and removes the API from the target environment.
      tags:
      - Deployments
      parameters:
      - $ref: '#/components/parameters/ProjectId'
      - $ref: '#/components/parameters/ApiId'
      - $ref: '#/components/parameters/DeploymentId'
      responses:
        '204':
          description: Deployment torn down.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    ApiId:
      name: apiId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    DeploymentId:
      name: deploymentId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 20
        maximum: 100
    Offset:
      name: offset
      in: query
      schema:
        type: integer
        default: 0
  schemas:
    Deployment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        apiId:
          type: string
          format: uuid
        environment:
          type: string
          enum:
          - development
          - staging
          - production
        status:
          type: string
          enum:
          - pending
          - in_progress
          - deployed
          - failed
          - torn_down
        url:
          type: string
          format: uri
          description: The live URL of the deployed API.
        version:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
      - id
      - apiId
      - environment
      - status
      - createdAt
      - updatedAt
    DeploymentInput:
      type: object
      properties:
        environment:
          type: string
          enum:
          - development
          - staging
          - production
        version:
          type: string
      required:
      - environment
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key