CompanyCam Webhooks API

The Webhooks API from CompanyCam — 2 operation(s) for webhooks.

OpenAPI Specification

companycam-webhooks-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: v2
  title: Core Checklists Webhooks API
servers:
- url: https://api.companycam.com/v2
security:
- BearerAuth: []
tags:
- name: Webhooks
paths:
  /webhooks:
    get:
      summary: List Webhooks
      operationId: listWebhooks
      tags:
      - Webhooks
      parameters:
      - name: page
        in: query
        schema:
          type: integer
          format: int32
      - name: per_page
        in: query
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: List of webhooks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Bad Request
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Record not found
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - An unexpected error occured
    post:
      summary: Create Webhook
      operationId: createWebhook
      tags:
      - Webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                url:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                enabled:
                  type: boolean
                token:
                  type: string
      responses:
        '201':
          description: The created webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Bad Request
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Record not found
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - An unexpected error occured
  /webhooks/{id}:
    get:
      summary: Retrieve Webhook
      operationId: getWebhook
      tags:
      - Webhooks
      parameters:
      - name: id
        in: path
        description: ID of the Webhooks
        required: true
        schema:
          type: string
          format: id
      responses:
        '200':
          description: Details about the webhooks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Bad Request
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Record not found
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - An unexpected error occured
    put:
      summary: Update Webhook
      parameters:
      - name: id
        in: path
        description: ID of the Webhook
        required: true
        schema:
          type: string
          format: id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                url:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                enabled:
                  type: boolean
                token:
                  type: string
      operationId: updateWebhook
      tags:
      - Webhooks
      responses:
        '201':
          description: The updated webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Bad Request
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Record not found
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - An unexpected error occured
    delete:
      summary: Delete Webhook
      parameters:
      - name: id
        in: path
        description: ID of the Webhook
        required: true
        schema:
          type: string
          format: id
      operationId: deleteWebhook
      tags:
      - Webhooks
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Bad Request
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - Record not found
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                - An unexpected error occured
components:
  schemas:
    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
          example:
          - Record not found
    Webhook:
      type: object
      required:
      - id
      properties:
        id:
          type: string
          description: A unique ID for the Webhook.
        company_id:
          type: string
          description: A unique ID for the Company the Webhook belongs to
        url:
          type: string
          description: The URL of the webhook, which will receive requests with data for any events fired that fall within the scopes of the Webhook.
        scopes:
          type: array
          description: A list of scopes covering events the Webhook is subscripted to.
          items:
            type: string
        token:
          type: string
          description: A string used to hash the webhook body for verification.
        enabled:
          type: boolean
          description: Whether or not the Webhook is enabled/active.
        created_at:
          type: integer
          format: int32
          description: Timestamp when the Webhook was created on the server
        updated_at:
          type: integer
          format: int32
          description: Timestamp when the Webhook was last updated
      example:
        id: '42'
        company_id: '8675309'
        url: https://sweet-webhooks.com/my/webhook/endpoint
        scopes:
        - '*'
        token: '123456'
        enabled: true
        created_at: 1490737206
        updated_at: 1490737406
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer