> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.askelephant.ai/api-reference/engagements/llms.txt.
> For full documentation content, see https://docs.askelephant.ai/api-reference/engagements/llms-full.txt.

# Create engagement

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

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

**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`).

**Media requirements:** The `media_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.

**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.

**Timestamps:** If `start_at` is omitted, the current server time is used. The `ended_at` timestamp 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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: AskElephant Public API
  version: 1.0.0
paths:
  /v2/engagements:
    post:
      operationId: create-engagement
      summary: Create engagement
      description: >-
        Creates a new `CALL` or `MEETING` engagement by ingesting a media
        recording from an external URL.


        **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`).


        **Media requirements:** The `media_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.


        **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.


        **Timestamps:** If `start_at` is omitted, the current server time is
        used. The `ended_at` timestamp is derived automatically from the media
        duration during processing.


        This operation requires the `engagements:write` scope.
      tags:
        - subpackage_engagements
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            An engagement with the same `external_id` already exists in this
            workspace. The existing engagement is returned unchanged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/engagement'
        '400':
          description: Request validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Authentication is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Authenticated but missing required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: >-
            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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '409':
          description: >-
            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`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: >-
            Request body validation failed, or the media URL could not be
            processed. Common causes include: unsupported engagement type,
            missing required fields, 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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/engagement_create_request'
servers:
  - url: https://app.askelephant.ai/api
  - url: https://app-staging.askelephant.ai/api
components:
  schemas:
    EngagementCreateRequestType:
      type: string
      enum:
        - CALL
        - MEETING
      description: >-
        The engagement type. Only `CALL` and `MEETING` are supported for
        creation via the public API.
      title: EngagementCreateRequestType
    engagement_create_participant:
      type: object
      properties:
        name:
          type: string
          description: Display name of the participant.
        first_name:
          type: string
          description: First name of the participant.
        last_name:
          type: string
          description: Last name of the participant.
        email:
          type: string
          description: Email address of the participant.
        phone:
          type: string
          description: >-
            Phone number of the participant in E.164 format (e.g.
            `+14155552671`).
        is_owner:
          type: boolean
          description: >-
            Indicates whether this participant is the owner/host of the
            engagement. At most one participant should be marked as owner.
      title: engagement_create_participant
    engagement_create_request:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/EngagementCreateRequestType'
          description: >-
            The engagement type. Only `CALL` and `MEETING` are supported for
            creation via the public API.
        title:
          type: string
          description: Display title for the engagement.
        source_system:
          type: string
          description: >-
            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:
          type: string
          description: >-
            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`).
        media_url:
          type: string
          format: uri
          description: >-
            Publicly accessible HTTPS URL pointing to the audio or video
            recording. 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.
        run_workflows:
          type: boolean
          description: >-
            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.
        start_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 timestamp for when the engagement started. Defaults to the
            current server time if omitted.
        is_private:
          type: boolean
          description: >-
            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:
          type: array
          items:
            $ref: '#/components/schemas/engagement_create_participant'
          description: >-
            Optional list of participants in the engagement. Each participant
            may have a name, email, or both.
        transcript_text:
          type: string
          description: >-
            Optional plain-text transcript content. If provided, stored
            alongside the media recording. The media will still be processed
            through the transcription pipeline; this text serves as
            supplementary content. 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.
      required:
        - type
        - title
        - source_system
        - external_id
        - media_url
        - run_workflows
      title: engagement_create_request
    EngagementObject:
      type: string
      enum:
        - engagement
      title: EngagementObject
    EngagementEngagementType:
      type: string
      enum:
        - MEETING
        - CALL
        - EMAIL
        - TASK
        - NOTE
        - CALENDAR_EVENT
        - DOCUMENT
      title: EngagementEngagementType
    EngagementProcessingStatus:
      type: string
      enum:
        - PENDING
        - PROCESSING
        - COMPLETED
        - FAILED
      title: EngagementProcessingStatus
    EngagementCompanyObject:
      type: string
      enum:
        - engagement_company
      title: EngagementCompanyObject
    crm_association:
      type: object
      properties:
        object_type:
          type: string
          description: CRM object type.
        crm_object_id:
          type: string
          description: The record ID in the source CRM system.
        source:
          type: string
          description: CRM source system.
      required:
        - object_type
        - crm_object_id
        - source
      title: crm_association
    engagement_company:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/EngagementCompanyObject'
        id:
          type: string
        name:
          type: string
        crm_association:
          $ref: '#/components/schemas/crm_association'
          description: >-
            CRM record linked to this company. Present when the company has been
            matched to a CRM record via integration or API.
        domains:
          type: array
          items:
            type: string
      required:
        - object
        - id
        - name
        - domains
      title: engagement_company
    ContactObject:
      type: string
      enum:
        - contact
      description: Resource discriminator for contact payloads.
      title: ContactObject
    resource_ref:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
      required:
        - id
        - object
      title: resource_ref
    ContactEmailsItems:
      type: object
      properties:
        email:
          type: string
          format: email
          description: Contact email address.
        is_primary:
          type: boolean
          description: Indicates whether this is the primary email address.
      required:
        - email
        - is_primary
      title: ContactEmailsItems
    ContactPhoneNumbersItems:
      type: object
      properties:
        phone_number:
          type: string
          description: Contact phone number in the source-system format.
        is_primary:
          type: boolean
          description: Indicates whether this is the primary phone number.
      required:
        - phone_number
        - is_primary
      title: ContactPhoneNumbersItems
    contact:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/ContactObject'
          description: Resource discriminator for contact payloads.
        id:
          type: string
          description: Stable AskElephant contact identifier.
        first_name:
          type:
            - string
            - 'null'
          description: Contact given name.
        last_name:
          type:
            - string
            - 'null'
          description: Contact family name.
        description:
          type: string
          description: Free-form contact summary or notes visible through the public API.
        company:
          $ref: '#/components/schemas/resource_ref'
          description: >-
            Lightweight reference to the contact's associated company when one
            exists.
        emails:
          type: array
          items:
            $ref: '#/components/schemas/ContactEmailsItems'
          description: Email addresses associated with the contact.
        phone_numbers:
          type: array
          items:
            $ref: '#/components/schemas/ContactPhoneNumbersItems'
          description: Phone numbers associated with the contact.
        crm_association:
          $ref: '#/components/schemas/crm_association'
          description: >-
            CRM record linked to this contact. Present when the contact has been
            matched to a CRM record via integration or API.
        time_zone:
          type: string
          description: IANA time zone identifier for the contact.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the contact was first created in AskElephant.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the contact was most recently updated in AskElephant.
      required:
        - object
        - id
        - created_at
        - updated_at
      description: Public representation of a workspace contact.
      title: contact
    UserObject:
      type: string
      enum:
        - user
      title: UserObject
    UserRole:
      type: string
      enum:
        - OWNER
        - MANAGER
        - USER
        - INACTIVE
        - NOT_INVITED
      title: UserRole
    UserEmailsItems:
      type: object
      properties:
        email:
          type: string
          format: email
        is_primary:
          type: boolean
      required:
        - email
        - is_primary
      title: UserEmailsItems
    user:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/UserObject'
        id:
          type: string
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        job_title:
          type: string
        role:
          $ref: '#/components/schemas/UserRole'
        emails:
          type: array
          items:
            $ref: '#/components/schemas/UserEmailsItems'
        time_zone:
          type: string
        last_activity_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - role
        - created_at
        - updated_at
      title: user
    EngagementActionItemObject:
      type: string
      enum:
        - engagement_action_item
      title: EngagementActionItemObject
    engagement_action_item:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/EngagementActionItemObject'
        id:
          type: string
        title:
          type: string
        description:
          type: string
        due_on:
          type:
            - string
            - 'null'
        assigned_to_user_id:
          type:
            - string
            - 'null'
        assigned_to_user_name:
          type:
            - string
            - 'null'
        assigned_to_user_email:
          type:
            - string
            - 'null'
          format: email
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - title
        - description
        - created_at
        - updated_at
      title: engagement_action_item
    EngagementSignalObject:
      type: string
      enum:
        - engagement_signal
      title: EngagementSignalObject
    engagement_signal:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/EngagementSignalObject'
        id:
          type: string
        annotation_definition_id:
          type: string
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        data_type:
          type: string
        value:
          description: Any type
      required:
        - object
        - id
        - annotation_definition_id
        - name
        - data_type
        - value
      title: engagement_signal
    TagObject:
      type: string
      enum:
        - tag
      title: TagObject
    tag:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/TagObject'
        id:
          type: string
        name:
          type: string
        hex_color:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        auto_tagging_enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - name
        - created_at
        - updated_at
      title: tag
    engagement:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/EngagementObject'
        id:
          type: string
        title:
          type: string
        description:
          type: string
        engagement_type:
          $ref: '#/components/schemas/EngagementEngagementType'
        data_source:
          type: string
        processing_status:
          $ref: '#/components/schemas/EngagementProcessingStatus'
        is_internal:
          type: boolean
        is_private:
          type: boolean
          description: Indicates whether the engagement is marked private in AskElephant.
        engagement_at:
          type: string
          format: date-time
        start_at:
          type: string
          format: date-time
        end_at:
          type: string
          format: date-time
        duration_seconds:
          type: integer
        meeting_url:
          type: string
          format: uri
        owner_user_id:
          type: string
        host_user_id:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        transcript:
          type:
            - string
            - 'null'
          description: >-
            Full text transcript of the engagement. Only included when `expand`
            contains `transcript`.
        media_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Temporary signed URL for downloading the engagement recording media.
            Only included when `expand` contains `media_url`. The URL expires
            after a short period.
        companies:
          type: array
          items:
            $ref: '#/components/schemas/engagement_company'
          description: >-
            Companies associated with this engagement. Only included when
            `expand` contains `companies`.
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/contact'
          description: >-
            Contact participants associated with this engagement. Only included
            when `expand` contains `contacts`.
        owner:
          oneOf:
            - $ref: '#/components/schemas/user'
            - type: 'null'
          description: >-
            Workspace user who owns this engagement. Only included when `expand`
            contains `owner`.
        action_items:
          type: array
          items:
            $ref: '#/components/schemas/engagement_action_item'
          description: >-
            Action items created from this engagement. Only included when
            `expand` contains `action_items`.
        signals:
          type: array
          items:
            $ref: '#/components/schemas/engagement_signal'
          description: >-
            Signals (annotations) extracted from this engagement. Only included
            when `expand` contains `signals`.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/tag'
          description: >-
            Tags applied to this engagement. Only included when `expand`
            contains `tags`.
      required:
        - object
        - id
        - title
        - engagement_type
        - processing_status
        - is_private
        - created_at
        - updated_at
      title: engagement
    error_item:
      type: object
      properties:
        field:
          type: string
          description: Request field or parameter associated with the error.
        code:
          type: string
          description: Stable machine-readable error code.
        message:
          type: string
          description: Human-readable explanation of the error.
      required:
        - code
        - message
      description: Structured validation or field-level error detail.
      title: error_item
    error:
      type: object
      properties:
        type:
          type: string
          format: uri
          description: Stable URI identifying the error category.
        title:
          type: string
          description: Short human-readable summary of the error.
        status:
          type: integer
          description: HTTP status code for this error response.
        detail:
          type: string
          description: Human-readable explanation specific to this request.
        request_id:
          type: string
          description: Correlation identifier for support and debugging.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/error_item'
          description: Optional field-level validation errors.
      required:
        - type
        - title
        - status
        - detail
        - request_id
      description: RFC 9457 problem details response returned for client-visible failures.
      title: error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python
