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

# Create Job API

> Learn how to create jobs using the Agentix Core API

## Overview

The Create Job API allows you to programmatically create new customer journey jobs in Agentix. This endpoint is the primary way to initiate automated workflows through the Agentix platform.

## How It Works

When you create a job through the API:

1. **Workflow Assignment**: Specify which workflow ID to execute
2. **Customer Data**: Provide customer information (name, mobile, email, etc.)
3. **Job Configuration**: Set expiration time, language, and metadata
4. **Input Parameters**: Pass dynamic data to customize the workflow execution

## Key Concepts

### Workflow ID

Every job must be associated with a pre-configured workflow in your Agentix dashboard. The workflow defines the customer journey steps and automation logic.

### Expiration Time

Jobs have a validity period (`validUntil`) specified in seconds. After this time, the job becomes inaccessible to customers.

### Customer Information

Provide customer details to personalize the experience and enable agent handoffs when needed.

### Dynamic Inputs

Use the `input` array to pass variable data that workflows can utilize for personalization and decision-making.

## Authentication

All API requests require authentication using your API key in the `x-api-key` header.

<Info>
  **Getting your API Key:** Contact your organization administrator to generate an Integration API key. Only administrators can create API keys.
</Info>

## Interactive Testing

<Card title="Try the API Now" icon="play" href="/api-reference/create-job">
  Test the Create Job endpoint with your own data and server URL in our interactive API playground.
</Card>

## Request Structure

```json theme={null}
{
  "data": {
    "workflow": 123,
    "validUntil": 86400,
    "language": "en",
    "customer": {
      "name": "John Doe",
      "mobile": "+1234567890",
      "email": "john@example.com",
      "customerID": "CUST-001"
    },
    "externalRefNumber": "REF-12345",
    "metadata": "Additional context data",
    "input": [
      {
        "key": "productType",
        "value": "premium",
        "type": "string",
        "description": "Product tier for customization"
      }
    ]
  }
}
```

## Response Structure

```json theme={null}
{
  "success": true,
  "data": {
    "jobId": "job_abc123def456",
    "status": "active",
    "workflow": {
      "id": 123,
      "name": "Customer Onboarding"
    },
    "customer": {
      "name": "John Doe",
      "mobile": "+1234567890",
      "email": "john@example.com",
      "customerID": "CUST-001"
    },
    "externalRefNumber": "REF-12345",
    "createdAt": "2024-01-15T10:30:00Z",
    "validUntil": "2024-01-16T10:30:00Z",
    "accessUrl": "https://launch.agentixhub.ai/j/abc123def456"
  }
}
```

## Error Responses

| Status Code | Description                                                     |
| ----------- | --------------------------------------------------------------- |
| 400         | Bad request - Invalid request format or missing required fields |
| 401         | Unauthorized - Invalid or missing API key                       |
| 404         | Workflow not found - The specified workflow ID doesn't exist    |
| 429         | Rate limit exceeded - Too many requests                         |

## Next Steps

1. **Get Your API Key**: Contact your administrator to obtain API credentials
2. **Test the Endpoint**: Use the interactive playground in the API Reference section
3. **Integrate**: Add the API calls to your application workflow
4. **Monitor**: Track job creation and customer engagement through the Agentix dashboard

<Tip>
  For real-time testing with your own server configuration, visit the **[API Reference → Create Job](/api-reference/create-job)** where you can enter custom server URLs and test with live data.
</Tip>
