Zapier REST Hooks API

Endpoint documentation for Zapier integration

Documentacion de endpoints para integracion con Zapier

Base URL: https://backend.portermetrics.com/agents/v1/zapier
Authentication
Autenticacion

All endpoints require authentication using ID Token (not Access Token). The token must be sent in the header Authorization: Bearer <id_token>

Todos los endpoints requieren autenticacion mediante ID Token (no Access Token). El token debe enviarse en el header Authorization: Bearer <id_token>

GET /auth/test Authentication Validation Validacion de Autenticacion

Validates the JWT token and returns the user's company_id. Used by Zapier to verify that credentials are valid.

Valida el token JWT y retorna el company_id del usuario. Usado por Zapier para verificar que las credenciales son validas.

Headers

HeaderValueValorRequiredRequerido
AuthorizationBearer <id_token>YesSi

Response 200

{ "status": "ok", "company_id": "550e8400-e29b-41d4-a716-446655440000" }

ErrorsErrores

401 - Invalid or expired tokenToken invalido o expirado
400 - User has no OWNER companyUsuario no tiene company OWNER
POST /hooks/subscribe Create Subscription Crear Suscripcion

Creates webhook subscriptions for Zapier. Automatically called by Zapier when a user activates a Zap that uses your trigger.

Crea suscripciones de webhook para Zapier. Llamado automaticamente por Zapier cuando un usuario activa un Zap que usa tu trigger.

Headers

HeaderValueValorRequiredRequerido
AuthorizationBearer <id_token>YesSi
Content-Typeapplication/jsonYesSi

Request Body

FieldCampoTypeTipoRequiredRequeridoDescriptionDescripcion
workflow_idUUIDYesSiWorkflow ID in the systemID del workflow en el sistema
node_idsarray[string]NoNoList of "Send to Zapier" node IDsLista de IDs de nodos "Send to Zapier"
targetstringYesSiWebhook URL provided by ZapierURL del webhook proporcionado por Zapier

Example RequestEjemplo Request

{ "workflow_id": "550e8400-e29b-41d4-a716-446655440000", "node_ids": ["node-zapier-1", "node-zapier-2"], "target": "https://hooks.zapier.com/hooks/catch/12345/abcdef" }

Response 200

{ "zapier_workflow_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
Note
Nota

The zapier_workflow_id is generated by the system. Zapier will store it in subscribeData and send it back on unsubscribe. If multiple node_ids are sent, one subscription is created per node, all sharing the same zapier_workflow_id.

El zapier_workflow_id es generado por el sistema. Zapier lo guardara en subscribeData y lo enviara de vuelta en el unsubscribe. Si se envian multiples node_ids, se crea una suscripcion por cada uno, todas compartiendo el mismo zapier_workflow_id.

ErrorsErrores

401 - Invalid tokenToken invalido
400 - Workflow not foundWorkflow no encontrado
403 - No access to workflowSin acceso al workflow
POST /hooks/unsubscribe Delete Subscription Eliminar Suscripcion

Deletes webhook subscriptions. Automatically called by Zapier when the user deactivates or deletes a Zap.

Elimina suscripciones de webhook. Llamado automaticamente por Zapier cuando el usuario desactiva o elimina un Zap.

Headers

HeaderValueValorRequiredRequerido
AuthorizationBearer <id_token>YesSi
Content-Typeapplication/jsonYesSi

Request Body

FieldCampoTypeTipoRequiredRequeridoDescriptionDescripcion
zapier_workflow_idstringYesSiID returned from /subscribeID retornado en /subscribe

Example RequestEjemplo Request

{ "zapier_workflow_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }

Response 200

{ "status": "ok", "deleted": 2 }
Note
Nota

Does not throw an error if there are no subscriptions to delete (returns deleted: 0). Deletes all subscriptions matching the zapier_workflow_id in any of the user's companies.

No genera error si no hay suscripciones que eliminar (retorna deleted: 0). Elimina todas las suscripciones que coincidan con el zapier_workflow_id en cualquiera de las companies del usuario.

GET /workflows List Workflows Listar Workflows

Gets the list of workflows the user has access to. Returns only the ID and name of each workflow.

Obtiene la lista de workflows a los que el usuario tiene acceso. Retorna solo ID y nombre de cada workflow.

Headers

HeaderValueValorRequiredRequerido
AuthorizationBearer <id_token>YesSi

Response 200

{ "workflows": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My Marketing Workflow" }, { "id": "660f9500-f30c-52e5-b827-557766551111", "name": "Sales Workflow" } ] }

ErrorsErrores

401 - Invalid tokenToken invalido
GET /workflow-steps/{workflow_id} Get Workflow Steps Obtener Steps de Workflow

Gets the steps (nodes) of a specific workflow, with option to filter by type and subtype.

Obtiene los steps (nodos) de un workflow especifico, con opcion de filtrar por tipo y subtipo.

Headers

HeaderValueValorRequiredRequerido
AuthorizationBearer <id_token>YesSi

Path Parameters

ParameterParametroTypeTipoRequiredRequeridoDescriptionDescripcion
workflow_idUUIDYesSiWorkflow IDID del workflow

Query Parameters

ParameterParametroTypeTipoRequiredRequeridoDescriptionDescripcion
step_typestringNoNoFilter by type (e.g., "DESTINATION")Filtrar por tipo (ej: "DESTINATION")
step_sub_typestringNoNoFilter by subtype (e.g., "zapier")Filtrar por subtipo (ej: "zapier")

Example RequestEjemplo Request

GET /workflow-steps/550e8400-e29b-41d4-a716-446655440000?step_type=DESTINATION&step_sub_type=zapier

Response 200

{ "steps": [ { "id": "node-1", "title": "Send to Zapier" }, { "id": "node-2", "title": "Zapier Notification" } ] }
Filtering Logic
Logica de Filtrado

If step_type is specified, only nodes with that type are returned.
If step_sub_type is specified, only nodes that have that subtype are returned.
If the node doesn't have a sub_type field and the filter was specified, it's omitted.
Returns empty array if there are no matches.

Si step_type se especifica, solo se retornan nodos con ese tipo.
Si step_sub_type se especifica, solo se retornan nodos que tengan ese subtipo.
Si el nodo no tiene campo sub_type y se especifico el filtro, se omite.
Retorna array vacio si no hay coincidencias.

ErrorsErrores

401 - Invalid tokenToken invalido
400 - Workflow not foundWorkflow no encontrado
403 - No access to workflowSin acceso al workflow
422 - Invalid UUIDUUID invalido

Porter Hub - Zapier Integration API v1.0