Tower Webhooks API

The Webhooks API from Tower — 3 operation(s) for webhooks.

OpenAPI Specification

tower-webhooks-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: hello@tower.dev
    name: Tower Computing GmbH
    url: https://tower.dev
  description: REST API to interact with Tower Services.
  termsOfService: https://tower.dev/terms
  title: Tower Accounts Webhooks API
  version: v0.11.16
servers:
- url: https://api.tower.dev/v1
tags:
- name: Webhooks
paths:
  /webhooks:
    get:
      operationId: list-webhooks
      parameters:
      - description: The page number to fetch.
        explode: false
        in: query
        name: page
        schema:
          default: 1
          description: The page number to fetch.
          format: int64
          type: integer
      - description: The number of records to fetch on each page.
        explode: false
        in: query
        name: page_size
        schema:
          default: 20
          description: The number of records to fetch on each page.
          format: int64
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWebhooksResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
      - AccessTokenAuth:
        - webhooks:read
      - APIKeyAuth:
        - webhooks:read
      summary: List webhooks
      tags:
      - Webhooks
    post:
      operationId: create-webhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookParams'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebhookResponse'
          description: Created
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
      - AccessTokenAuth:
        - webhooks:create
      - APIKeyAuth:
        - webhooks:create
      summary: Create webhook
      tags:
      - Webhooks
  /webhooks/{name}:
    delete:
      operationId: delete-webhook
      parameters:
      - description: The name of the webhook.
        in: path
        name: name
        required: true
        schema:
          description: The name of the webhook.
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteWebhookResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
      - AccessTokenAuth:
        - webhooks:delete
      - APIKeyAuth:
        - webhooks:delete
      summary: Delete webhook
      tags:
      - Webhooks
    get:
      operationId: describe-webhook
      parameters:
      - description: The name of the webhook.
        in: path
        name: name
        required: true
        schema:
          description: The name of the webhook.
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DescribeWebhookResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
      - AccessTokenAuth:
        - webhooks:read
      - APIKeyAuth:
        - webhooks:read
      summary: Describe webhook
      tags:
      - Webhooks
    put:
      description: 'Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and recreate the webhook instead.'
      operationId: update-webhook
      parameters:
      - description: The name of the webhook.
        in: path
        name: name
        required: true
        schema:
          description: The name of the webhook.
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookParams'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWebhookResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
      - AccessTokenAuth:
        - webhooks:update
      - APIKeyAuth:
        - webhooks:update
      summary: Update webhook
      tags:
      - Webhooks
  /webhooks/{name}/test:
    post:
      operationId: check-webhook
      parameters:
      - description: The name of the webhook.
        in: path
        name: name
        required: true
        schema:
          description: The name of the webhook.
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
      - AccessTokenAuth:
        - webhooks:update
      - APIKeyAuth:
        - webhooks:update
      summary: Check webhook
      tags:
      - Webhooks
components:
  schemas:
    CreateWebhookResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/CreateWebhookResponse.json
          format: uri
          readOnly: true
          type: string
        signing_key:
          type: string
        webhook:
          $ref: '#/components/schemas/Webhook'
      required:
      - webhook
      - signing_key
      type: object
    UpdateWebhookResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/UpdateWebhookResponse.json
          format: uri
          readOnly: true
          type: string
        webhook:
          $ref: '#/components/schemas/Webhook'
      required:
      - webhook
      type: object
    ListWebhooksResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/ListWebhooksResponse.json
          format: uri
          readOnly: true
          type: string
        pages:
          $ref: '#/components/schemas/Pagination'
        webhooks:
          items:
            $ref: '#/components/schemas/Webhook'
          type: array
      required:
      - webhooks
      - pages
      type: object
    Webhook:
      additionalProperties: false
      properties:
        account_id:
          contentEncoding: base64
          type: string
        created_at:
          format: date-time
          type: string
        created_by_id:
          contentEncoding: base64
          type: string
        deleted_at:
          format: date-time
          type: string
        last_checked_at:
          format: date-time
          type:
          - string
          - 'null'
        name:
          type: string
        state:
          enum:
          - healthy
          - unhealthy
          - unknown
          type: string
        url:
          type: string
      required:
      - name
      - url
      - created_at
      - created_by_id
      - account_id
      - state
      - last_checked_at
      type: object
    TestWebhookResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/TestWebhookResponse.json
          format: uri
          readOnly: true
          type: string
        webhook:
          $ref: '#/components/schemas/Webhook'
      required:
      - webhook
      type: object
    DeleteWebhookResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/DeleteWebhookResponse.json
          format: uri
          readOnly: true
          type: string
        webhook:
          $ref: '#/components/schemas/Webhook'
      required:
      - webhook
      type: object
    CreateWebhookParams:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/CreateWebhookParams.json
          format: uri
          readOnly: true
          type: string
        name:
          description: The name of the webhook.
          type: string
        url:
          description: The webhook URL.
          type: string
      required:
      - name
      - url
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/ErrorModel.json
          format: uri
          readOnly: true
          type: string
        detail:
          description: A human-readable explanation specific to this occurrence of the problem.
          examples:
          - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
        instance:
          description: A URI reference that identifies the specific occurrence of the problem.
          examples:
          - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
          - 400
          format: int64
          type: integer
        title:
          description: A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
          examples:
          - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
          - https://example.com/errors/example
          format: uri
          type: string
      type: object
    UpdateWebhookParams:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/UpdateWebhookParams.json
          format: uri
          readOnly: true
          type: string
        name:
          description: The new name of the webhook.
          type: string
      required:
      - name
      type: object
    DescribeWebhookResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://api.tower.dev/v1/schemas/DescribeWebhookResponse.json
          format: uri
          readOnly: true
          type: string
        webhook:
          $ref: '#/components/schemas/Webhook'
      required:
      - webhook
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Pagination:
      additionalProperties: false
      properties:
        num_pages:
          format: int64
          type: integer
        page:
          format: int64
          type: integer
        page_size:
          format: int64
          type: integer
        total:
          format: int64
          type: integer
      required:
      - page
      - total
      - num_pages
      - page_size
      type: object
  securitySchemes:
    APIKeyAuth:
      description: API key created by a Tower user or Tower service account to authenticate an API request.
      in: header
      name: X-API-Key
      type: apiKey
    AccessTokenAuth:
      description: Access token authentication scheme which uses an access token provided by the Tower API as part of a Tower session (see documentation about creating sessions).
      scheme: Bearer
      type: http