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

# Ingest an out-of-band conversation event

POST https://api.runtype.com/v1/conversations/events
Content-Type: application/json

Record a deterministic product or channel message sent outside an agent turn (such as transactional SMS receipts, shipping alerts, proactive nudges, or operator handoffs), grade UX and spam friction signals against the channel trait matrix, and store it for channel simulator replay.

Reference: https://docs.runtype.com/api-reference/runtype-api/conversations/ingest-an-out-of-band-conversation-event

## Authentication

- `Authorization` header (bearer token, required) — API key or Clerk session token

## Servers

- `https://api.runtype.com` (Production, default)
- `https://api.runtype-staging.com` (Staging)

## Request

### Body (application/json)

This endpoint expects an IngestConversationChannelEventRequest.

- `channel` (enum, required)
  - Allowed values: `chat`, `api`, `mcp`, `a2a`, `cli`, `chrome_extension`, `email`, `sms`, `imessage`, `whatsapp`, `telegram`, `slack`, `discord`, `webhook`, `schedule`, `voice`, `teams`, `google_chat`, `messenger`, `instagram`, `rcs`, `signal`, `line`, `other`
- `content` (string, required)
- `conversationId` (string, required)
- `agentId` (string, optional)
- `deliveryStatus` (enum, optional, default: sent)
  - Allowed values: `pending`, `sent`, `delivered`, `read`, `failed`, `bounced`
- `direction` (enum, optional, default: outbound)
  - Allowed values: `outbound`, `inbound`
- `eventKind` (enum, optional, default: outbound_notification)
  - Allowed values: `outbound_notification`, `proactive_nudge`, `transactional_receipt`, `status_banner`, `operator_handoff`, `system_notice`
- `idempotencyKey` (string, optional)
- `interactivePayload` (map from string to any, optional)
- `media` (list of IngestConversationChannelEventRequestMediaItems, optional)
- `metadata` (map from string to any, optional)
- `occurredAt` (datetime, optional)
- `productId` (string, optional)
- `senderName` (string, optional)

## Response

### 200

Duplicate idempotencyKey matched an existing conversation event

- `deduplicated` (boolean, required)
- `event` (ConversationChannelEvent, required)

### 201

Conversation event ingested and signal-graded

- `deduplicated` (boolean, required)
- `event` (ConversationChannelEvent, required)

## Errors

### 400 Bad Request Error

Validation error

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 401 Unauthorized Error

Unauthorized

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 403 Forbidden Error

Insufficient permissions

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 404 Not Found Error

Referenced agent or product not found

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 409 Conflict Error

Idempotency key conflicts with a different existing conversation event

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 413 Content Too Large Error

Payload exceeds size limits

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 500 Internal Server Error

Internal server error

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

## Types

### IngestConversationChannelEventRequestMediaItems

- `contentType` (string, required)
- `url` (string, required)
- `name` (string, optional)
- `size` (integer, optional)

### ConversationChannelEvent

- `agentId` (string, required, nullable)
- `channel` (enum, required)
  - Allowed values: `chat`, `api`, `mcp`, `a2a`, `cli`, `chrome_extension`, `email`, `sms`, `imessage`, `whatsapp`, `telegram`, `slack`, `discord`, `webhook`, `schedule`, `voice`, `teams`, `google_chat`, `messenger`, `instagram`, `rcs`, `signal`, `line`, `other`
- `content` (string, required)
- `conversationId` (string, required)
- `createdAt` (string, required)
- `deliveryStatus` (enum, required)
  - Allowed values: `pending`, `sent`, `delivered`, `read`, `failed`, `bounced`
- `direction` (enum, required)
  - Allowed values: `outbound`, `inbound`
- `eventKind` (enum, required)
  - Allowed values: `outbound_notification`, `proactive_nudge`, `transactional_receipt`, `status_banner`, `operator_handoff`, `system_notice`
