> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.askelephant.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.askelephant.ai/_mcp/server.

# Create engagement

POST https://app.askelephant.ai/api/v2/engagements
Content-Type: application/json

Creates a new `CALL` or `MEETING` engagement by ingesting either a media recording from an external URL or a structured transcript timeline.

**Idempotency:** The `external_id` field is the idempotency key. Submitting the same `external_id` again — even with a different `source_system` — returns the existing engagement with a `200` response instead of creating a duplicate. If you need per-source-system uniqueness, prefix your `external_id` (e.g. `my-crm:12345`).

**Recording imports:** Provide `media_url` when you want AskElephant to fetch and transcribe a recording. The URL must be a publicly accessible HTTPS URL serving an `audio/*` or `video/*` content type. HTTP URLs, private/internal IP addresses, and non-media content types are rejected with a `422` error. The server fetches the media synchronously during request processing, so the URL must remain accessible for the duration of the request.

**Transcript-only imports:** If you do not have recording media, omit `media_url` and provide `transcript_timeline`. The timeline must include declared speakers plus timed transcript entries whose `speaker_index` values reference those speakers.

**Workflow control:** Set `run_workflows` to `true` for normal automation (workflow triggers, recap emails) or `false` to suppress workflows (e.g. for historical imports). Transcription, summarization, and tagging always run regardless.

**Owner participant:** Optionally mark exactly one participant with `is_owner: true` to assign engagement ownership to that user instead of the API-key-associated user. The marked participant must resolve to an active AskElephant user in the authenticated workspace. Resolution matches `email` first, then `phone`; users with `INACTIVE` or `NOT_INVITED` roles are not valid targets. When exactly one `is_owner: true` participant resolves successfully, the created engagement's `owner_user_id` and downstream processing use that user as owner and host. When no participant has `is_owner: true`, ownership defaults to the user associated with the API key or OAuth credential. Requests with more than one `is_owner: true` participant, or with a single owner participant that cannot resolve to an active workspace user, return HTTP `400` and do not ingest media, persist an engagement, or publish processing events. API keys or OAuth credentials without an associated user may create an engagement only when a valid explicit owner participant is provided.

**Timestamps:** If `start_at` is omitted, the current server time is used. When `transcript_timeline` is provided, `end_at` is derived from the largest `transcript_timeline.entries[].end_seconds` value, even if `media_url` is also supplied. For media-only imports (no timeline), `end_at` is derived automatically from the media duration during processing.

This operation requires the `engagements:write` scope.

Reference: https://docs.askelephant.ai/api-reference/engagements/create-engagement

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://app.askelephant.ai/api` (Production, default)
- `https://app-staging.askelephant.ai/api` (Staging)

## Request

### Body (application/json)

This endpoint expects an engagement_create_request.

- `type` (enum, required) — The engagement type. Only `CALL` and `MEETING` are supported for creation via the public API.
  - Allowed values: `CALL`, `MEETING`
