Referência da API
Cada operação REST pública, com os seus parâmetros, corpo, respostas e o host que a serve. Os trechos são copiáveis; nenhum pedido é enviado a partir desta página.
| Host | Serves |
|---|---|
| https://api.prodantix.com | Flags and messaging |
| https://eu.api.prodantix.com | Event ingestion (EU) |
| https://eu.replay.prodantix.com | Session replay (EU) |
flags
Evaluate all flags for a user
Evaluates every flag in the project against the given distinct id and the user state currently on file.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| distinct_id required | query | string | The end-user identifier to evaluate against. |
Responses
Evaluated flags
{
"flags": "object"
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Evaluation failed
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X GET "https://api.prodantix.com/v1/flags" \
-H "Authorization: Bearer $PROJECT_KEY"const response = await fetch('https://api.prodantix.com/v1/flags', {
method: 'GET',
headers: {
Authorization: `Bearer ${projectKey}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.prodantix.com/v1/flags'),
headers: {
'Authorization': 'Bearer $projectKey',
},
);response = requests.get(
"https://api.prodantix.com/v1/flags",
headers={"Authorization": f"Bearer {project_key}"},
)Fetch the project's full flag ruleset
Returns the project's complete flag ruleset so an SDK can evaluate locally per distinct id. Cacheable: responses carry Cache-Control: public, max-age=30, stale-while-revalidate=300.
Responses
The full flag ruleset
{
"flags": [
{
"description?": "string | null",
"enabled": "boolean",
"type?": "boolean | string | number | json",
"intent?": "release | experiment | operational | kill_switch | permission | sunset",
"key": "string",
"rolloutPercentage": "integer",
"targeting?": [
{
"attribute": "string",
"op": "eq | neq | in | not_in | contains | gt | gte | lt | lte | is_set | is_not_set",
"value?": "unknown"
}
],
"variations?": [
{
"key": "string",
"value": "unknown",
"weight": "integer"
}
]
}
],
"generatedAt": "string"
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Snapshot could not be read
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X GET "https://api.prodantix.com/v1/flags/snapshot" \
-H "Authorization: Bearer $PROJECT_KEY"const response = await fetch('https://api.prodantix.com/v1/flags/snapshot', {
method: 'GET',
headers: {
Authorization: `Bearer ${projectKey}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.prodantix.com/v1/flags/snapshot'),
headers: {
'Authorization': 'Bearer $projectKey',
},
);response = requests.get(
"https://api.prodantix.com/v1/flags/snapshot",
headers={"Authorization": f"Bearer {project_key}"},
)messaging
Read a user's in-app inbox
Returns the in-app messages targeting an end-user.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| distinct_id required | query | string | The end-user identifier whose inbox to read. |
Responses
The user's in-app messages
{
"messages": [
{
"id": "string",
"title": "string",
"body": "string",
"read": "boolean",
"createdAt": "unknown"
}
]
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Inbox could not be read
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X GET "https://api.prodantix.com/v1/messages" \
-H "Authorization: Bearer $PROJECT_KEY"const response = await fetch('https://api.prodantix.com/v1/messages', {
method: 'GET',
headers: {
Authorization: `Bearer ${projectKey}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.prodantix.com/v1/messages'),
headers: {
'Authorization': 'Bearer $projectKey',
},
);response = requests.get(
"https://api.prodantix.com/v1/messages",
headers={"Authorization": f"Bearer {project_key}"},
)Mark an in-app message read
Marks one in-app message read for an end-user.
Body
{
"message_id": "string",
"distinct_id": "string"
}Responses
The message was marked read
{
"ok": "boolean"
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}The message could not be marked read
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X POST "https://api.prodantix.com/v1/messages/read" \
-H "Authorization: Bearer $PROJECT_KEY" \
-H "Content-Type: application/json" \
-d '{"message_id":"string","distinct_id":"string"}'const response = await fetch('https://api.prodantix.com/v1/messages/read', {
method: 'POST',
headers: {
Authorization: `Bearer ${projectKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"message_id": "string",
"distinct_id": "string"
}),
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.prodantix.com/v1/messages/read'),
headers: {
'Authorization': 'Bearer $projectKey',
'Content-Type': 'application/json',
},
body: jsonEncode({"message_id":"string","distinct_id":"string"}),
);response = requests.post(
"https://api.prodantix.com/v1/messages/read",
headers={"Authorization": f"Bearer {project_key}"},
json={"message_id":"string","distinct_id":"string"},
)conversations
Open a support conversation
Opens a new conversation and returns a token scoped to it. The token is the only credential that authorizes reading or appending to the thread, and it is returned exactly once. Rate-limited per project key and per client IP.
Body
{
"distinctId": "string",
"subject?": "string | null"
}Responses
The conversation and its token
{
"conversationId": "string",
"token": "string",
"expiresInSeconds": "integer"
}Invalid request body
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Too many conversations opened
{
"statusCode": "integer",
"message": "string",
"error": "string"
}The conversation could not be opened
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X POST "https://api.prodantix.com/v1/conversations" \
-H "Authorization: Bearer $PROJECT_KEY" \
-H "Content-Type: application/json" \
-d '{"distinctId":"string","subject":"string"}'const response = await fetch('https://api.prodantix.com/v1/conversations', {
method: 'POST',
headers: {
Authorization: `Bearer ${projectKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"distinctId": "string",
"subject": "string"
}),
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.prodantix.com/v1/conversations'),
headers: {
'Authorization': 'Bearer $projectKey',
'Content-Type': 'application/json',
},
body: jsonEncode({"distinctId":"string","subject":"string"}),
);response = requests.post(
"https://api.prodantix.com/v1/conversations",
headers={"Authorization": f"Bearer {project_key}"},
json={"distinctId":"string","subject":"string"},
)Append a message to a conversation
Appends an end-user turn. Requires the conversation token in the X-Prodantix-Conversation-Token header; the token is scoped to one conversation.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The conversation the token was minted for. |
Body
{
"body": "string"
}Responses
The appended turn
{
"turn": {
"id": "string",
"authorKind": "string",
"authorId?": "string | null",
"body": "string",
"createdAt": "string"
}
}Invalid request body
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Missing or invalid project key or conversation token
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}The turn could not be appended
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X POST "https://api.prodantix.com/v1/conversations/:id/turns" \
-H "Authorization: Bearer $PROJECT_KEY" \
-H "Content-Type: application/json" \
-d '{"body":"string"}'const response = await fetch('https://api.prodantix.com/v1/conversations/:id/turns', {
method: 'POST',
headers: {
Authorization: `Bearer ${projectKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"body": "string"
}),
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.prodantix.com/v1/conversations/:id/turns'),
headers: {
'Authorization': 'Bearer $projectKey',
'Content-Type': 'application/json',
},
body: jsonEncode({"body":"string"}),
);response = requests.post(
"https://api.prodantix.com/v1/conversations/:id/turns",
headers={"Authorization": f"Bearer {project_key}"},
json={"body":"string"},
)Read a conversation thread
Returns the conversation and its turns. Requires the conversation token in the X-Prodantix-Conversation-Token header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The conversation the token was minted for. |
Responses
The conversation thread
{
"id": "string",
"distinctId": "string",
"subject?": "string | null",
"status": "string",
"lastTurnAt": "string",
"createdAt": "string",
"turns": [
{
"id": "string",
"authorKind": "string",
"authorId?": "string | null",
"body": "string",
"createdAt": "string"
}
]
}Missing or invalid project key or conversation token
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}The conversation could not be read
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X GET "https://api.prodantix.com/v1/conversations/:id" \
-H "Authorization: Bearer $PROJECT_KEY"const response = await fetch('https://api.prodantix.com/v1/conversations/:id', {
method: 'GET',
headers: {
Authorization: `Bearer ${projectKey}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.prodantix.com/v1/conversations/:id'),
headers: {
'Authorization': 'Bearer $projectKey',
},
);response = requests.get(
"https://api.prodantix.com/v1/conversations/:id",
headers={"Authorization": f"Bearer {project_key}"},
)events
Ingest a batch of events
Accepts a batch of analytics events. A 202 means accepted for processing, not persisted.
Body
{
"api_key?": "string | null",
"events": [
{
"context?": {
"locale?": "string | null",
"os?": "string | null",
"sdk?": "string | null",
"sdk_version?": "string | null"
},
"distinct_id": "string",
"event_id": "string",
"event_name": "string",
"properties?": "object",
"schema_version": "integer",
"session_id?": "string | null",
"timestamp": "string"
}
],
"sent_at": "string"
}Responses
Accepted for processing
{
"accepted": "integer"
}Malformed JSON or invalid payload
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X POST "https://eu.api.prodantix.com/v1/events" \
-H "Authorization: Bearer $PROJECT_KEY" \
-H "Content-Type: application/json" \
-d '{"api_key":"string","events":[],"sent_at":"string"}'const response = await fetch('https://eu.api.prodantix.com/v1/events', {
method: 'POST',
headers: {
Authorization: `Bearer ${projectKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"api_key": "string",
"events": [],
"sent_at": "string"
}),
});
const data = await response.json();final response = await http.post(
Uri.parse('https://eu.api.prodantix.com/v1/events'),
headers: {
'Authorization': 'Bearer $projectKey',
'Content-Type': 'application/json',
},
body: jsonEncode({"api_key":"string","events":[],"sent_at":"string"}),
);response = requests.post(
"https://eu.api.prodantix.com/v1/events",
headers={"Authorization": f"Bearer {project_key}"},
json={"api_key":"string","events":[],"sent_at":"string"},
)Identify a user
Associates traits with a distinct id. A 202 means accepted for processing, not persisted.
Body
{
"distinct_id?": "string | null",
"event_id?": "string | null",
"properties?": "object | null",
"timestamp?": "string | null"
}Responses
Accepted for processing
{
"accepted": "integer"
}Malformed JSON or invalid payload
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X POST "https://eu.api.prodantix.com/v1/identify" \
-H "Authorization: Bearer $PROJECT_KEY" \
-H "Content-Type: application/json" \
-d '{"distinct_id":"string","event_id":"string","properties":{},"timestamp":"string"}'const response = await fetch('https://eu.api.prodantix.com/v1/identify', {
method: 'POST',
headers: {
Authorization: `Bearer ${projectKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"distinct_id": "string",
"event_id": "string",
"properties": {},
"timestamp": "string"
}),
});
const data = await response.json();final response = await http.post(
Uri.parse('https://eu.api.prodantix.com/v1/identify'),
headers: {
'Authorization': 'Bearer $projectKey',
'Content-Type': 'application/json',
},
body: jsonEncode({"distinct_id":"string","event_id":"string","properties":{},"timestamp":"string"}),
);response = requests.post(
"https://eu.api.prodantix.com/v1/identify",
headers={"Authorization": f"Bearer {project_key}"},
json={"distinct_id":"string","event_id":"string","properties":{},"timestamp":"string"},
)Associate a user with a group
Associates a distinct id with a group and its traits. A 202 means accepted for processing, not persisted.
Body
{
"distinct_id?": "string | null",
"event_id?": "string | null",
"properties?": "object | null",
"timestamp?": "string | null"
}Responses
Accepted for processing
{
"accepted": "integer"
}Malformed JSON or invalid payload
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Missing or invalid project key
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Project key belongs to a different region
{
"statusCode": "integer",
"message": "string",
"error": "string"
}Try it
curl -X POST "https://eu.api.prodantix.com/v1/group" \
-H "Authorization: Bearer $PROJECT_KEY" \
-H "Content-Type: application/json" \
-d '{"distinct_id":"string","event_id":"string","properties":{},"timestamp":"string"}'const response = await fetch('https://eu.api.prodantix.com/v1/group', {
method: 'POST',
headers: {
Authorization: `Bearer ${projectKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"distinct_id": "string",
"event_id": "string",
"properties": {},
"timestamp": "string"
}),
});
const data = await response.json();final response = await http.post(
Uri.parse('https://eu.api.prodantix.com/v1/group'),
headers: {
'Authorization': 'Bearer $projectKey',
'Content-Type': 'application/json',
},
body: jsonEncode({"distinct_id":"string","event_id":"string","properties":{},"timestamp":"string"}),
);response = requests.post(
"https://eu.api.prodantix.com/v1/group",
headers={"Authorization": f"Bearer {project_key}"},
json={"distinct_id":"string","event_id":"string","properties":{},"timestamp":"string"},
)replay
Upload a session replay chunk
Uploads one chunk of a recorded session. Chunks are ordered by seq within a session_id. Both responses are empty-bodied.
Body
{
"distinct_id": "string",
"events": [],
"masked": "boolean",
"schema_version": "integer",
"sdk?": "string | null",
"seq": "integer",
"session_id": "string",
"timestamp": "string"
}Responses
Chunk accepted
Chunk could not be queued
Try it
curl -X POST "https://eu.replay.prodantix.com/v1/replay" \
-H "Authorization: Bearer $PROJECT_KEY" \
-H "Content-Type: application/json" \
-d '{"distinct_id":"string","events":[],"masked":true,"schema_version":0,"sdk":"string","seq":0,"session_id":"string","timestamp":"string"}'const response = await fetch('https://eu.replay.prodantix.com/v1/replay', {
method: 'POST',
headers: {
Authorization: `Bearer ${projectKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"distinct_id": "string",
"events": [],
"masked": true,
"schema_version": 0,
"sdk": "string",
"seq": 0,
"session_id": "string",
"timestamp": "string"
}),
});
const data = await response.json();final response = await http.post(
Uri.parse('https://eu.replay.prodantix.com/v1/replay'),
headers: {
'Authorization': 'Bearer $projectKey',
'Content-Type': 'application/json',
},
body: jsonEncode({"distinct_id":"string","events":[],"masked":true,"schema_version":0,"sdk":"string","seq":0,"session_id":"string","timestamp":"string"}),
);response = requests.post(
"https://eu.replay.prodantix.com/v1/replay",
headers={"Authorization": f"Bearer {project_key}"},
json={"distinct_id":"string","events":[],"masked":true,"schema_version":0,"sdk":"string","seq":0,"session_id":"string","timestamp":"string"},
)