POST
/
v5
/
spans
Create Span
curl --request POST \
  --url https://api.egp.scale.com/v5/spans \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "id": "<string>",
  "name": "<string>",
  "trace_id": "<string>",
  "parent_id": "<string>",
  "group_id": "<string>",
  "start_timestamp": "2023-11-07T05:31:56Z",
  "end_timestamp": "2023-11-07T05:31:56Z",
  "input": {},
  "output": {},
  "metadata": {},
  "status": "SUCCESS",
  "type": "STANDALONE",
  "application_interaction_id": "<string>",
  "application_variant_id": "<string>"
}'
{
  "id": "<string>",
  "object": "span",
  "created_by": {
    "id": "<string>",
    "object": "identity",
    "type": "user"
  },
  "name": "<string>",
  "trace_id": "<string>",
  "parent_id": "<string>",
  "group_id": "<string>",
  "start_timestamp": "2023-11-07T05:31:56Z",
  "end_timestamp": "2023-11-07T05:31:56Z",
  "input": {},
  "output": {},
  "metadata": {},
  "status": "SUCCESS",
  "type": "STANDALONE",
  "application_interaction_id": "<string>",
  "application_variant_id": "<string>",
  "account_id": "<string>"
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Body

application/json
name
string
required
trace_id
string
required

id for grouping traces together, uuid is recommended

Maximum length: 38
start_timestamp
string<date-time>
required
id
string

The id of the span

parent_id
string

Reference to a parent span_id

group_id
string

Reference to a group_id

end_timestamp
string<date-time>
input
object
output
object
metadata
object
status
enum<string>
Available options:
SUCCESS,
ERROR,
CANCELED
type
enum<string>
Available options:
TEXT_INPUT,
TEXT_OUTPUT,
COMPLETION_INPUT,
COMPLETION,
KB_RETRIEVAL,
KB_INPUT,
RERANKING,
EXTERNAL_ENDPOINT,
PROMPT_ENGINEERING,
DOCUMENT_INPUT,
MAP_REDUCE,
DOCUMENT_SEARCH,
DOCUMENT_PROMPT,
CUSTOM,
CODE_EXECUTION,
DATA_MANIPULATION,
EVALUATION,
FILE_RETRIEVAL,
KB_ADD_CHUNK,
KB_MANAGEMENT,
GUARDRAIL,
TRACER,
AGENT_TRACER,
AGENT_WORKFLOW,
STANDALONE
application_interaction_id
string

The optional application interaction ID this span belongs to

application_variant_id
string

The optional application variant ID this span belongs to

Response

Successful Response

id
string
required
name
string
required
trace_id
string
required

id for grouping traces together, uuid is recommended

Maximum length: 38
start_timestamp
string<date-time>
required
account_id
string
required
object
enum<string>
default:span
Available options:
TitleConst
Objectspan
created_by
object

The identity that created the entity.

parent_id
string

Reference to a parent span_id

group_id
string

Reference to a group_id

end_timestamp
string<date-time>
input
object
output
object
metadata
object
status
enum<string>
Available options:
SUCCESS,
ERROR,
CANCELED
type
enum<string>
Available options:
TEXT_INPUT,
TEXT_OUTPUT,
COMPLETION_INPUT,
COMPLETION,
KB_RETRIEVAL,
KB_INPUT,
RERANKING,
EXTERNAL_ENDPOINT,
PROMPT_ENGINEERING,
DOCUMENT_INPUT,
MAP_REDUCE,
DOCUMENT_SEARCH,
DOCUMENT_PROMPT,
CUSTOM,
CODE_EXECUTION,
DATA_MANIPULATION,
EVALUATION,
FILE_RETRIEVAL,
KB_ADD_CHUNK,
KB_MANAGEMENT,
GUARDRAIL,
TRACER,
AGENT_TRACER,
AGENT_WORKFLOW,
STANDALONE
application_interaction_id
string

The interaction ID this span belongs to

application_variant_id
string

The id of the application variant this span belongs to