- `title` (string, required) — Display title for the engagement.
- `source_system` (string, required) — Identifier for the external system that produced this recording (e.g. `salesforce`, `custom-dialer`). Stored as metadata for traceability but **not** part of the idempotency key — see `external_id`.
- `external_id` (string, required) — Unique identifier for this engagement in the external system. Used as the idempotency key **scoped to the workspace** (not per `source_system`). Submitting the same `external_id` again — even with a different `source_system` — returns the existing engagement instead of creating a duplicate. If you need per-source uniqueness, prefix the ID yourself (e.g. `my-crm:12345`).
- `run_workflows` (boolean, required) — Controls whether downstream automations (workflow triggers, post-meeting recap emails) fire for this engagement. Set to `true` to enable normal automation; set to `false` to suppress workflows (useful for historical imports). Transcription, summarization, and tagging always run regardless of this flag.
- `media_url` (string, optional) — Publicly accessible HTTPS URL pointing to the audio or video recording. Required unless `transcript_timeline` is provided for a structured transcript-only import. The server fetches this URL during request processing, so it must be reachable at call time. Requirements: must use the `https` scheme (no `http`), must not resolve to private or internal IP ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x, 127.x.x.x, 169.254.x.x, or IPv6 link-local/loopback), and must serve an `audio/*` or `video/*` content type.
- `start_at` (datetime, optional) — ISO 8601 timestamp for when the engagement started. Defaults to the current server time if omitted.
- `is_private` (boolean, optional) — Controls whether the engagement is marked as private. When `true`, only participants and users with `engagements:private:read` scope can view the engagement. Defaults to the workspace's configured privacy behavior if omitted.
- `participants` (list of engagement_create_participant, optional) — Optional list of participants in the engagement. Each participant may have a name, email, or both.
- `transcript_timeline` (engagement_create_transcript_timeline, optional) — Structured transcript timeline for transcript-only engagement imports. Use this when you already have diarized transcript turns and no recording media. Each entry references a declared speaker by `speaker_index`; entry and sentence time ranges must be non-negative, no longer than 7 days, and sentence windows must stay within their parent entry window.
- `external_url` (string, optional) — Optional URL linking back to this engagement in the originating system (e.g. a dialer's call detail page). Accepts `https://`, `http://`, and custom app deep-link schemes such as `wavv://call/123`. Dangerous schemes (`javascript:`, `data:`, `vbscript:`, `blob:`, `file:`) are rejected. The value is stored as-is and returned in API responses and webhook payloads.
- `transcript_text` (string, optional, deprecated) — Deprecated. Use structured `transcript_timeline` for transcript imports. If provided, stored alongside the media recording; the media will still be processed through the transcription pipeline. Limited to 900,000 characters and 950,000 bytes (UTF-8). Multi-byte content (e.g. CJK, emoji) may hit the byte limit before the character limit.

## Response

### 200

An engagement with the same `external_id` already exists in this workspace. The existing engagement is returned unchanged.

- `object` (enum, required)
  - Allowed values: `engagement`
- `id` (string, required)
- `title` (string, required)
- `engagement_type` (enum, required)
  - Allowed values: `MEETING`, `CALL`, `EMAIL`, `TASK`, `NOTE`, `CALENDAR_EVENT`, `DOCUMENT`
- `processing_status` (enum, required)
  - Allowed values: `PENDING`, `PROCESSING`, `COMPLETED`, `FAILED`
- `is_private` (boolean, required) — Indicates whether the engagement is marked private in AskElephant.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `transcript_timeline` (transcript_timeline, required) — Structured transcript timeline returned by `POST /v2/engagements`. When no structured timeline exists yet, this is returned as an empty transcript timeline with no speakers or entries. For read-after-create retrieval, use `GET /v2/engagements/{engagement_id}/transcript_timeline`.
- `description` (string, optional)
- `data_source` (string, optional)
- `is_internal` (boolean, optional)
- `engagement_at` (datetime, optional)
- `start_at` (datetime, optional)
- `end_at` (datetime, optional)
- `duration_seconds` (integer, optional)
- `meeting_url` (string, optional)
- `external_url` (string, optional) — URL linking back to this engagement in the originating external system (e.g. a dialer's call detail page). Accepts `https://`, `http://`, and custom app deep-link schemes such as `wavv://call/123`. Present only when the engagement was created with an `external_url` value.
- `crm_association` (crm_association, optional) — CRM record linked to this engagement. Present when the engagement has been matched to a CRM record via integration or API.
- `owner_user_id` (string, optional)
- `host_user_id` (string, optional)
- `transcript` (string, optional, nullable) — Aggregated engagement text as a single string. Depending on the engagement, this can include Markdown or HTML content plus extracted text from completed attachments; it is not guaranteed to contain only spoken transcript. For speaker-aware or time-aligned ingest, use `GET /v2/engagements/{engagement_id}/transcript_timeline`. Only included when `expand` contains `transcript`. Does not include speaker timing or structured entries; use `expand=transcript_timeline` for the structured timeline object.
- `media_url` (string, optional, nullable) — Temporary signed URL for downloading the engagement recording media. Only included when `expand` contains `media_url`. The URL expires after a short period.
- `companies` (list of engagement_company, optional) — Companies associated with this engagement. Only included when `expand` contains `companies`.
- `contacts` (list of contact, optional) — Contact participants associated with this engagement. Only included when `expand` contains `contacts`.
- `owner` (user, optional, nullable) — Workspace user who owns this engagement. Only included when `expand` contains `owner`.
- `action_items` (list of engagement_action_item, optional) — Action items created from this engagement. Only included when `expand` contains `action_items`.
- `signals` (list of engagement_signal, optional) — Signals (annotations) extracted from this engagement. Only included when `expand` contains `signals`.
- `tags` (list of tag, optional) — Tags applied to this engagement. Only included when `expand` contains `tags`.

### 201

Engagement created successfully.

- `object` (enum, required)
  - Allowed values: `engagement`
- `id` (string, required)
- `title` (string, required)
- `engagement_type` (enum, required)
  - Allowed values: `MEETING`, `CALL`, `EMAIL`, `TASK`, `NOTE`, `CALENDAR_EVENT`, `DOCUMENT`
- `processing_status` (enum, required)
  - Allowed values: `PENDING`, `PROCESSING`, `COMPLETED`, `FAILED`
- `is_private` (boolean, required) — Indicates whether the engagement is marked private in AskElephant.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `transcript_timeline` (transcript_timeline, required) — Structured transcript timeline returned by `POST /v2/engagements`. When no structured timeline exists yet, this is returned as an empty transcript timeline with no speakers or entries. For read-after-create retrieval, use `GET /v2/engagements/{engagement_id}/transcript_timeline`.
- `description` (string, optional)
- `data_source` (string, optional)
- `is_internal` (boolean, optional)
- `engagement_at` (datetime, optional)
- `start_at` (datetime, optional)
- `end_at` (datetime, optional)
- `duration_seconds` (integer, optional)
- `meeting_url` (string, optional)
- `external_url` (string, optional) — URL linking back to this engagement in the originating external system (e.g. a dialer's call detail page). Accepts `https://`, `http://`, and custom app deep-link schemes such as `wavv://call/123`. Present only when the engagement was created with an `external_url` value.
- `crm_association` (crm_association, optional) — CRM record linked to this engagement. Present when the engagement has been matched to a CRM record via integration or API.
- `owner_user_id` (string, optional)
- `host_user_id` (string, optional)
- `transcript` (string, optional, nullable) — Aggregated engagement text as a single string. Depending on the engagement, this can include Markdown or HTML content plus extracted text from completed attachments; it is not guaranteed to contain only spoken transcript. For speaker-aware or time-aligned ingest, use `GET /v2/engagements/{engagement_id}/transcript_timeline`. Only included when `expand` contains `transcript`. Does not include speaker timing or structured entries; use `expand=transcript_timeline` for the structured timeline object.
- `media_url` (string, optional, nullable) — Temporary signed URL for downloading the engagement recording media. Only included when `expand` contains `media_url`. The URL expires after a short period.
- `companies` (list of engagement_company, optional) — Companies associated with this engagement. Only included when `expand` contains `companies`.
- `contacts` (list of contact, optional) — Contact participants associated with this engagement. Only included when `expand` contains `contacts`.
- `owner` (user, optional, nullable) — Workspace user who owns this engagement. Only included when `expand` contains `owner`.
- `action_items` (list of engagement_action_item, optional) — Action items created from this engagement. Only included when `expand` contains `action_items`.
- `signals` (list of engagement_signal, optional) — Signals (annotations) extracted from this engagement. Only included when `expand` contains `signals`.
- `tags` (list of tag, optional) — Tags applied to this engagement. Only included when `expand` contains `tags`.

### 204

An engagement with the same `external_id` already exists. The caller has `engagements:write` but not `engagements:read` scope, so the engagement body is not returned.

## Errors

### 400 Bad Request Error

Request validation failed, or owner participant claims are ambiguous or invalid. Owner failures include more than one participant with `is_owner: true`, or a single owner participant that does not resolve to an active workspace user.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 401 Unauthorized Error

Authentication is missing or invalid.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 403 Forbidden Error

Authenticated but missing required scope.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 404 Not Found Error

The `external_id` matches an existing engagement that the caller does not have permission to access (e.g., a private engagement owned by another user). Use a different `external_id` or request appropriate scopes.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 409 Conflict Error

An engagement with the same `external_id` already exists but cannot be returned (e.g., the original engagement was deleted). Use a different `external_id`.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 422 Unprocessable Entity Error

Request body validation failed, or the media URL could not be processed. Common causes include: unsupported engagement type, missing required fields, omitting both `media_url` and `transcript_timeline`, media URL is not accessible, media URL does not serve audio or video content, media URL resolves to a private/internal IP address, or media download timed out.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 429 Too Many Requests Error

Workspace rate limit exceeded (1000 authenticated requests per 60-second window on `/api/v2` resource routes). Retry after the interval in `Retry-After`. Successful responses also include `X-RateLimit-*` headers for proactive monitoring.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 500 Internal Server Error

Unexpected server error.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 503 Service Unavailable Error

Rate limit enforcement is temporarily unavailable.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

## Types

### engagement_create_participant

- `name` (string, optional) — Display name of the participant.
- `first_name` (string, optional) — First name of the participant.
- `last_name` (string, optional) — Last name of the participant.
- `email` (string, optional) — Email address of the participant.
- `phone` (string, optional) — Phone number of the participant in E.164 format (e.g. `+14155552671`).
- `is_owner` (boolean, optional) — Optional. When `true`, marks this participant as the engagement owner. At most one participant in the request may have `is_owner` set to `true`. When exactly one participant is marked as owner, that participant must resolve to an active AskElephant user in the authenticated workspace (matched by `email` first, then `phone`). Users with `INACTIVE` or `NOT_INVITED` roles are not valid owner targets. Ambiguous owner claims (more than one `is_owner: true`) or invalid owner claims (unresolvable or ineligible participant) return HTTP `400` before media ingestion, persistence, or processing events. When no participant has `is_owner: true`, the engagement owner defaults to the user associated with the API key or OAuth credential.

### engagement_create_transcript_timeline

Structured transcript timeline for transcript-only engagement imports. Use this when you already have diarized transcript turns and no recording media. Each entry references a declared speaker by `speaker_index`; entry and sentence time ranges must be non-negative, no longer than 7 days, and sentence windows must stay within their parent entry window.

- `speakers` (list of engagement_create_transcript_timeline_speaker, required) — Speakers referenced by transcript entries.
- `entries` (list of engagement_create_transcript_timeline_entry, required) — Ordered transcript paragraphs or turns.

### transcript_timeline

- `object` (enum, required)
  - Allowed values: `transcript_timeline`
- `engagement_id` (string, required)
- `speakers` (list of transcript_timeline_speaker, required) — Speaker details indexed by their position in the entries.
- `entries` (list of TranscriptTimelineEntriesItems, required)
- `overall_sentiment` (double, optional, nullable) — Average sentiment score across all speakers. Null when no sentiment data is available.

### crm_association

- `object_type` (string, required) — CRM object type.
- `crm_object_id` (string, required) — The record ID in the source CRM system.
- `source` (string, required) — CRM source system.

### engagement_company

- `object` (enum, required)
  - Allowed values: `engagement_company`
- `id` (string, required)
- `name` (string, required)
- `domains` (list of string, required)
- `crm_association` (crm_association, optional) — CRM record linked to this company. Present when the company has been matched to a CRM record via integration or API.

### contact

Public representation of a workspace contact.

- `object` (enum, required) — Resource discriminator for contact payloads.
  - Allowed values: `contact`
- `id` (string, required) — Stable AskElephant contact identifier.
- `created_at` (datetime, required) — Timestamp when the contact was first created in AskElephant.
- `updated_at` (datetime, required) — Timestamp when the contact was most recently updated in AskElephant.
- `first_name` (string, optional, nullable) — Contact given name.
- `last_name` (string, optional, nullable) — Contact family name.
- `description` (string, optional) — Free-form contact summary or notes visible through the public API.
- `company` (resource_ref, optional) — Lightweight reference to the contact's associated company when one exists.
- `emails` (list of ContactEmailsItems, optional) — Email addresses associated with the contact.
- `phone_numbers` (list of ContactPhoneNumbersItems, optional) — Phone numbers associated with the contact.
- `crm_association` (crm_association, optional) — CRM record linked to this contact. Present when the contact has been matched to a CRM record via integration or API.
- `time_zone` (string, optional) — IANA time zone identifier for the contact.

### user

- `object` (enum, required)
  - Allowed values: `user`
- `id` (string, required)
- `role` (enum, required)
  - Allowed values: `OWNER`, `MANAGER`, `USER`, `INACTIVE`, `NOT_INVITED`
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `first_name` (string, optional, nullable)
- `last_name` (string, optional, nullable)
- `job_title` (string, optional)
- `emails` (list of UserEmailsItems, optional)
- `time_zone` (string, optional)
- `last_activity_at` (datetime, optional)

### engagement_action_item

- `object` (enum, required)
  - Allowed values: `engagement_action_item`
- `id` (string, required)
- `title` (string, required)
- `description` (string, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `due_on` (string, optional, nullable)
- `assigned_to_user_id` (string, optional, nullable)
- `assigned_to_user_name` (string, optional, nullable)
- `assigned_to_user_email` (string, optional, nullable)

### engagement_signal

- `object` (enum, required)
  - Allowed values: `engagement_signal`
- `id` (string, required)
- `annotation_definition_id` (string, required)
- `name` (string, required)
- `data_type` (string, required)
- `value` (any, required)
- `description` (string, optional, nullable)

### tag

- `object` (enum, required)
  - Allowed values: `tag`
- `id` (string, required)
- `name` (string, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `hex_color` (string, optional, nullable)
- `description` (string, optional, nullable)
- `auto_tagging_enabled` (boolean, optional)

### error_item

Structured validation or field-level error detail.

- `code` (string, required) — Stable machine-readable error code.
- `message` (string, required) — Human-readable explanation of the error.
- `field` (string, optional) — Request field or parameter associated with the error.

### engagement_create_transcript_timeline_speaker

- `index` (integer, required) — Speaker index used by `entries[].speaker_index`.
- `name` (string, required) — Display name for this speaker.
- `first_name` (string, optional) — Optional first name for participant matching.
- `last_name` (string, optional) — Optional last name for participant matching.
- `email` (string, optional) — Optional email for participant matching.
- `phone` (string, optional) — Optional E.164 phone number for participant matching.

### engagement_create_transcript_timeline_entry

- `speaker_index` (integer, required) — Must reference a speaker declared in `transcript_timeline.speakers`.
- `start_seconds` (double, required) — Entry start offset from engagement start, in seconds.
- `end_seconds` (double, required) — Entry end offset from engagement start, in seconds.
- `sentences` (list of engagement_create_transcript_timeline_sentence, required) — Sentence-level transcript text and timing within this entry.

### transcript_timeline_speaker

- `id` (string, required) — Stable speaker identifier. Matches `entries[].speaker.id` for the same speaker index. User speakers use a `usr_` prefix, contact speakers use `cnt_`, and unmatched speakers use `speaker_{index}` (for example `speaker_0`).
- `type` (enum, required) — Speaker identity kind. Matches `entries[].speaker.type` for the same speaker index. Use `user` or `contact` to join by public id; `unknown` means the speaker is not linked to a workspace user or contact.
  - Allowed values: `contact`, `user`, `unknown`
- `first_name` (string, required, nullable)
- `last_name` (string, required, nullable)
- `email` (string, required, nullable)
- `phone` (string, required, nullable)
- `speaking_percentage` (double, required, nullable)
- `sentiment` (double, required, nullable)

### TranscriptTimelineEntriesItems

- `speaker` (TranscriptTimelineEntriesItemsSpeaker, required)
- `text` (string, required)
- `start_seconds` (double, required)
- `end_seconds` (double, required)
- `num_words` (integer, required)
- `sentences` (list of TranscriptTimelineEntriesItemsSentencesItems, required)

### resource_ref

- `id` (string, required)
- `object` (string, required)

### ContactEmailsItems

- `email` (string, required) — Contact email address.
- `is_primary` (boolean, required) — Indicates whether this is the primary email address.

### ContactPhoneNumbersItems

- `phone_number` (string, required) — Contact phone number in the source-system format.
- `is_primary` (boolean, required) — Indicates whether this is the primary phone number.

### UserEmailsItems

- `email` (string, required)
- `is_primary` (boolean, required)

### engagement_create_transcript_timeline_sentence

- `text` (string, required)
- `start_seconds` (double, required)
- `end_seconds` (double, required)

### TranscriptTimelineEntriesItemsSpeaker

- `type` (enum, required)
  - Allowed values: `contact`, `user`, `unknown`
- `id` (string, required)
- `name` (string, required)

### TranscriptTimelineEntriesItemsSentencesItems

- `text` (string, required)
- `start_seconds` (double, required)
- `end_seconds` (double, required)

## Examples

### Structured transcript-only import

**Request**

```json
{
  "type": "MEETING",
  "title": "Customer kickoff",
  "source_system": "crm-transcripts",
  "external_id": "transcript_98765",
  "run_workflows": false,
  "start_at": "2026-06-12T17:00:00Z",
  "transcript_timeline": {
    "speakers": [
      {
        "index": 0,
        "name": "Alice Example",
        "first_name": "Alice",
        "last_name": "Example",
        "email": "alice@example.com"
      },
      {
        "index": 1,
        "name": "Bob Example",
        "email": "bob@example.com"
      }
    ],
    "entries": [
      {
        "speaker_index": 0,
        "start_seconds": 0,
        "end_seconds": 2.5,
        "sentences": [
          {
            "text": "Welcome to the kickoff.",
            "start_seconds": 0,
            "end_seconds": 2.5
          }
        ]
      },
      {
        "speaker_index": 1,
        "start_seconds": 2.5,
        "end_seconds": 5,
        "sentences": [
          {
            "text": "Thanks, happy to be here.",
            "start_seconds": 2.5,
            "end_seconds": 5
          }
        ]
      }
    ]
  }
}
```

**Response**

```json
{
  "object": "engagement",
  "id": "string",
  "title": "string",
  "engagement_type": "MEETING",
  "processing_status": "PENDING",
  "is_private": true,
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "transcript_timeline": {
    "object": "transcript_timeline",
    "engagement_id": "string",
    "speakers": [
      {
        "id": "string",
        "type": "contact",
        "first_name": "string",
        "last_name": "string",
        "email": "string",
        "phone": "string",
        "speaking_percentage": 1.1,
        "sentiment": 1.1
      }
    ],
    "entries": [
      {
        "speaker": {
          "type": "contact",
          "id": "string",
          "name": "string"
        },
        "text": "string",
        "start_seconds": 1.1,
        "end_seconds": 1.1,
        "num_words": 1,
        "sentences": [
          {
            "text": "string",
            "start_seconds": 1.1,
            "end_seconds": 1.1
          }
        ]
      }
    ],
    "overall_sentiment": 1.1
  },
  "description": "string",
  "data_source": "string",
  "is_internal": true,
  "engagement_at": "2024-01-15T09:30:00Z",
  "start_at": "2024-01-15T09:30:00Z",
  "end_at": "2024-01-15T09:30:00Z",
  "duration_seconds": 1,
  "meeting_url": "string",
  "external_url": "string",
  "crm_association": {
    "object_type": "string",
    "crm_object_id": "string",
    "source": "string"
  },
  "owner_user_id": "string",
  "host_user_id": "string",
  "transcript": "string",
  "media_url": "string",
  "companies": [
    {
      "object": "engagement_company",
      "id": "string",
      "name": "string",
      "domains": [
        "string"
      ],
      "crm_association": {
        "object_type": "string",
        "crm_object_id": "string",
        "source": "string"
      }
    }
  ],
  "contacts": [
    {
      "object": "contact",
      "id": "cnt_01HQY3JMS2QAXJGX6X7CH7CM6X",
      "created_at": "2026-03-01T12:00:00Z",
      "updated_at": "2026-03-04T18:25:00Z",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "description": "Primary customer contact for analytical projects.",
      "company": {
        "id": "string",
        "object": "string"
      },
      "emails": [
        {
          "email": "ada@analytical.engine",
          "is_primary": true
        }
      ],
      "phone_numbers": [
        {
          "phone_number": "+1-555-0100",
          "is_primary": true
        }
      ],
      "crm_association": {
        "object_type": "string",
        "crm_object_id": "string",
        "source": "string"
      },
      "time_zone": "America/Los_Angeles"
    }
  ],
  "owner": {
    "object": "user",
    "id": "string",
    "role": "OWNER",
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z",
    "first_name": "string",
    "last_name": "string",
    "job_title": "string",
    "emails": [
      {
        "email": "string",
        "is_primary": true
      }
    ],
    "time_zone": "string",
    "last_activity_at": "2024-01-15T09:30:00Z"
  },
  "action_items": [
    {
      "object": "engagement_action_item",
      "id": "string",
      "title": "string",
      "description": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "due_on": "string",
      "assigned_to_user_id": "string",
      "assigned_to_user_name": "string",
      "assigned_to_user_email": "string"
    }
  ],
  "signals": [
    {
      "object": "engagement_signal",
      "id": "string",
      "annotation_definition_id": "string",
      "name": "string",
      "data_type": "string",
      "description": "string"
    }
  ],
  "tags": [
    {
      "object": "tag",
      "id": "string",
      "name": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "hex_color": "string",
      "description": "string",
      "auto_tagging_enabled": true
    }
  ]
}
```

**SDK Code**

```python Structured transcript-only import
import requests

url = "https://app.askelephant.ai/api/v2/engagements"

payload = {
    "type": "MEETING",
    "title": "Customer kickoff",
    "source_system": "crm-transcripts",
    "external_id": "transcript_98765",
    "run_workflows": False,
    "start_at": "2026-06-12T17:00:00Z",
    "transcript_timeline": {
        "speakers": [
            {
                "index": 0,
                "name": "Alice Example",
                "first_name": "Alice",
                "last_name": "Example",
                "email": "alice@example.com"
            },
            {
                "index": 1,
                "name": "Bob Example",
                "email": "bob@example.com"
            }
        ],
        "entries": [
            {
                "speaker_index": 0,
                "start_seconds": 0,
                "end_seconds": 2.5,
                "sentences": [
                    {
                        "text": "Welcome to the kickoff.",
                        "start_seconds": 0,
                        "end_seconds": 2.5
                    }
                ]
            },
            {
                "speaker_index": 1,
                "start_seconds": 2.5,
                "end_seconds": 5,
                "sentences": [
                    {
                        "text": "Thanks, happy to be here.",
                        "start_seconds": 2.5,
                        "end_seconds": 5
                    }
                ]
            }
        ]
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Structured transcript-only import
const url = 'https://app.askelephant.ai/api/v2/engagements';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"MEETING","title":"Customer kickoff","source_system":"crm-transcripts","external_id":"transcript_98765","run_workflows":false,"start_at":"2026-06-12T17:00:00Z","transcript_timeline":{"speakers":[{"index":0,"name":"Alice Example","first_name":"Alice","last_name":"Example","email":"alice@example.com"},{"index":1,"name":"Bob Example","email":"bob@example.com"}],"entries":[{"speaker_index":0,"start_seconds":0,"end_seconds":2.5,"sentences":[{"text":"Welcome to the kickoff.","start_seconds":0,"end_seconds":2.5}]},{"speaker_index":1,"start_seconds":2.5,"end_seconds":5,"sentences":[{"text":"Thanks, happy to be here.","start_seconds":2.5,"end_seconds":5}]}]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Structured transcript-only import
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.askelephant.ai/api/v2/engagements"

	payload := strings.NewReader("{\n  \"type\": \"MEETING\",\n  \"title\": \"Customer kickoff\",\n  \"source_system\": \"crm-transcripts\",\n  \"external_id\": \"transcript_98765\",\n  \"run_workflows\": false,\n  \"start_at\": \"2026-06-12T17:00:00Z\",\n  \"transcript_timeline\": {\n    \"speakers\": [\n      {\n        \"index\": 0,\n        \"name\": \"Alice Example\",\n        \"first_name\": \"Alice\",\n        \"last_name\": \"Example\",\n        \"email\": \"alice@example.com\"\n      },\n      {\n        \"index\": 1,\n        \"name\": \"Bob Example\",\n        \"email\": \"bob@example.com\"\n      }\n    ],\n    \"entries\": [\n      {\n        \"speaker_index\": 0,\n        \"start_seconds\": 0,\n        \"end_seconds\": 2.5,\n        \"sentences\": [\n          {\n            \"text\": \"Welcome to the kickoff.\",\n            \"start_seconds\": 0,\n            \"end_seconds\": 2.5\n          }\n        ]\n      },\n      {\n        \"speaker_index\": 1,\n        \"start_seconds\": 2.5,\n        \"end_seconds\": 5,\n        \"sentences\": [\n          {\n            \"text\": \"Thanks, happy to be here.\",\n            \"start_seconds\": 2.5,\n            \"end_seconds\": 5\n          }\n        ]\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Structured transcript-only import
require 'uri'
require 'net/http'

url = URI("https://app.askelephant.ai/api/v2/engagements")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"MEETING\",\n  \"title\": \"Customer kickoff\",\n  \"source_system\": \"crm-transcripts\",\n  \"external_id\": \"transcript_98765\",\n  \"run_workflows\": false,\n  \"start_at\": \"2026-06-12T17:00:00Z\",\n  \"transcript_timeline\": {\n    \"speakers\": [\n      {\n        \"index\": 0,\n        \"name\": \"Alice Example\",\n        \"first_name\": \"Alice\",\n        \"last_name\": \"Example\",\n        \"email\": \"alice@example.com\"\n      },\n      {\n        \"index\": 1,\n        \"name\": \"Bob Example\",\n        \"email\": \"bob@example.com\"\n      }\n    ],\n    \"entries\": [\n      {\n        \"speaker_index\": 0,\n        \"start_seconds\": 0,\n        \"end_seconds\": 2.5,\n        \"sentences\": [\n          {\n            \"text\": \"Welcome to the kickoff.\",\n            \"start_seconds\": 0,\n            \"end_seconds\": 2.5\n          }\n        ]\n      },\n      {\n        \"speaker_index\": 1,\n        \"start_seconds\": 2.5,\n        \"end_seconds\": 5,\n        \"sentences\": [\n          {\n            \"text\": \"Thanks, happy to be here.\",\n            \"start_seconds\": 2.5,\n            \"end_seconds\": 5\n          }\n        ]\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Structured transcript-only import
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.askelephant.ai/api/v2/engagements")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"MEETING\",\n  \"title\": \"Customer kickoff\",\n  \"source_system\": \"crm-transcripts\",\n  \"external_id\": \"transcript_98765\",\n  \"run_workflows\": false,\n  \"start_at\": \"2026-06-12T17:00:00Z\",\n  \"transcript_timeline\": {\n    \"speakers\": [\n      {\n        \"index\": 0,\n        \"name\": \"Alice Example\",\n        \"first_name\": \"Alice\",\n        \"last_name\": \"Example\",\n        \"email\": \"alice@example.com\"\n      },\n      {\n        \"index\": 1,\n        \"name\": \"Bob Example\",\n        \"email\": \"bob@example.com\"\n      }\n    ],\n    \"entries\": [\n      {\n        \"speaker_index\": 0,\n        \"start_seconds\": 0,\n        \"end_seconds\": 2.5,\n        \"sentences\": [\n          {\n            \"text\": \"Welcome to the kickoff.\",\n            \"start_seconds\": 0,\n            \"end_seconds\": 2.5\n          }\n        ]\n      },\n      {\n        \"speaker_index\": 1,\n        \"start_seconds\": 2.5,\n        \"end_seconds\": 5,\n        \"sentences\": [\n          {\n            \"text\": \"Thanks, happy to be here.\",\n            \"start_seconds\": 2.5,\n            \"end_seconds\": 5\n          }\n        ]\n      }\n    ]\n  }\n}")
  .asString();
```

```php Structured transcript-only import
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.askelephant.ai/api/v2/engagements', [
  'body' => '{
  "type": "MEETING",
  "title": "Customer kickoff",
  "source_system": "crm-transcripts",
  "external_id": "transcript_98765",
  "run_workflows": false,
  "start_at": "2026-06-12T17:00:00Z",
  "transcript_timeline": {
    "speakers": [
      {
        "index": 0,
        "name": "Alice Example",
        "first_name": "Alice",
        "last_name": "Example",
        "email": "alice@example.com"
      },
      {
        "index": 1,
        "name": "Bob Example",
        "email": "bob@example.com"
      }
    ],
    "entries": [
      {
        "speaker_index": 0,
        "start_seconds": 0,
        "end_seconds": 2.5,
        "sentences": [
          {
            "text": "Welcome to the kickoff.",
            "start_seconds": 0,
            "end_seconds": 2.5
          }
        ]
      },
      {
        "speaker_index": 1,
        "start_seconds": 2.5,
        "end_seconds": 5,
        "sentences": [
          {
            "text": "Thanks, happy to be here.",
            "start_seconds": 2.5,
            "end_seconds": 5
          }
        ]
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Structured transcript-only import
using RestSharp;

var client = new RestClient("https://app.askelephant.ai/api/v2/engagements");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"MEETING\",\n  \"title\": \"Customer kickoff\",\n  \"source_system\": \"crm-transcripts\",\n  \"external_id\": \"transcript_98765\",\n  \"run_workflows\": false,\n  \"start_at\": \"2026-06-12T17:00:00Z\",\n  \"transcript_timeline\": {\n    \"speakers\": [\n      {\n        \"index\": 0,\n        \"name\": \"Alice Example\",\n        \"first_name\": \"Alice\",\n        \"last_name\": \"Example\",\n        \"email\": \"alice@example.com\"\n      },\n      {\n        \"index\": 1,\n        \"name\": \"Bob Example\",\n        \"email\": \"bob@example.com\"\n      }\n    ],\n    \"entries\": [\n      {\n        \"speaker_index\": 0,\n        \"start_seconds\": 0,\n        \"end_seconds\": 2.5,\n        \"sentences\": [\n          {\n            \"text\": \"Welcome to the kickoff.\",\n            \"start_seconds\": 0,\n            \"end_seconds\": 2.5\n          }\n        ]\n      },\n      {\n        \"speaker_index\": 1,\n        \"start_seconds\": 2.5,\n        \"end_seconds\": 5,\n        \"sentences\": [\n          {\n            \"text\": \"Thanks, happy to be here.\",\n            \"start_seconds\": 2.5,\n            \"end_seconds\": 5\n          }\n        ]\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Structured transcript-only import
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "MEETING",
  "title": "Customer kickoff",
  "source_system": "crm-transcripts",
  "external_id": "transcript_98765",
  "run_workflows": false,
  "start_at": "2026-06-12T17:00:00Z",
  "transcript_timeline": [
    "speakers": [
      [
        "index": 0,
        "name": "Alice Example",
        "first_name": "Alice",
        "last_name": "Example",
        "email": "alice@example.com"
      ],
      [
        "index": 1,
        "name": "Bob Example",
        "email": "bob@example.com"
      ]
    ],
    "entries": [
      [
        "speaker_index": 0,
        "start_seconds": 0,
        "end_seconds": 2.5,
        "sentences": [
          [
            "text": "Welcome to the kickoff.",
            "start_seconds": 0,
            "end_seconds": 2.5
          ]
        ]
      ],
      [
        "speaker_index": 1,
        "start_seconds": 2.5,
        "end_seconds": 5,
        "sentences": [
          [
            "text": "Thanks, happy to be here.",
            "start_seconds": 2.5,
            "end_seconds": 5
          ]
        ]
      ]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/engagements")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 2

**Request**

```json
{
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
}
```

**Response**

```json
{
  "object": "engagement",
  "id": "string",
  "title": "string",
  "engagement_type": "MEETING",
  "processing_status": "PENDING",
  "is_private": true,
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "transcript_timeline": {
    "object": "transcript_timeline",
    "engagement_id": "string",
    "speakers": [
      {
        "id": "string",
        "type": "contact",
        "first_name": "string",
        "last_name": "string",
        "email": "string",
        "phone": "string",
        "speaking_percentage": 1.1,
        "sentiment": 1.1
      }
    ],
    "entries": [
      {
        "speaker": {
          "type": "contact",
          "id": "string",
          "name": "string"
        },
        "text": "string",
        "start_seconds": 1.1,
        "end_seconds": 1.1,
        "num_words": 1,
        "sentences": [
          {
            "text": "string",
            "start_seconds": 1.1,
            "end_seconds": 1.1
          }
        ]
      }
    ],
    "overall_sentiment": 1.1
  },
  "description": "string",
  "data_source": "string",
  "is_internal": true,
  "engagement_at": "2024-01-15T09:30:00Z",
  "start_at": "2024-01-15T09:30:00Z",
  "end_at": "2024-01-15T09:30:00Z",
  "duration_seconds": 1,
  "meeting_url": "string",
  "external_url": "string",
  "crm_association": {
    "object_type": "string",
    "crm_object_id": "string",
    "source": "string"
  },
  "owner_user_id": "string",
  "host_user_id": "string",
  "transcript": "string",
  "media_url": "string",
  "companies": [
    {
      "object": "engagement_company",
      "id": "string",
      "name": "string",
      "domains": [
        "string"
      ],
      "crm_association": {
        "object_type": "string",
        "crm_object_id": "string",
        "source": "string"
      }
    }
  ],
  "contacts": [
    {
      "object": "contact",
      "id": "cnt_01HQY3JMS2QAXJGX6X7CH7CM6X",
      "created_at": "2026-03-01T12:00:00Z",
      "updated_at": "2026-03-04T18:25:00Z",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "description": "Primary customer contact for analytical projects.",
      "company": {
        "id": "string",
        "object": "string"
      },
      "emails": [
        {
          "email": "ada@analytical.engine",
          "is_primary": true
        }
      ],
      "phone_numbers": [
        {
          "phone_number": "+1-555-0100",
          "is_primary": true
        }
      ],
      "crm_association": {
        "object_type": "string",
        "crm_object_id": "string",
        "source": "string"
      },
      "time_zone": "America/Los_Angeles"
    }
  ],
  "owner": {
    "object": "user",
    "id": "string",
    "role": "OWNER",
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z",
    "first_name": "string",
    "last_name": "string",
    "job_title": "string",
    "emails": [
      {
        "email": "string",
        "is_primary": true
      }
    ],
    "time_zone": "string",
    "last_activity_at": "2024-01-15T09:30:00Z"
  },
  "action_items": [
    {
      "object": "engagement_action_item",
      "id": "string",
      "title": "string",
      "description": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "due_on": "string",
      "assigned_to_user_id": "string",
      "assigned_to_user_name": "string",
      "assigned_to_user_email": "string"
    }
  ],
  "signals": [
    {
      "object": "engagement_signal",
      "id": "string",
      "annotation_definition_id": "string",
      "name": "string",
      "data_type": "string",
      "description": "string"
    }
  ],
  "tags": [
    {
      "object": "tag",
      "id": "string",
      "name": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "hex_color": "string",
      "description": "string",
      "auto_tagging_enabled": true
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://app.askelephant.ai/api/v2/engagements"

payload = {
    "type": "CALL",
    "title": "Discovery call",
    "source_system": "custom-dialer",
    "external_id": "call_12345",
    "run_workflows": True,
    "media_url": "https://recordings.example.com/call_12345.mp3",
    "start_at": "2026-06-12T17:00:00Z"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.askelephant.ai/api/v2/engagements';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"CALL","title":"Discovery call","source_system":"custom-dialer","external_id":"call_12345","run_workflows":true,"media_url":"https://recordings.example.com/call_12345.mp3","start_at":"2026-06-12T17:00:00Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.askelephant.ai/api/v2/engagements"

	payload := strings.NewReader("{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.askelephant.ai/api/v2/engagements")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.askelephant.ai/api/v2/engagements")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.askelephant.ai/api/v2/engagements', [
  'body' => '{
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.askelephant.ai/api/v2/engagements");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/engagements")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 3

**Request**

```json
{
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
}
```

**Response**

```json
{
  "object": "engagement",
  "id": "string",
  "title": "string",
  "engagement_type": "MEETING",
  "processing_status": "PENDING",
  "is_private": true,
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "transcript_timeline": {
    "object": "transcript_timeline",
    "engagement_id": "string",
    "speakers": [
      {
        "id": "string",
        "type": "contact",
        "first_name": "string",
        "last_name": "string",
        "email": "string",
        "phone": "string",
        "speaking_percentage": 1.1,
        "sentiment": 1.1
      }
    ],
    "entries": [
      {
        "speaker": {
          "type": "contact",
          "id": "string",
          "name": "string"
        },
        "text": "string",
        "start_seconds": 1.1,
        "end_seconds": 1.1,
        "num_words": 1,
        "sentences": [
          {
            "text": "string",
            "start_seconds": 1.1,
            "end_seconds": 1.1
          }
        ]
      }
    ],
    "overall_sentiment": 1.1
  },
  "description": "string",
  "data_source": "string",
  "is_internal": true,
  "engagement_at": "2024-01-15T09:30:00Z",
  "start_at": "2024-01-15T09:30:00Z",
  "end_at": "2024-01-15T09:30:00Z",
  "duration_seconds": 1,
  "meeting_url": "string",
  "external_url": "string",
  "crm_association": {
    "object_type": "string",
    "crm_object_id": "string",
    "source": "string"
  },
  "owner_user_id": "string",
  "host_user_id": "string",
  "transcript": "string",
  "media_url": "string",
  "companies": [
    {
      "object": "engagement_company",
      "id": "string",
      "name": "string",
      "domains": [
        "string"
      ],
      "crm_association": {
        "object_type": "string",
        "crm_object_id": "string",
        "source": "string"
      }
    }
  ],
  "contacts": [
    {
      "object": "contact",
      "id": "cnt_01HQY3JMS2QAXJGX6X7CH7CM6X",
      "created_at": "2026-03-01T12:00:00Z",
      "updated_at": "2026-03-04T18:25:00Z",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "description": "Primary customer contact for analytical projects.",
      "company": {
        "id": "string",
        "object": "string"
      },
      "emails": [
        {
          "email": "ada@analytical.engine",
          "is_primary": true
        }
      ],
      "phone_numbers": [
        {
          "phone_number": "+1-555-0100",
          "is_primary": true
        }
      ],
      "crm_association": {
        "object_type": "string",
        "crm_object_id": "string",
        "source": "string"
      },
      "time_zone": "America/Los_Angeles"
    }
  ],
  "owner": {
    "object": "user",
    "id": "string",
    "role": "OWNER",
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z",
    "first_name": "string",
    "last_name": "string",
    "job_title": "string",
    "emails": [
      {
        "email": "string",
        "is_primary": true
      }
    ],
    "time_zone": "string",
    "last_activity_at": "2024-01-15T09:30:00Z"
  },
  "action_items": [
    {
      "object": "engagement_action_item",
      "id": "string",
      "title": "string",
      "description": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "due_on": "string",
      "assigned_to_user_id": "string",
      "assigned_to_user_name": "string",
      "assigned_to_user_email": "string"
    }
  ],
  "signals": [
    {
      "object": "engagement_signal",
      "id": "string",
      "annotation_definition_id": "string",
      "name": "string",
      "data_type": "string",
      "description": "string"
    }
  ],
  "tags": [
    {
      "object": "tag",
      "id": "string",
      "name": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "hex_color": "string",
      "description": "string",
      "auto_tagging_enabled": true
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://app.askelephant.ai/api/v2/engagements"

payload = {
    "type": "CALL",
    "title": "Discovery call",
    "source_system": "custom-dialer",
    "external_id": "call_12345",
    "run_workflows": True,
    "media_url": "https://recordings.example.com/call_12345.mp3",
    "start_at": "2026-06-12T17:00:00Z"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.askelephant.ai/api/v2/engagements';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"CALL","title":"Discovery call","source_system":"custom-dialer","external_id":"call_12345","run_workflows":true,"media_url":"https://recordings.example.com/call_12345.mp3","start_at":"2026-06-12T17:00:00Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.askelephant.ai/api/v2/engagements"

	payload := strings.NewReader("{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.askelephant.ai/api/v2/engagements")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.askelephant.ai/api/v2/engagements")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.askelephant.ai/api/v2/engagements', [
  'body' => '{
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.askelephant.ai/api/v2/engagements");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/engagements")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 4

**Request**

```json
{
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://app.askelephant.ai/api/v2/engagements"

payload = {
    "type": "CALL",
    "title": "Discovery call",
    "source_system": "custom-dialer",
    "external_id": "call_12345",
    "run_workflows": True,
    "media_url": "https://recordings.example.com/call_12345.mp3",
    "start_at": "2026-06-12T17:00:00Z"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.askelephant.ai/api/v2/engagements';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"CALL","title":"Discovery call","source_system":"custom-dialer","external_id":"call_12345","run_workflows":true,"media_url":"https://recordings.example.com/call_12345.mp3","start_at":"2026-06-12T17:00:00Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.askelephant.ai/api/v2/engagements"

	payload := strings.NewReader("{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.askelephant.ai/api/v2/engagements")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.askelephant.ai/api/v2/engagements")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.askelephant.ai/api/v2/engagements', [
  'body' => '{
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.askelephant.ai/api/v2/engagements");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"CALL\",\n  \"title\": \"Discovery call\",\n  \"source_system\": \"custom-dialer\",\n  \"external_id\": \"call_12345\",\n  \"run_workflows\": true,\n  \"media_url\": \"https://recordings.example.com/call_12345.mp3\",\n  \"start_at\": \"2026-06-12T17:00:00Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "CALL",
  "title": "Discovery call",
  "source_system": "custom-dialer",
  "external_id": "call_12345",
  "run_workflows": true,
  "media_url": "https://recordings.example.com/call_12345.mp3",
  "start_at": "2026-06-12T17:00:00Z"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/engagements")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```