openapi: 3.1.0 info: title: Relay App Automation API description: >- The Relay.app API enables programmatic interaction with the Relay workflow automation platform. Developers can trigger workflow runs via webhooks, make custom HTTP requests to external systems, and manage automation through scheduled and event-based triggers. The API supports JSON payloads, custom response codes, and deduplication for webhook-triggered workflows. version: 1.0.0 contact: url: https://docs.relay.app/ license: name: Proprietary url: https://www.relay.app/terms servers: - url: https://api.relay.app/v1 description: Relay App API tags: - name: Webhooks description: Webhook trigger endpoints for initiating workflow runs - name: Workflows description: Operations for managing and triggering workflow runs - name: Runs description: Operations for managing and inspecting workflow run instances paths: /webhooks/{webhookId}: post: operationId: triggerWebhookWorkflow summary: Trigger Webhook Workflow description: >- Triggers a workflow run by sending an HTTP POST request to the workflow's unique webhook endpoint. The workflow is started immediately when a valid HTTP request is received. A relayDeduplicationKey can be provided to ensure each unique workflow is only triggered once per key. tags: - Webhooks parameters: - name: webhookId in: path required: true description: The unique identifier for the webhook-triggered workflow. schema: type: string - name: relay-deduplication-key in: header required: false description: >- A unique key to prevent duplicate workflow runs. If a run with this key has already been triggered, the new request will be deduplicated. schema: type: string requestBody: required: false description: JSON payload data to pass into the workflow run. content: application/json: schema: type: object additionalProperties: true description: Arbitrary JSON data to be used in the workflow. responses: '200': description: Workflow run triggered successfully. content: application/json: schema: $ref: '#/components/schemas/WebhookTriggerResponse' '400': description: Bad request - invalid payload. '404': description: Webhook not found. '429': description: Rate limit exceeded. get: operationId: triggerWebhookWorkflowGet summary: Trigger Webhook Workflow via GET description: >- Triggers a workflow run via an HTTP GET request. Useful for simple integrations that do not support POST methods. tags: - Webhooks parameters: - name: webhookId in: path required: true description: The unique identifier for the webhook-triggered workflow. schema: type: string responses: '200': description: Workflow run triggered successfully. content: application/json: schema: $ref: '#/components/schemas/WebhookTriggerResponse' '404': description: Webhook not found. /workflows: get: operationId: listWorkflows summary: List Workflows description: Retrieves a list of all workflows in the account. tags: - Workflows parameters: - name: page in: query required: false description: Page number for pagination. schema: type: integer default: 1 - name: limit in: query required: false description: Number of results per page. schema: type: integer default: 20 maximum: 100 responses: '200': description: List of workflows returned successfully. content: application/json: schema: $ref: '#/components/schemas/WorkflowList' '401': description: Unauthorized. /workflows/{workflowId}: get: operationId: getWorkflow summary: Get Workflow description: Retrieves details of a specific workflow by its ID. tags: - Workflows parameters: - name: workflowId in: path required: true description: The unique identifier of the workflow. schema: type: string responses: '200': description: Workflow retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/Workflow' '404': description: Workflow not found. /workflows/{workflowId}/runs: get: operationId: listWorkflowRuns summary: List Workflow Runs description: Retrieves a list of run instances for a specific workflow. tags: - Runs parameters: - name: workflowId in: path required: true description: The unique identifier of the workflow. schema: type: string - name: status in: query required: false description: Filter runs by status. schema: type: string enum: - running - completed - failed - paused - cancelled - name: limit in: query required: false description: Number of results to return. schema: type: integer default: 20 responses: '200': description: List of workflow runs returned successfully. content: application/json: schema: $ref: '#/components/schemas/WorkflowRunList' /runs/{runId}: get: operationId: getWorkflowRun summary: Get Workflow Run description: Retrieves the details and status of a specific workflow run. tags: - Runs parameters: - name: runId in: path required: true description: The unique identifier of the workflow run. schema: type: string responses: '200': description: Workflow run retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/WorkflowRun' '404': description: Run not found. /runs/{runId}/cancel: post: operationId: cancelWorkflowRun summary: Cancel Workflow Run description: Cancels a currently running or paused workflow run. tags: - Runs parameters: - name: runId in: path required: true description: The unique identifier of the workflow run. schema: type: string responses: '200': description: Workflow run cancelled successfully. '400': description: Run cannot be cancelled in its current state. '404': description: Run not found. /runs/{runId}/approve: post: operationId: approveWorkflowRunStep summary: Approve Workflow Run Step description: >- Approves a paused workflow run step that is waiting for human-in-the-loop approval before proceeding to the next step. tags: - Runs parameters: - name: runId in: path required: true description: The unique identifier of the workflow run. schema: type: string requestBody: required: false content: application/json: schema: type: object properties: comment: type: string description: Optional comment to include with the approval. inputs: type: object additionalProperties: true description: Optional input data to provide for the next workflow step. responses: '200': description: Workflow run step approved successfully. '400': description: Run is not waiting for approval. '404': description: Run not found. components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-Relay-API-Key description: API key for authenticating requests to the Relay App API. schemas: WebhookTriggerResponse: type: object properties: runId: type: string description: The unique ID of the triggered workflow run. workflowId: type: string description: The ID of the triggered workflow. status: type: string description: Initial status of the triggered run. enum: - running - queued deduplicated: type: boolean description: Whether this request was deduplicated against a previous run. Workflow: type: object properties: id: type: string description: The unique identifier of the workflow. name: type: string description: The name of the workflow. description: type: string description: Optional description of the workflow. status: type: string enum: - active - inactive - draft description: Current status of the workflow. triggerType: type: string enum: - webhook - scheduled - manual - app - form - table - batch - rss description: The type of trigger that starts this workflow. createdAt: type: string format: date-time description: Date and time the workflow was created. updatedAt: type: string format: date-time description: Date and time the workflow was last updated. WorkflowList: type: object properties: results: type: array items: $ref: '#/components/schemas/Workflow' totalCount: type: integer description: Total number of workflows. page: type: integer description: Current page number. limit: type: integer description: Number of results per page. WorkflowRun: type: object properties: id: type: string description: The unique identifier of the workflow run. workflowId: type: string description: The ID of the workflow being run. status: type: string enum: - running - completed - failed - paused - cancelled description: Current status of the workflow run. startedAt: type: string format: date-time description: Date and time the run was started. completedAt: type: string format: date-time description: Date and time the run was completed. error: type: string description: Error message if the run failed. inputData: type: object additionalProperties: true description: Input data provided when the run was triggered. WorkflowRunList: type: object properties: results: type: array items: $ref: '#/components/schemas/WorkflowRun' totalCount: type: integer security: - ApiKeyAuth: []