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

# Replace engagement contacts

PUT https://app.askelephant.ai/api/v2/engagements/{engagement_id}/contacts
Content-Type: application/json

Replaces the full set of non-calendar-resource contact participants linked to an engagement. Send an empty `contact_ids` array to clear all managed contacts. Existing calendar-resource participants are preserved. Requires the `engagements:write` scope. Updating a private engagement also requires `engagements:private:write`. When the credential can also read the updated engagement, the response returns the engagement payload. Otherwise the update succeeds with `204 No Content`.

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

## 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

### Path parameters

- `engagement_id` (string, required)

### Body (application/json)

This endpoint expects an engagement_contact_replace_request.

- `contact_ids` (list of string, required)

## Response

### 200

Updated engagement response.

- `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)
- `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.
- `transcript_timeline` (transcript_timeline, optional, nullable) — Structured transcript timeline with timed speaker entries. Only included when `expand` contains `transcript_timeline`. Returns `null` when the engagement has no primary timeline or when timeline serialization fails for that engagement (the surrounding engagement response still succeeds). Requires `transcript_timelines:read`. Matches the object returned by `GET /v2/engagements/{engagement_id}/transcript_timeline`.
- `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

Update succeeded, but no engagement payload is returned because the credential cannot read the updated engagement.

## 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 requested resource does not exist.

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

- `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

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

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

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

### 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)

### 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

### Example 1

**Request**

```json
{
  "contact_ids": [
    "string"
  ]
}
```

**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",
  "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",
  "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
  },
  "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/engagement_id/contacts"

payload = { "contact_ids": ["string"] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"contact_ids":["string"]}'
};

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/engagement_id/contacts"

	payload := strings.NewReader("{\n  \"contact_ids\": [\n    \"string\"\n  ]\n}")

	req, _ := http.NewRequest("PUT", 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/engagement_id/contacts")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"contact_ids\": [\n    \"string\"\n  ]\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.put("https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contact_ids\": [\n    \"string\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts', [
  'body' => '{
  "contact_ids": [
    "string"
  ]
}',
  '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/engagement_id/contacts");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contact_ids\": [\n    \"string\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["contact_ids": ["string"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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
{
  "contact_ids": [
    "string"
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

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

payload = { "contact_ids": ["string"] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"contact_ids":["string"]}'
};

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/engagement_id/contacts"

	payload := strings.NewReader("{\n  \"contact_ids\": [\n    \"string\"\n  ]\n}")

	req, _ := http.NewRequest("PUT", 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/engagement_id/contacts")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"contact_ids\": [\n    \"string\"\n  ]\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.put("https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contact_ids\": [\n    \"string\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts', [
  'body' => '{
  "contact_ids": [
    "string"
  ]
}',
  '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/engagement_id/contacts");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contact_ids\": [\n    \"string\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["contact_ids": ["string"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/engagements/engagement_id/contacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```