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

# Create Activity

> Push a structured activity event to the action log for a lead

This endpoint creates an activity entry on a lead's timeline. Activities are visible in the timeline and available to the AI agent for context. Use it to log events such as sales calls, document errors, status changes, or any custom event from your system.

## Authentication

Requires the `x-api-key` header with a valid workspace API key.

## Request Body

<ParamField path="leadId" type="string" required>
  The Omni lead ID. The lead must exist and belong to your workspace.
</ParamField>

<ParamField path="eventType" type="string" required>
  Event type label (e.g. "sales\_call", "document\_error", "status\_change"). Shown
  as a badge on the timeline card.
</ParamField>

<ParamField path="title" type="string" required>
  Short summary shown as the main title on the timeline card.
</ParamField>

<ParamField path="description" type="string" required={false}>
  Longer description or notes. Rendered as body text on the card; long text is
  clipped with a "Read more" expand.
</ParamField>

<ParamField path="metadata" type="object" required={false}>
  Freeform key-value object for additional context (e.g. durationMinutes,
  outcome, nextStep). Rendered in a "Details" section on the card.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request succeeded
</ResponseField>

<ResponseField name="actionLogId" type="string">
  The ID of the created action log entry
</ResponseField>

<RequestExample>
  ```javascript Node.js theme={null}
  const options = {
    method: "POST",
    headers: {
      "x-api-key": "<your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      leadId: "a9d0a790-201b-47e9-84ed-cc7eed1270c5",
      eventType: "sales_call",
      title: "Intro call – SBA loan interest",
      description:
        "Successful intro call. Borrower runs Pacific Coast Container Haulers (drayage at Port of Long Beach). In business 4 years, ~8 employees, ~$1.2M revenue. Interested in SBA 7(a) to refinance equipment and add a truck (~$180–220K). Next step: collect last two years of tax returns.",
      metadata: {
        durationMinutes: 25,
        outcome: "positive",
        loanType: "SBA",
        nextStep: "Request last 2 years of tax returns",
        followUpDays: 2,
      },
    }),
  };

  fetch("https://api-v2.getomni.ai/api/v1/activity", options)
    .then((response) => response.json())
    .then((response) => console.log(response))
    .catch((err) => console.error(err));
  ```

  ```python Python theme={null}
  import requests

  url = "https://api-v2.getomni.ai/api/v1/activity"
  headers = {
      "x-api-key": "<your-api-key>",
      "Content-Type": "application/json",
  }
  payload = {
      "leadId": "a9d0a790-201b-47e9-84ed-cc7eed1270c5",
      "eventType": "sales_call",
      "title": "Intro call – SBA loan interest",
      "description": "Successful intro call. Borrower runs Pacific Coast Container Haulers (drayage at Port of Long Beach). In business 4 years, ~8 employees, ~$1.2M revenue. Interested in SBA 7(a) to refinance equipment and add a truck (~$180–220K). Next step: collect last two years of tax returns.",
      "metadata": {
          "durationMinutes": 25,
          "outcome": "positive",
          "loanType": "SBA",
          "nextStep": "Request last 2 years of tax returns",
          "followUpDays": 2,
      },
  }

  response = requests.request("POST", url, headers=headers, json=payload)
  print(response.json())
  ```

  ```bash cURL theme={null}
  curl --request POST \
    --url https://api-v2.getomni.ai/api/v1/activity \
    --header 'x-api-key: <your-api-key>' \
    --header 'Content-Type: application/json' \
    --data '{
      "leadId": "a9d0a790-201b-47e9-84ed-cc7eed1270c5",
      "eventType": "sales_call",
      "title": "Intro call – SBA loan interest",
      "description": "Successful intro call. Borrower runs Pacific Coast Container Haulers (drayage at Port of Long Beach). In business 4 years, ~8 employees, ~$1.2M revenue. Interested in SBA 7(a) to refinance equipment and add a truck (~$180–220K). Next step: collect last two years of tax returns.",
      "metadata": {
        "durationMinutes": 25,
        "outcome": "positive",
        "loanType": "SBA",
        "nextStep": "Request last 2 years of tax returns",
        "followUpDays": 2
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "success": true,
    "actionLogId": "7de43760-d12d-4bcc-931a-f728ef1a3e3b"
  }
  ```
</ResponseExample>
