Python
import requests
url = "https://app.langwatch.ai/api/v1/agents/connect/register"
payload = {
"protocol": 1,
"type": "register",
"sdk": {
"name": "<string>",
"version": "<string>",
"language": "<string>"
},
"instance": {
"id": "<string>",
"hostname": "<string>",
"username": "<string>",
"pid": 1,
"startedAt": "<string>",
"label": "<string>",
"inFlightCallIds": [],
"maxConcurrency": 500
},
"agents": [
{
"name": "<string>",
"environment": "<string>",
"description": "<string>",
"parameters": {},
"concurrency": 500,
"timeoutMs": 1,
"sticky": True
}
]
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
protocol: 1,
type: 'register',
sdk: {name: '<string>', version: '<string>', language: '<string>'},
instance: {
id: '<string>',
hostname: '<string>',
username: '<string>',
pid: 1,
startedAt: '<string>',
label: '<string>',
inFlightCallIds: [],
maxConcurrency: 500
},
agents: [
{
name: '<string>',
environment: '<string>',
description: '<string>',
parameters: {},
concurrency: 500,
timeoutMs: 1,
sticky: true
}
]
})
};
fetch('https://app.langwatch.ai/api/v1/agents/connect/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/agents/connect/register \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"protocol": 1,
"type": "register",
"sdk": {
"name": "<string>",
"version": "<string>",
"language": "<string>"
},
"instance": {
"id": "<string>",
"hostname": "<string>",
"username": "<string>",
"pid": 1,
"startedAt": "<string>",
"label": "<string>",
"inFlightCallIds": [],
"maxConcurrency": 500
},
"agents": [
{
"name": "<string>",
"environment": "<string>",
"description": "<string>",
"parameters": {},
"concurrency": 500,
"timeoutMs": 1,
"sticky": true
}
]
}
'{
"frame": {
"protocol": 1,
"type": "registered",
"agents": [
{
"name": "<string>",
"environment": "<string>",
"id": "<string>",
"url": "<string>",
"parameterNotes": [
"<string>"
]
}
],
"heartbeatIntervalMs": 123,
"instanceId": "<string>"
},
"instanceToken": "<string>"
}Agents
Create Register
Register the connected agents of a process over HTTP, for a network that blocks WebSockets. The body is the register frame of the connect protocol. Answers with the registered frame and the instance token the poll and frames endpoints are addressed with, or with a refused frame.
POST
/
api
/
v1
/
agents
/
connect
/
register
Python
import requests
url = "https://app.langwatch.ai/api/v1/agents/connect/register"
payload = {
"protocol": 1,
"type": "register",
"sdk": {
"name": "<string>",
"version": "<string>",
"language": "<string>"
},
"instance": {
"id": "<string>",
"hostname": "<string>",
"username": "<string>",
"pid": 1,
"startedAt": "<string>",
"label": "<string>",
"inFlightCallIds": [],
"maxConcurrency": 500
},
"agents": [
{
"name": "<string>",
"environment": "<string>",
"description": "<string>",
"parameters": {},
"concurrency": 500,
"timeoutMs": 1,
"sticky": True
}
]
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
protocol: 1,
type: 'register',
sdk: {name: '<string>', version: '<string>', language: '<string>'},
instance: {
id: '<string>',
hostname: '<string>',
username: '<string>',
pid: 1,
startedAt: '<string>',
label: '<string>',
inFlightCallIds: [],
maxConcurrency: 500
},
agents: [
{
name: '<string>',
environment: '<string>',
description: '<string>',
parameters: {},
concurrency: 500,
timeoutMs: 1,
sticky: true
}
]
})
};
fetch('https://app.langwatch.ai/api/v1/agents/connect/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/agents/connect/register \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"protocol": 1,
"type": "register",
"sdk": {
"name": "<string>",
"version": "<string>",
"language": "<string>"
},
"instance": {
"id": "<string>",
"hostname": "<string>",
"username": "<string>",
"pid": 1,
"startedAt": "<string>",
"label": "<string>",
"inFlightCallIds": [],
"maxConcurrency": 500
},
"agents": [
{
"name": "<string>",
"environment": "<string>",
"description": "<string>",
"parameters": {},
"concurrency": 500,
"timeoutMs": 1,
"sticky": true
}
]
}
'{
"frame": {
"protocol": 1,
"type": "registered",
"agents": [
{
"name": "<string>",
"environment": "<string>",
"id": "<string>",
"url": "<string>",
"parameterNotes": [
"<string>"
]
}
],
"heartbeatIntervalMs": 123,
"instanceId": "<string>"
},
"instanceToken": "<string>"
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Body
application/json
Response
The instance is registered
Last modified on August 31, 2026
Was this page helpful?