- `id` (string, required)
- `idempotencyKey` (string, required, nullable)
- `interactivePayload` (map from string to any, required, nullable)
- `media` (list of ConversationChannelEventMediaItems, required)
- `metadata` (map from string to any, required)
- `occurredAt` (string, required)
- `organizationId` (string, required, nullable)
- `productId` (string, required, nullable)
- `senderName` (string, required, nullable)
- `signalGrade` (ConversationChannelEventSignalGrade, required)

### ErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

### ConversationChannelEventMediaItems

- `contentType` (string, required)
- `url` (string, required)
- `name` (string, optional)
- `size` (integer, optional)

### ConversationChannelEventSignalGrade

- `firedSignals` (list of enum, required)
  - Allowed values: `spam_burst`, `duplicate_nudge`, `length_overflow`, `sms_multi_segment_friction`, `unsupported_markdown_leak`, `unsupported_interactive_ui`, `unsupported_media`, `delivery_failure`
- `frictionScore` (double, required)
- `passed` (boolean, required)
- `reasons` (list of string, required)

## Examples

### Example 1

**Request**

```json
{
  "channel": "chat",
  "content": "string",
  "conversationId": "string"
}
```

**Response**

```json
{
  "deduplicated": true,
  "event": {
    "agentId": "string",
    "channel": "chat",
    "content": "string",
    "conversationId": "string",
    "createdAt": "string",
    "deliveryStatus": "pending",
    "direction": "outbound",
    "eventKind": "outbound_notification",
    "id": "string",
    "idempotencyKey": "string",
    "interactivePayload": {},
    "media": [
      {
        "contentType": "string",
        "url": "string",
        "name": "string",
        "size": 1
      }
    ],
    "metadata": {},
    "occurredAt": "string",
    "organizationId": "string",
    "productId": "string",
    "senderName": "string",
    "signalGrade": {
      "firedSignals": [
        "spam_burst"
      ],
      "frictionScore": 0.5,
      "passed": true,
      "reasons": [
        "string"
      ]
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.runtype.com/v1/conversations/events"

payload = {
    "channel": "chat",
    "content": "string",
    "conversationId": "string"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.runtype.com/v1/conversations/events';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"channel":"chat","content":"string","conversationId":"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://api.runtype.com/v1/conversations/events"

	payload := strings.NewReader("{\n  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\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://api.runtype.com/v1/conversations/events")

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  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\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://api.runtype.com/v1/conversations/events")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/conversations/events', [
  'body' => '{
  "channel": "chat",
  "content": "string",
  "conversationId": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/conversations/events");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/conversations/events")! 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
{
  "channel": "chat",
  "content": "string",
  "conversationId": "string"
}
```

**Response**

```json
{
  "deduplicated": true,
  "event": {
    "agentId": "string",
    "channel": "chat",
    "content": "string",
    "conversationId": "string",
    "createdAt": "string",
    "deliveryStatus": "pending",
    "direction": "outbound",
    "eventKind": "outbound_notification",
    "id": "string",
    "idempotencyKey": "string",
    "interactivePayload": {},
    "media": [
      {
        "contentType": "string",
        "url": "string",
        "name": "string",
        "size": 1
      }
    ],
    "metadata": {},
    "occurredAt": "string",
    "organizationId": "string",
    "productId": "string",
    "senderName": "string",
    "signalGrade": {
      "firedSignals": [
        "spam_burst"
      ],
      "frictionScore": 0.5,
      "passed": true,
      "reasons": [
        "string"
      ]
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.runtype.com/v1/conversations/events"

payload = {
    "channel": "chat",
    "content": "string",
    "conversationId": "string"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.runtype.com/v1/conversations/events';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"channel":"chat","content":"string","conversationId":"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://api.runtype.com/v1/conversations/events"

	payload := strings.NewReader("{\n  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\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://api.runtype.com/v1/conversations/events")

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  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\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://api.runtype.com/v1/conversations/events")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/conversations/events', [
  'body' => '{
  "channel": "chat",
  "content": "string",
  "conversationId": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/conversations/events");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"channel\": \"chat\",\n  \"content\": \"string\",\n  \"conversationId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/conversations/events")! 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()
```