openapi: 3.0.0 info: title: Avaya Infinity Workflow API version: 1.0.0 description: Execute workflows programmatically to automate business processes, trigger notifications, route interactions, and integrate with external systems. contact: name: Avaya Developer Support url: https://developers.avayacloud.com email: developer-support@avaya.com servers: - url: https://core.{customer-subdomain}.ec.avayacloud.com/api/workflow/v1 description: Production server variables: customer-subdomain: default: avaya1234 description: Your customer subdomain found in your Infinity portal URL security: - bearerAuth: [] paths: /workflows/sessions: post: summary: Start a workflow session description: "Execute workflows programmatically to automate business processes, trigger notifications, route interactions,\ \ and integrate with external systems.\n\n## Quick Start\n\n### 1. Find Your Customer Subdomain\n\nYour subdomain\ \ is found in your Infinity portal URL.\n\n**Example:** If your portal URL is:\n```\nhttps://core.avaya1234.ec.avayacloud.com/app/core-config-ui/\n\ ```\n\nYour subdomain is: **`avaya1234`**\n\n### 2. Get Your Access Token\n\nFollow the [Access Token API guide](https://developers.avayacloud.com/avaya-infinity/reference/generateaccesstoken)\ \ to generate your Bearer token.\n\n### 3. Make Your First Request\n\nReplace `{customer-subdomain}` with your actual\ \ subdomain and add your Bearer token to get started.\n\n## Working with Variables\n\nVariables you pass are accessible\ \ throughout your workflow execution:\n\n```json\n{\n \"variables\": {\n \"customer_name\": \"John Smith\",\n\ \ \"order_id\": \"TEST-1984-001\",\n \"amount\": \"499.99\"\n }\n}\n```\n\n**Access in Workflow:**\n- `{{customer_name}}`\ \ → \"John Smith\"\n- `{{order_id}}` → \"TEST-1984-001\"\n- `{{amount}}` → \"499.99\"\n\n**Common Use Cases:**\n-\ \ Send data to external systems via webhook modules\n- Make routing decisions based on values (amount, status, priority)\n\ - Personalize notifications and messages\n- Pass customer context to agents\n" operationId: startWorkflowSession tags: - Workflow Sessions requestBody: required: true content: application/json: schema: type: object required: - workflowId properties: workflowId: type: string description: The unique identifier of the workflow to execute example: wf_customer_inquiry workflowVersionId: type: string description: Specific version to execute (defaults to latest published version) example: v2.1 variables: type: object description: Key-value pairs that become accessible in your workflow as `{{key}}` additionalProperties: true example: customer_name: John Smith order_id: ORD-2024-1984 issue_type: billing priority: high source: type: object description: Context information for routing and tracking (not accessible as workflow variables) additionalProperties: true example: channel: web campaignId: summer-promo-2024 referrer: google-ads examples: customer_inquiry: summary: Customer Support Inquiry value: workflowId: wf_customer_inquiry workflowVersionId: v2.1 variables: customer_name: John Smith order_id: ORD-2024-1984 issue_type: billing order_processing: summary: Process Customer Order value: workflowId: wf_order_processing variables: order_id: ORD-2024-5678 customer_id: CUST-1234 items: '[{"sku":"WIDGET-A","quantity":2},{"sku":"GADGET-B","quantity":1}]' shipping_address: '{"street":"123 Main St","city":"New York","state":"NY","zip":"10001"}' notification_campaign: summary: Send Notification Campaign value: workflowId: wf_notification_campaign variables: campaign_id: PROMO-SUMMER-2024 customer_segment: loyal_customers offer_code: SAVE20 expiry_date: '2024-07-31' responses: '200': description: Workflow session started successfully content: application/json: schema: type: object properties: sessionId: type: string description: Unique identifier for this workflow session. Use this to query status. example: session_abc123xyz789 workflowId: type: string description: The workflow that was executed example: wf_customer_inquiry workflowVersionId: type: string description: The specific version that was executed example: v2.1 status: type: string enum: - RUNNING - COMPLETED - FAILED description: Current execution status example: RUNNING isRunning: type: boolean description: True if workflow is actively executing example: true startTime: type: string format: date-time description: When the workflow session began (ISO 8601) example: '2024-01-16T14:30:00Z' endTime: type: string format: date-time description: When the workflow completed (only present if status is COMPLETED or FAILED) example: '2024-01-16T14:35:00Z' currentModule: type: string nullable: true description: ID of the module currently executing (null if completed) example: module_routing_decision variables: type: object description: All input variables plus any variables set during execution additionalProperties: true example: customer_name: John Smith order_id: ORD-2024-1984 issue_type: billing outputVariables: type: object description: Variables specifically marked as outputs (only present when completed) additionalProperties: true example: sessionId: session_abc123xyz789 workflowId: wf_customer_inquiry workflowVersionId: v2.1 status: RUNNING isRunning: true startTime: '2024-01-16T14:30:00Z' currentModule: module_routing_decision variables: customer_name: John Smith order_id: ORD-2024-1984 issue_type: billing '400': description: Bad Request - Invalid parameters content: application/json: schema: $ref: '#/components/schemas/Error' examples: missing_parameter: summary: Missing Required Parameter value: error: INVALID_REQUEST message: workflowId is required field: workflowId invalid_json: summary: Invalid JSON value: error: INVALID_JSON message: Request body must be valid JSON '401': description: Unauthorized - Missing or invalid access token content: application/json: schema: $ref: '#/components/schemas/Error' example: error: UNAUTHORIZED message: Invalid or expired access token '404': description: Not Found - Workflow does not exist or is not published content: application/json: schema: $ref: '#/components/schemas/Error' example: error: WORKFLOW_NOT_FOUND message: Workflow 'wf_customer_inquiry' not found or not published workflowId: wf_customer_inquiry '429': description: Too Many Requests - Rate limit exceeded headers: Retry-After: schema: type: integer description: Number of seconds to wait before retrying content: application/json: schema: $ref: '#/components/schemas/Error' example: error: RATE_LIMIT_EXCEEDED message: Too many requests. Please retry after 60 seconds. retryAfter: 60 '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Error' example: error: INTERNAL_ERROR message: An unexpected error occurred. Please contact support. requestId: req_abc123 x-code-samples: - lang: JavaScript label: Node.js source: "const axios = require('axios');\n\nconst subdomain = 'avaya1234';\nconst bearerToken = 'your-access-token-here';\n\ \nasync function startWorkflow() {\n try {\n const response = await axios.post(\n `https://core.${subdomain}.ec.avayacloud.com/api/workflow/v1/workflows/sessions`,\n\ \ {\n workflowId: 'wf_customer_inquiry',\n workflowVersionId: 'v2.1',\n variables: {\n\ \ customer_name: 'John Smith',\n order_id: 'ORD-2024-1984',\n issue_type: 'billing'\n\ \ }\n },\n {\n headers: {\n 'Authorization': `Bearer ${bearerToken}`,\n \ \ 'Content-Type': 'application/json'\n }\n }\n );\n \n console.log('Session ID:', response.data.sessionId);\n\ \ console.log('Status:', response.data.status);\n } catch (error) {\n console.error('Error:', error.response?.data\ \ || error.message);\n }\n}\n\nstartWorkflow();\n" - lang: Python source: "import requests\n\nsubdomain = 'avaya1234'\nbearer_token = 'your-access-token-here'\n\nurl = f'https://core.{subdomain}.ec.avayacloud.com/api/workflow/v1/workflows/sessions'\n\ \nheaders = {\n 'Authorization': f'Bearer {bearer_token}',\n 'Content-Type': 'application/json'\n}\n\npayload\ \ = {\n 'workflowId': 'wf_customer_inquiry',\n 'workflowVersionId': 'v2.1',\n 'variables': {\n 'customer_name':\ \ 'John Smith',\n 'order_id': 'ORD-2024-1984',\n 'issue_type': 'billing'\n }\n}\n\nresponse = requests.post(url,\ \ json=payload, headers=headers)\n\nif response.status_code == 200:\n data = response.json()\n print(f\"Session\ \ ID: {data['sessionId']}\")\n print(f\"Status: {data['status']}\")\nelse:\n print(f\"Error: {response.status_code}\ \ - {response.text}\")\n" - lang: Shell label: cURL source: "curl -X POST \\\n https://core.avaya1234.ec.avayacloud.com/api/workflow/v1/workflows/sessions \\\n -H 'Authorization:\ \ Bearer your-access-token-here' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"workflowId\": \"wf_customer_inquiry\"\ ,\n \"workflowVersionId\": \"v2.1\",\n \"variables\": {\n \"customer_name\": \"John Smith\",\n \"\ order_id\": \"ORD-2024-1984\",\n \"issue_type\": \"billing\"\n }\n }'\n" components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT description: 'Bearer token authentication. Generate your access token using the [Access Token API](https://developers.avayacloud.com/avaya-infinity/reference/generateaccesstoken). **Important:** Never expose your Bearer token in client-side code. Always make API calls from your backend server. ' schemas: Error: type: object properties: error: type: string description: Error code identifying the type of error message: type: string description: Human-readable error message field: type: string description: The field that caused the error (if applicable) workflowId: type: string description: The workflow ID that was requested (if applicable) retryAfter: type: integer description: Seconds to wait before retrying (for rate limit errors) requestId: type: string description: Unique identifier for this request (for support purposes) tags: - name: Workflow Sessions description: "Execute and manage workflow sessions for automation and business process integration.\n\n## Rate Limits &\ \ Quotas\n\n- **Rate Limit:** 100 requests per minute per customer subdomain\n- **Burst Limit:** 20 requests per second\n\ - **Concurrent Sessions:** 1,000 active workflow sessions per subdomain\n\nWhen rate limited, the API returns HTTP 429\ \ with a `Retry-After` header.\n\n## Best Practices\n\n### 1. Store Session IDs\nAlways save the returned `sessionId`\ \ to check execution status later.\n\n### 2. Handle Asynchronous Execution\nWorkflows execute asynchronously. Poll for\ \ completion using the [Get Workflow Session Status](https://developers.avayacloud.com/avaya-infinity/reference/getworkflowsessionstatus-2)\ \ endpoint.\n\n### 3. Validate Input Before Sending\nValidate your variables before making the API call to avoid errors.\n\ \n### 4. Use Meaningful Variable Names\nChoose clear, consistent variable names that match your workflow design.\n\n✅\ \ Good: `customer_email`, `order_total`, `shipping_method` \n❌ Avoid: `var1`, `data`, `temp`\n\n### 5. Implement Retry\ \ Logic\nHandle transient failures with exponential backoff for 429 and 5xx errors.\n\n## Security Best Practices\n\n\ ### ⚠️ Never Expose Tokens Client-Side\n\nAlways call the Avaya API from your backend server, never directly from browser\ \ JavaScript or mobile apps.\n\n### Filter Sensitive Data\n\nDon't pass sensitive information unless your workflow specifically\ \ needs it.\n\n### Use HTTPS Only\n\nAlways use `https://` endpoints. Never use unencrypted `http://` connections.\n\n\ ## Related Resources\n\n- [Query Workflow Session Status](https://developers.avayacloud.com/avaya-infinity/reference/getworkflowsessionstatus-2)\n\ - [Generate Access Token](https://developers.avayacloud.com/avaya-infinity/reference/generateaccesstoken)\n"