Trengo Webhooks API

Register and manage webhook subscriptions.

OpenAPI Specification

trengo-webhooks-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Trengo Channels Webhooks API
  description: REST API for the Trengo omnichannel customer-engagement platform. Manage tickets (conversations), contacts and profiles, messages, channels, teams and users, labels and custom fields, webhooks, and outbound WhatsApp templates across email, WhatsApp, live chat, voice, SMS, and social channels. All requests authenticate with a personal access token sent as an HTTP Bearer token.
  termsOfService: https://trengo.com/terms-conditions
  contact:
    name: Trengo Support
    url: https://developers.trengo.com/docs/welcome
  version: '2.0'
servers:
- url: https://app.trengo.com/api/v2
  description: Trengo REST API v2
security:
- bearerAuth: []
tags:
- name: Webhooks
  description: Register and manage webhook subscriptions.
paths:
  /webhooks:
    post:
      operationId: createWebhook
      tags:
      - Webhooks
      summary: Create a webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '201':
          description: The created webhook.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /webhooks/{webhook_id}:
    put:
      operationId: updateWebhook
      tags:
      - Webhooks
      summary: Update a webhook
      parameters:
      - $ref: '#/components/parameters/WebhookId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '200':
          description: The updated webhook.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    delete:
      operationId: deleteWebhook
      tags:
      - Webhooks
      summary: Delete a webhook
      parameters:
      - $ref: '#/components/parameters/WebhookId'
      responses:
        '204':
          description: Webhook deleted.
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    Webhook:
      type: object
      properties:
        id:
          type: integer
          format: int32
        url:
          type: string
          format: uri
        name:
          type: string
    CreateWebhookRequest:
      type: object
      required:
      - url
      properties:
        url:
          type: string
          format: uri
          description: HTTPS endpoint that receives event callbacks.
        name:
          type: string
  parameters:
    WebhookId:
      name: webhook_id
      in: path
      required: true
      schema:
        type: integer
        format: int32
  responses:
    TooManyRequests:
      description: Rate limit exceeded (120 requests per minute per token). Honor the Retry-After and X-RateLimit-Reset response headers.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix timestamp when the limit resets.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Personal access token generated in the Trengo account, sent as `Authorization: Bearer {TOKEN}`.'