import requests

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

payload = {
    "type": "CALL",
    "title": "Quarterly Sales Strategy Discussion",
    "source_system": "salesforce",
    "external_id": "sf-2024-04-15-call-7890",
    "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
    "run_workflows": True
}
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":"Quarterly Sales Strategy Discussion","source_system":"salesforce","external_id":"sf-2024-04-15-call-7890","media_url":"https://media.askelephant.ai/recordings/call-7890.mp3","run_workflows":true}'
};

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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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": "Quarterly Sales Strategy Discussion",
  "source_system": "salesforce",
  "external_id": "sf-2024-04-15-call-7890",
  "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
  "run_workflows": true
}',
  '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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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": "Quarterly Sales Strategy Discussion",
  "source_system": "salesforce",
  "external_id": "sf-2024-04-15-call-7890",
  "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
  "run_workflows": true
] 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()
```

```python
import requests

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

payload = {
    "type": "CALL",
    "title": "Quarterly Sales Strategy Discussion",
    "source_system": "salesforce",
    "external_id": "sf-2024-04-15-call-7890",
    "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
    "run_workflows": True
}
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":"Quarterly Sales Strategy Discussion","source_system":"salesforce","external_id":"sf-2024-04-15-call-7890","media_url":"https://media.askelephant.ai/recordings/call-7890.mp3","run_workflows":true}'
};

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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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": "Quarterly Sales Strategy Discussion",
  "source_system": "salesforce",
  "external_id": "sf-2024-04-15-call-7890",
  "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
  "run_workflows": true
}',
  '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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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": "Quarterly Sales Strategy Discussion",
  "source_system": "salesforce",
  "external_id": "sf-2024-04-15-call-7890",
  "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
  "run_workflows": true
] 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()
```

```python
import requests

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

payload = {
    "type": "CALL",
    "title": "Quarterly Sales Strategy Discussion",
    "source_system": "salesforce",
    "external_id": "sf-2024-04-15-call-7890",
    "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
    "run_workflows": True
}
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":"Quarterly Sales Strategy Discussion","source_system":"salesforce","external_id":"sf-2024-04-15-call-7890","media_url":"https://media.askelephant.ai/recordings/call-7890.mp3","run_workflows":true}'
};

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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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": "Quarterly Sales Strategy Discussion",
  "source_system": "salesforce",
  "external_id": "sf-2024-04-15-call-7890",
  "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
  "run_workflows": true
}',
  '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\": \"Quarterly Sales Strategy Discussion\",\n  \"source_system\": \"salesforce\",\n  \"external_id\": \"sf-2024-04-15-call-7890\",\n  \"media_url\": \"https://media.askelephant.ai/recordings/call-7890.mp3\",\n  \"run_workflows\": true\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": "Quarterly Sales Strategy Discussion",
  "source_system": "salesforce",
  "external_id": "sf-2024-04-15-call-7890",
  "media_url": "https://media.askelephant.ai/recordings/call-7890.mp3",
  "run_workflows": true
] 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()
```