Zapier API Documentation

Base URL:

https://app.supademo.com

Endpoint 1: Subscribe to Zapier

Endpoint: /api/integration/zapier/connect

  • Method: POST
  • Description: This API endpoint connects a Zapier integration to a workspace, allowing triggers to be set for the integration. The endpoint validates the user’s API key and checks the workspace’s subscription plan before processing the request. If the integration already exists, it updates the trigger configuration; otherwise, it creates a new integration.

Authorization


Request Parameters

  • Query Parameters:
    • trigger (string, required): The name of the trigger for which the data is being requested. The available trigger names are:
      • new-lead : Fetches data for new lead entries.
      • demo-view : Fetches data for demo view events.
    • Headers:
    • Authorization (string, required): A bearer token containing the workspace API key.

      Body:

    • url (string, required): The URL that should be associated with the trigger. This is typically the Zapier webhook URL.

Request Example

POST /api/integration/zapier/connect?trigger=NewLead

{
  "url": "https://hooks.zapier.com/hooks/catch/1234567/abcde"
}
  • Authorization Header:
Authorization: Bearer YOUR_API_KEY

Response

Success (New Integration Created)

  • Status: 201 Created
  • Description: The Zapier integration was successfully created and connected to the workspace.
  • Response Body:
{
  "integrationId": "new-integration-id"
}

Error Responses:

  1. Unauthorized
    • Status: 401 Unauthorized
    • Description: The provided API key is invalid, the workspace does not have permission, or the plan does not allow this action.
    • Response Body:
{
  "message": "Unauthorized"
}  
    • Bad Request (Missing url )
    • Status: 400 Bad Request
    • Description: The request body is missing the required url field.
    • Response Body:
{
  "message": "Bad Request: url"
}  
    • Bad Request (Missing trigger )
    • Status: 400 Bad Request
    • Description: The request query parameters are missing the trigger field.
    • Response Body:
{
  "message": "Bad Request: trigger"
} 
  1. Internal Server Error
    • Status: 500 Internal Server Error
    • Description: An error occurred while processing the integration.
    • Response Body:
{
  "message": "Internal Server Error"
} 

Endpoint 2: Unsubscribe from Zapier

Endpoint: /api/integration/zapier/connect

  • Method: DELETE
  • Description: This API endpoint removes a specific trigger from a Zapier integration for a given workspace. It takes the integrationId and triggerName as parameters and deletes the corresponding trigger from the Zapier integration configuration.

Authorization


Request Parameters

  • Query Parameters:
    • trigger (string, required): The name of the trigger that should be removed from the integration's configuration.

      Body:

    • integrationId (string, required): The ID of the existing Zapier integration from which the trigger should be removed.

Request Example

DELETE /api/integration/zapier/connect?trigger=NewLead

{
  "integrationId": "existing-integration-id"
}

Response

Success (Trigger Unsubscribed)

  • Status: 200 OK
  • Description: The specified trigger was successfully removed from the Zapier integration's configuration.
  • Response Body:
{
  "message": "Unsubscribed"
}

Error Responses:

  1. Bad Request (Missing trigger )
    • Status: 400 Bad Request
    • Description: The request query parameters are missing the trigger field.
    • Response Body:
{
  "message": "Bad Request: trigger"
}
  1. Bad Request (Missing integrationId )
    • Status: 400 Bad Request
    • Description: The request body is missing the required integrationId field.
    • Response Body:
{
  "message": "Bad Request: integrationId"
}

Endpoint 3: Get Sample Data for Zapier

Endpoint: /api/integration/zapier/connect

  • Method: GET
  • Description: This API endpoint fetches data related to specific Zapier triggers. The response contains sample data depending on the provided trigger name.

Authorization

  • Type: None (Authorization not required for this method)

Request Parameters

  • Query Parameters:
    • trigger (string, required): The name of the trigger for which the data is being requested. The available trigger names are:
      • new-lead : Fetches data for new lead entries.
      • demo-view : Fetches data for demo view events.

Request Example

GET /api/integration/zapier/connect?trigger=new-lead


Response

Success (New Lead Trigger)

  • Status: 200 OK
  • Description: Returns a list of leads in response to the new-lead trigger.
  • Response Body:
[
  {
    "email": "team@supademo.com"
  }
]

Success (Demo View Trigger)

  • Status: 200 OK
  • Description: Returns a list of demo view events in response to the demo-view trigger.
  • Response Body:
[
  {
    "name": "Jack Doe",
    "email": "team@supademo.com",
    "company": "Supademo",
    "demoTitle": "New Demo",
    "demoLink": "https://app.supademo.com/demo/123",
    "demoViewedAt": "2021-09-01T12:00:00Z"
  }
]

Error Responses

  1. Bad Request (Missing trigger )
    • Status: 400 Bad Request
    • Description: The trigger query parameter is missing from the request.
    • Response Body:
{
  "message": "Bad Request: trigger"
}

Endpoint 4: Get Authentication Information

Endpoint: /api/integration/zapier/me

  • Method: GET
  • Description: This endpoint is used to verify the API key and fetch basic information about the associated workspace. It returns the name of the workspace if the provided API key is valid.

Authorization

  • Type: Bearer Token
  • Header: Authorization: Bearer <API_KEY>
  • The API key must belong to a valid workspace in order to retrieve the workspace information.

Request Parameters

  • Headers:
    • Authorization (string, required): A bearer token containing the user's API key.

Request Example

GET /api/integration/zapier/me

  • Authorization Header:
Authorization: Bearer YOUR_API_KEY

Response

Success (Authorized)

  • Status: 200 OK
  • Description: The API key is valid, and the workspace information is returned.
  • Response Body:
{
  "name": "My Workspace",
  "message": "Authorized"
}

Error Responses:

  1. Unauthorized (Missing or Invalid API Key)
    • Status: 401 Unauthorized
    • Description: The provided API key is either missing or invalid.
    • Response Body:
{
  "message": "Unauthorized"
}

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us