> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cantina.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoint to create a Zapier subscription.

> This is how a Zap (An automated Zapier workflow that connects Cantina to other apps that have Zapier integrations)
makes a subscription request to Cantina to be notified (via webhook) of events.

The payload contains a `target_url` which is the URL used as the webhook.

See https://docs.zapier.com/platform/build/hook-trigger#subscribe

# Access control rules

- The requester is authenticated.



## OpenAPI

````yaml POST /api/v0/zapier/subscriptions
openapi: 3.1.0
info:
  title: Cantina Client API
  description: >-
    Endpoints available to client organizations. For an overview and
    authentication, see
    https://docs.cantina.xyz/for-organizations/getting-started/api-access.
  license:
    name: Cantina
    identifier: Cantina
  version: 0.1.0
servers: []
security: []
paths:
  /api/v0/zapier/subscriptions:
    post:
      tags:
        - zapier
      summary: Endpoint to create a Zapier subscription.
      description: >-
        This is how a Zap (An automated Zapier workflow that connects Cantina to
        other apps that have Zapier integrations)

        makes a subscription request to Cantina to be notified (via webhook) of
        events.


        The payload contains a `target_url` which is the URL used as the
        webhook.


        See https://docs.zapier.com/platform/build/hook-trigger#subscribe


        # Access control rules


        - The requester is authenticated.
      operationId: create_subscription
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewZapierSubscription'
        required: true
      responses:
        '201':
          description: Creation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedResource'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '401':
          description: Access not authorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '403':
          description: Access forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    NewZapierSubscription:
      allOf:
        - $ref: '#/components/schemas/ZapierSubscriptionData'
        - type: object
          required:
            - targetUrl
          properties:
            targetUrl:
              type: string
    CreatedResource:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
    CantinaError:
      type: object
      description: Error returned by the Cantina API.
      required:
        - type
        - msg
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        msg:
          type: string
          description: Error message for the user.
    ZapierSubscriptionData:
      oneOf:
        - type: object
          required:
            - repositoryId
            - kind
          properties:
            repositoryId:
              type: string
              format: uuid
            kind:
              type: string
              enum:
                - finding_created
        - type: object
          required:
            - repositoryId
            - kind
          properties:
            repositoryId:
              type: string
              format: uuid
            kind:
              type: string
              enum:
                - finding_label_added
        - type: object
          required:
            - repositoryId
            - kind
          properties:
            repositoryId:
              type: string
              format: uuid
            kind:
              type: string
              enum:
                - finding_comment_created
        - type: object
          required:
            - repositoryId
            - kind
          properties:
            repositoryId:
              type: string
              format: uuid
            kind:
              type: string
              enum:
                - finding_updated
    ErrorType:
      type: string
      description: Type of error.
      enum:
        - email_not_verified
        - auth_invalid
        - auth_expired
        - auth_token_missing
        - auth_id_missing
        - invalid_password
        - disabled_user
        - tc_not_accepted
        - evicted
        - unauthorized
        - bad_request
        - not_found
        - forbidden
        - gone
        - payload_too_large
        - service_unavailable
        - internal_error

````