{"openapi":"3.1.0","info":{"title":"LangWatch API","description":"LangWatch openapi spec","version":"1.0.0"},"servers":[{"url":"https://app.langwatch.ai"}],"security":[{"project_api_key":[]}],"components":{"securitySchemes":{"project_api_key":{"type":"apiKey","in":"header","name":"X-Auth-Token","description":"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."},"admin_api_key":{"type":"http","scheme":"bearer","description":"Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}."},"scim_bearer":{"type":"http","scheme":"bearer","description":"SCIM token for one organization's directory connection, created with POST /api/scim-tokens or in Settings > SCIM. It authenticates provisioning calls only, and stops working if the organization's Enterprise plan lapses."},"cli_access_token":{"type":"http","scheme":"bearer","description":"The device session the LangWatch CLI holds after `langwatch login`. It acts as the person who signed in, in the organization they chose, and expires unless the CLI refreshes it."},"instance_admin_key":{"type":"http","scheme":"bearer","description":"Instance administrator key, set as LANGWATCH_INSTANCE_ADMIN_API_KEY on a self-hosted deployment. It exists to create the first organization, before any organization key does; every other management API takes an organization key instead."},"internal_secret":{"type":"http","scheme":"bearer","description":"The deployment's own shared secret, presented by another LangWatch service rather than by a customer. The families behind it are ingress-blocked; they are described so a self-hosted operator can see what the deployment talks to itself about."}},"schemas":{"DatasetPostEntries":{"type":"object","properties":{"entries":{"minItems":1,"maxItems":4000,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"example":[{"input":"hi","output":"Hello, how can I help you today?"}]}},"required":["entries"]},"DatasetImport":{"type":"object","properties":{"name":{"type":"string","minLength":1},"storedObjectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]},"sourceHeader":{"type":"string"}},"required":["name","type","sourceHeader"]}}},"required":["name","storedObjectId"]},"DatasetAppendImport":{"type":"object","properties":{"storedObjectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}},"required":["storedObjectId"]},"DatasetAttachment":{"type":"object","properties":{"url":{"type":"string","description":"The value to write into the cell, and the address the file is served from."},"name":{"type":"string","description":"The file name the reference carries."},"mediaType":{"type":"string","description":"The media type the file is stored under."},"sizeBytes":{"type":"number","description":"The size of the stored file, in bytes."}},"required":["url","name","mediaType","sizeBytes"],"additionalProperties":false},"SearchResponse":{"type":"object","properties":{"traces":{"type":"array","items":{"$ref":"#/components/schemas/Trace"}},"pagination":{"type":"object","properties":{"totalHits":{"type":"number"},"scrollId":{"type":["string","null"]}},"required":["totalHits"]}},"required":["traces","pagination"]},"Trace":{"type":"object","properties":{"trace_id":{"type":"string"},"project_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"privacy":{"type":"object","properties":{"droppedCategories":{"type":"array","items":{"type":"string"}}}},"timestamps":{"$ref":"#/components/schemas/Timestamps"},"input":{"$ref":"#/components/schemas/Input"},"output":{"$ref":"#/components/schemas/Output"},"contexts":{"type":"array","items":{"type":"object","properties":{"document_id":{"type":["string","null"]},"chunk_id":{"type":["string","null"]},"content":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]}},"required":["content"]}},"expected_output":{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]},"metrics":{"$ref":"#/components/schemas/Metrics"},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"indexing_md5s":{"type":"array","items":{"type":"string"}},"events":{"type":"array","items":{"type":"object","properties":{"event_id":{"type":"string"},"event_type":{"type":"string"},"project_id":{"type":"string"},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"event_details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"trace_id":{"type":"string"},"timestamps":{"type":"object","properties":{"started_at":{"type":"number"},"inserted_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["started_at","inserted_at","updated_at"]}},"required":["event_id","event_type","project_id","metrics","event_details","trace_id","timestamps"]}},"evaluations":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}},"spans":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"span_id":{"type":"string"},"parent_id":{"type":["string","null"]},"trace_id":{"type":"string"},"type":{"type":"string","const":"llm"},"name":{"type":["string","null"]},"input":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"output":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"timestamps":{"type":"object","properties":{"ignore_timestamps_on_write":{"type":["boolean","null"]},"started_at":{"type":"number"},"first_token_at":{"type":["number","null"]},"finished_at":{"type":"number"}},"required":["started_at","finished_at"]},"metrics":{"anyOf":[{"type":"object","properties":{"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"reasoning_tokens":{"type":["number","null"]},"cache_read_input_tokens":{"type":["number","null"]},"cache_creation_input_tokens":{"type":["number","null"]},"tokens_estimated":{"type":["boolean","null"]},"cost":{"type":["number","null"]}}},{"type":"null"}]},"params":{"anyOf":[{"allOf":[{"type":"object","properties":{"frequency_penalty":{"type":["number","null"]},"logit_bias":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"type":["number","null"]},"max_tokens":{"type":["number","null"]},"n":{"type":["number","null"]},"presence_penalty":{"type":["number","null"]},"seed":{"type":["number","null"]},"stop":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},{"type":"null"}]},"stream":{"type":["boolean","null"]},"temperature":{"type":["number","null"]},"top_p":{"type":["number","null"]},"tools":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"tool_choice":{"anyOf":[{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"string"}]},{"type":"null"}]},"parallel_tool_calls":{"type":["boolean","null"]},"functions":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"user":{"type":["string","null"]},"reasoning_effort":{"type":["string","null"]}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},{"type":"null"}]},"vendor":{"type":["string","null"]},"model":{"type":["string","null"]}},"required":["span_id","trace_id","type","timestamps"]},{"type":"object","properties":{"span_id":{"type":"string"},"parent_id":{"type":["string","null"]},"trace_id":{"type":"string"},"type":{"type":"string","const":"rag"},"name":{"type":["string","null"]},"input":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"output":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"timestamps":{"type":"object","properties":{"ignore_timestamps_on_write":{"type":["boolean","null"]},"started_at":{"type":"number"},"first_token_at":{"type":["number","null"]},"finished_at":{"type":"number"}},"required":["started_at","finished_at"]},"metrics":{"anyOf":[{"type":"object","properties":{"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"reasoning_tokens":{"type":["number","null"]},"cache_read_input_tokens":{"type":["number","null"]},"cache_creation_input_tokens":{"type":["number","null"]},"tokens_estimated":{"type":["boolean","null"]},"cost":{"type":["number","null"]}}},{"type":"null"}]},"params":{"anyOf":[{"allOf":[{"type":"object","properties":{"frequency_penalty":{"type":["number","null"]},"logit_bias":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"type":["number","null"]},"max_tokens":{"type":["number","null"]},"n":{"type":["number","null"]},"presence_penalty":{"type":["number","null"]},"seed":{"type":["number","null"]},"stop":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},{"type":"null"}]},"stream":{"type":["boolean","null"]},"temperature":{"type":["number","null"]},"top_p":{"type":["number","null"]},"tools":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"tool_choice":{"anyOf":[{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"string"}]},{"type":"null"}]},"parallel_tool_calls":{"type":["boolean","null"]},"functions":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"user":{"type":["string","null"]},"reasoning_effort":{"type":["string","null"]}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},{"type":"null"}]},"contexts":{"type":"array","items":{"type":"object","properties":{"document_id":{"type":["string","null"]},"chunk_id":{"type":["string","null"]},"content":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]}},"required":["content"]}}},"required":["span_id","trace_id","type","timestamps","contexts"]},{"type":"object","properties":{"span_id":{"type":"string"},"parent_id":{"type":["string","null"]},"trace_id":{"type":"string"},"type":{"anyOf":[{"type":"string","const":"span"},{"type":"string","const":"llm"},{"type":"string","const":"chain"},{"type":"string","const":"tool"},{"type":"string","const":"agent"},{"type":"string","const":"rag"},{"type":"string","const":"guardrail"},{"type":"string","const":"evaluation"},{"type":"string","const":"workflow"},{"type":"string","const":"component"},{"type":"string","const":"module"},{"type":"string","const":"server"},{"type":"string","const":"client"},{"type":"string","const":"producer"},{"type":"string","const":"consumer"},{"type":"string","const":"task"},{"type":"string","const":"unknown"}]},"name":{"type":["string","null"]},"input":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"output":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"timestamps":{"type":"object","properties":{"ignore_timestamps_on_write":{"type":["boolean","null"]},"started_at":{"type":"number"},"first_token_at":{"type":["number","null"]},"finished_at":{"type":"number"}},"required":["started_at","finished_at"]},"metrics":{"anyOf":[{"type":"object","properties":{"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"reasoning_tokens":{"type":["number","null"]},"cache_read_input_tokens":{"type":["number","null"]},"cache_creation_input_tokens":{"type":["number","null"]},"tokens_estimated":{"type":["boolean","null"]},"cost":{"type":["number","null"]}}},{"type":"null"}]},"params":{"anyOf":[{"allOf":[{"type":"object","properties":{"frequency_penalty":{"type":["number","null"]},"logit_bias":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"type":["number","null"]},"max_tokens":{"type":["number","null"]},"n":{"type":["number","null"]},"presence_penalty":{"type":["number","null"]},"seed":{"type":["number","null"]},"stop":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},{"type":"null"}]},"stream":{"type":["boolean","null"]},"temperature":{"type":["number","null"]},"top_p":{"type":["number","null"]},"tools":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"tool_choice":{"anyOf":[{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"string"}]},{"type":"null"}]},"parallel_tool_calls":{"type":["boolean","null"]},"functions":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"user":{"type":["string","null"]},"reasoning_effort":{"type":["string","null"]}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},{"type":"null"}]}},"required":["span_id","trace_id","type","timestamps"]}]}},"redacted_by_visibility_window":{"type":"boolean"}},"required":["trace_id","project_id","metadata","timestamps","spans"]},"Metadata":{"allOf":[{"type":"object","properties":{"thread_id":{"type":["string","null"]},"user_id":{"type":["string","null"]},"customer_id":{"type":["string","null"]},"labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"topic_id":{"type":["string","null"]},"subtopic_id":{"type":["string","null"]},"sdk_name":{"type":["string","null"]},"sdk_version":{"type":["string","null"]},"sdk_language":{"type":["string","null"]},"telemetry_sdk_language":{"type":["string","null"]},"telemetry_sdk_name":{"type":["string","null"]},"telemetry_sdk_version":{"type":["string","null"]},"prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"prompt_version_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{}]},{"type":"null"}]},{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{}]},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{}]},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{}]},{"type":"null"}]}}}]}}]},"Timestamps":{"type":"object","properties":{"started_at":{"type":"number"},"inserted_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["started_at","inserted_at","updated_at"]},"Input":{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]},"Output":{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]},"Metrics":{"type":"object","properties":{"first_token_ms":{"type":["number","null"]},"total_time_ms":{"type":["number","null"]},"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"reasoning_tokens":{"type":["number","null"]},"cache_read_input_tokens":{"type":["number","null"]},"cache_creation_input_tokens":{"type":["number","null"]},"cache_creation_5m_input_tokens":{"type":["number","null"]},"cache_creation_1h_input_tokens":{"type":["number","null"]},"context_size_tokens":{"type":["number","null"]},"total_cost":{"type":["number","null"]},"tokens_estimated":{"type":["boolean","null"]}}},"Evaluation":{"type":"object","properties":{"evaluation_id":{"type":"string"},"evaluator_id":{"type":"string"},"span_id":{"type":["string","null"]},"name":{"type":"string"},"type":{"type":["string","null"]},"is_guardrail":{"type":["boolean","null"]},"evaluation_thread_id":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","const":"scheduled"},{"type":"string","const":"in_progress"},{"type":"string","const":"error"},{"type":"string","const":"skipped"},{"type":"string","const":"processed"}]},"passed":{"type":["boolean","null"]},"score":{"type":["number","null"]},"label":{"type":["string","null"]},"details":{"type":["string","null"]},"inputs":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"retries":{"type":["number","null"]},"timestamps":{"$ref":"#/components/schemas/EvaluationTimestamps"}},"required":["evaluation_id","evaluator_id","name","status","timestamps"]},"EvaluationTimestamps":{"type":"object","properties":{"ignore_timestamps_on_write":{"type":["boolean","null"]},"inserted_at":{"type":["number","null"]},"started_at":{"type":["number","null"]},"finished_at":{"type":["number","null"]},"updated_at":{"type":["number","null"]}}},"SpanInputOutput":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"value":{"type":"string"}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"chat_messages"},"value":{"type":"array","items":{"type":"object","properties":{"role":{"anyOf":[{"type":"string","const":"system"},{"type":"string","const":"developer"},{"type":"string","const":"user"},{"type":"string","const":"assistant"},{"type":"string","const":"function"},{"type":"string","const":"tool"},{"type":"string","const":"unknown"}]},"content":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"content":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"anyOf":[{"type":"string","const":"auto"},{"type":"string","const":"low"},{"type":"string","const":"high"}]}},"required":["url"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_call"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"args":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_result"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"result":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool-call"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"input":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool-result"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"output":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"binary"},"mimeType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"id":{"type":"string"},"filename":{"type":"string"}},"required":["type","mimeType"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"id":{"type":"string"}}}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","const":"audio"},"source":{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"url"},{"type":"string","const":"data"}]},"value":{"type":"string"},"mimeType":{"type":"string"}},"required":["type","value"]}},"required":["type","source"]},{"type":"object","properties":{"type":{"type":"string","const":"image"},"image":{"type":"string"},"mediaType":{"type":"string"}},"required":["type","image"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"mediaType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"filename":{"type":"string"}},"required":["type","mediaType"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file":{"type":"object","properties":{"file_data":{"type":"string"},"file_id":{"type":"string"},"filename":{"type":"string"}}}},"required":["type","file"]}]}}]},{"type":"null"}]},"parts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"content":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"anyOf":[{"type":"string","const":"auto"},{"type":"string","const":"low"},{"type":"string","const":"high"}]}},"required":["url"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_call"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"args":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_result"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"result":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool-call"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"input":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool-result"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"output":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"binary"},"mimeType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"id":{"type":"string"},"filename":{"type":"string"}},"required":["type","mimeType"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"id":{"type":"string"}}}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","const":"audio"},"source":{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"url"},{"type":"string","const":"data"}]},"value":{"type":"string"},"mimeType":{"type":"string"}},"required":["type","value"]}},"required":["type","source"]},{"type":"object","properties":{"type":{"type":"string","const":"image"},"image":{"type":"string"},"mediaType":{"type":"string"}},"required":["type","image"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"mediaType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"filename":{"type":"string"}},"required":["type","mediaType"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file":{"type":"object","properties":{"file_data":{"type":"string"},"file_id":{"type":"string"},"filename":{"type":"string"}}}},"required":["type","file"]}]}},"function_call":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}}},{"type":"null"}]},"tool_calls":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}}}},"required":["id","type","function"]}},{"type":"null"}]},"tool_call_id":{"type":["string","null"]},"name":{"type":["string","null"]},"reasoning_content":{"type":["string","null"]}}}}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"guardrail_result"},"value":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","const":"processed"},{"type":"string","const":"skipped"},{"type":"string","const":"error"}]},"passed":{"type":["boolean","null"]},"score":{"type":["number","null"]},"label":{"type":["string","null"]},"details":{"type":["string","null"]},"cost":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},{"type":"null"}]}},"required":["status"]}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"evaluation_result"},"value":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","const":"processed"},{"type":"string","const":"skipped"},{"type":"string","const":"error"}]},"passed":{"type":["boolean","null"]},"score":{"type":["number","null"]},"label":{"type":["string","null"]},"details":{"type":["string","null"]},"cost":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},{"type":"null"}]}},"required":["status"]}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"json"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"raw"},"value":{"type":"string"}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"list"},"value":{"type":"array","items":{"$ref":"#/components/schemas/SpanInputOutput"}}},"required":["type","value"]}]},"Annotation":{"type":"object","properties":{"id":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"traceId":{"type":"string","minLength":1},"userId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"email":{"type":["string","null"]},"comment":{"type":["string","null"]},"isThumbsUp":{"type":["boolean","null"]},"scoreOptions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"expectedOutput":{"type":["string","null"]},"anchorKind":{"type":["string","null"]},"anchorId":{"type":["string","null"]},"anchorPath":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","traceId","userId","email","comment","isThumbsUp","scoreOptions","expectedOutput","anchorKind","anchorId","anchorPath","createdAt","updatedAt"],"additionalProperties":{}},"JsonValue":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/JsonValue"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}}]},"ApiKeyInfo":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"description":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"roleBindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["id","role","scopeType","scopeId"],"additionalProperties":false}}},"required":["id","name","description","createdAt","expiresAt","lastUsedAt","revokedAt","roleBindings"],"additionalProperties":false},"Project":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"language":{"type":"string"},"framework":{"type":"string"},"teamId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"piiRedactionLevel":{"type":"string","enum":["STRICT","ESSENTIAL","DISABLED"]}},"required":["id","name","slug","language","framework","teamId","createdAt","updatedAt"],"additionalProperties":false},"Pagination":{"type":"object","properties":{"page":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["page","limit","total"],"additionalProperties":false},"AgUiToolCall":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"additionalProperties":{}},"encryptedValue":{"type":"string"}},"additionalProperties":{}},"SearchRequest":{"type":"object","properties":{"query":{"type":"string"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["topics.topics","topics.subtopics","metadata.user_id","metadata.thread_id","metadata.customer_id","metadata.labels","metadata.key","metadata.value","metadata.prompt_ids","traces.origin","traces.error","traces.name","spans.type","spans.model","evaluations.evaluator_id","evaluations.evaluator_id.guardrails_only","evaluations.evaluator_id.has_passed","evaluations.evaluator_id.has_score","evaluations.evaluator_id.has_label","evaluations.passed","evaluations.score","evaluations.state","evaluations.label","events.event_type","events.metrics.key","events.metrics.value","events.event_details.key","annotations.hasAnnotation"]},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"properties":{"topics.topics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"topics.subtopics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.user_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.thread_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.customer_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.origin":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.error":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.name":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.model":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.guardrails_only":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.state":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_details.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"annotations.hasAnnotation":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}}},"traceIds":{"type":"array","items":{"type":"string"}},"negateFilters":{"type":"boolean"},"excludeOrigins":{"type":"array","items":{"type":"string"}},"pageOffset":{"description":"Removed. Offset pagination is no longer supported and any value other than 0 is rejected. Page with the scrollId returned by the previous response instead. The field remains on the schema so that sending it produces an explanatory error rather than being silently discarded.","type":"number"},"pageSize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"groupBy":{"type":"string"},"sortBy":{"type":"string"},"sortDirection":{"type":"string"},"updatedAt":{"type":"number"},"scrollId":{"type":["string","null"]},"startDate":{"type":["number","string"]},"endDate":{"type":["number","string"]},"format":{"type":"string","enum":["digest","json"]},"llmMode":{"default":false,"type":"boolean"}},"required":["startDate","endDate"],"additionalProperties":false}}},"paths":{"/api/v1/agents":{"get":{"operationId":"listAgents","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"],"description":"The kind of agent. A connected agent is registered from code by the SDK and cannot be created or reconfigured through this API."},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"environment":{"description":"The environment a connected agent registered with, for example production or development. Null for every other kind.","type":["string","null"]},"ownerUserId":{"description":"The user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.","type":["string","null"]},"hostLabel":{"description":"The machine a development agent registered from with a project or service key. Null when the agent is personal or shared.","type":["string","null"]},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When an instance of a connected agent was last connected. Null for every other kind."},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultValue":{"type":["string","number","boolean"]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"type":"array","items":{"type":["string","number","boolean"]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false},"description":"The run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind."},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}],"description":"The person a personal development agent belongs to. Null when the agent is shared or host-scoped."},"status":{"type":"string","enum":["online","offline"],"description":"online while at least one process running the connected agent is connected; offline otherwise, and always for every other kind."},"instances":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string"},"hostname":{"type":"string"},"username":{"type":"string"},"pid":{"type":"number"},"label":{"type":["string","null"]},"sdk":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"language":{"type":"string"}},"required":["name","version","language"],"additionalProperties":false},"connectedAt":{"type":"string","format":"date-time"},"inflight":{"type":"number"},"maxConcurrency":{"type":"number"}},"required":["instanceId","hostname","username","pid","label","sdk","connectedAt","inflight","maxConcurrency"],"additionalProperties":false},"description":"The processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind."},"selectable":{"type":"boolean","description":"Whether the credential making this request can run simulations against the agent. False for a personal development agent that belongs to somebody else, which is listed all the same so it can be told apart from the other agents of the same name."},"notSelectableReason":{"anyOf":[{"type":"string","enum":["owned_by_another_person"]},{"type":"null"}],"description":"Why the agent cannot be run by this credential. Null when it can."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","type","config","environment","ownerUserId","hostLabel","lastSeenAt","parameters","owner","status","instances","selectable","notSelectableReason","createdAt","updatedAt","platformUrl"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}}},"summary":"List agents with their current presence and owner","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]},"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":1000}}]},"post":{"operationId":"createAgent","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"],"description":"The kind of agent. A connected agent is registered from code by the SDK and cannot be created or reconfigured through this API."},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"environment":{"description":"The environment a connected agent registered with, for example production or development. Null for every other kind.","type":["string","null"]},"ownerUserId":{"description":"The user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.","type":["string","null"]},"hostLabel":{"description":"The machine a development agent registered from with a project or service key. Null when the agent is personal or shared.","type":["string","null"]},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When an instance of a connected agent was last connected. Null for every other kind."},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultValue":{"type":["string","number","boolean"]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"type":"array","items":{"type":["string","number","boolean"]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false},"description":"The run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind."},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}],"description":"The person a personal development agent belongs to. Null when the agent is shared or host-scoped."},"status":{"type":"string","enum":["online","offline"],"description":"online while at least one process running the connected agent is connected; offline otherwise, and always for every other kind."},"instances":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string"},"hostname":{"type":"string"},"username":{"type":"string"},"pid":{"type":"number"},"label":{"type":["string","null"]},"sdk":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"language":{"type":"string"}},"required":["name","version","language"],"additionalProperties":false},"connectedAt":{"type":"string","format":"date-time"},"inflight":{"type":"number"},"maxConcurrency":{"type":"number"}},"required":["instanceId","hostname","username","pid","label","sdk","connectedAt","inflight","maxConcurrency"],"additionalProperties":false},"description":"The processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind."},"selectable":{"type":"boolean","description":"Whether the credential making this request can run simulations against the agent. False for a personal development agent that belongs to somebody else, which is listed all the same so it can be told apart from the other agents of the same name."},"notSelectableReason":{"anyOf":[{"type":"string","enum":["owned_by_another_person"]},{"type":"null"}],"description":"Why the agent cannot be run by this credential. Null when it can."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","type","config","environment","ownerUserId","hostLabel","lastSeenAt","parameters","owner","status","instances","selectable","notSelectableReason","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"summary":"Create an authored agent; connected agents register through the SDK","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:update"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"workflowId":{"type":"string"},"copiedFromAgentId":{"type":"string"},"type":{"type":"string","const":"signature"},"config":{"type":"object","properties":{"_library_ref":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"cls":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"inputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"isCustom":{"type":"boolean"},"behave_as":{"type":"string","const":"evaluator"},"configId":{"type":"string"},"handle":{"type":["string","null"]},"versionMetadata":{"type":"object","properties":{"versionId":{"type":"string"},"versionNumber":{"type":"number"},"versionCreatedAt":{"type":"string"}},"required":["versionId","versionNumber","versionCreatedAt"]},"llm":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"type":"number"},"max_tokens":{"type":"number"},"top_p":{"type":"number"},"frequency_penalty":{"type":"number"},"presence_penalty":{"type":"number"},"seed":{"type":"number"},"top_k":{"type":"number"},"min_p":{"type":"number"},"repetition_penalty":{"type":"number"},"reasoning":{"type":"string"},"reasoning_effort":{"type":"string"},"thinkingLevel":{"type":"string"},"effort":{"type":"string"},"verbosity":{"type":"string"},"litellm_params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["model"]},"prompt":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}}}},"promptDraft":{"type":"boolean"}}}},"required":["name","type","config"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"workflowId":{"type":"string"},"copiedFromAgentId":{"type":"string"},"type":{"type":"string","const":"code"},"config":{"type":"object","properties":{"_library_ref":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"cls":{"type":"string"},"parameters":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"identifier":{"type":"string","const":"code"},"type":{"type":"string","const":"code"},"value":{"type":"string"},"optional":{"type":"boolean"},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"}},"required":["identifier","type","value"]},{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}]}},"inputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"isCustom":{"type":"boolean"},"behave_as":{"type":"string","const":"evaluator"},"timeoutMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"]},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"]}]}},"scenarioOutputField":{"type":"string"}},"required":["parameters"]}},"required":["name","type","config"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"workflowId":{"type":"string"},"copiedFromAgentId":{"type":"string"},"type":{"type":"string","const":"workflow"},"config":{"type":"object","properties":{"_library_ref":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"cls":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"inputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"isCustom":{"type":"boolean"},"behave_as":{"type":"string","const":"evaluator"},"workflow_id":{"type":"string"},"publishedId":{"type":"string"},"version_id":{"type":"string"},"versions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"workflowFields":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"outputFields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"fieldsResolved":{"type":"boolean"},"recordedAt":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputFields","outputFields","fieldsResolved","recordedAt"]},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"]},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"]}]}},"scenarioOutputField":{"type":"string"}}}},"required":["name","type","config"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"workflowId":{"type":"string"},"copiedFromAgentId":{"type":"string"},"type":{"type":"string","const":"http"},"config":{"type":"object","properties":{"_library_ref":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"cls":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"inputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string","enum":["str","image","file","float","int","bool","list","list[str]","list[float]","list[int]","list[bool]","dict","json_schema","chat_messages","signature","llm","prompting_technique","dataset","code"]},"optional":{"type":"boolean"},"value":{},"desc":{"type":"string"},"prefix":{"type":"string"},"hidden":{"type":"boolean"},"json_schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["identifier","type"]}},"isCustom":{"type":"boolean"},"behave_as":{"type":"string","const":"evaluator"},"url":{"type":"string","minLength":1},"method":{"default":"POST","type":"string","enum":["GET","POST","PUT","DELETE","PATCH"]},"headers":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"]}},"auth":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"bearer"},"token":{"type":"string"}},"required":["type","token"]},{"type":"object","properties":{"type":{"type":"string","const":"api_key"},"header":{"type":"string"},"value":{"type":"string"}},"required":["type","header","value"]},{"type":"object","properties":{"type":{"type":"string","const":"basic"},"username":{"type":"string"},"password":{"type":"string"}},"required":["type","username","password"]}]},"bodyTemplate":{"type":"string"},"outputPath":{"type":"string"},"sessionPath":{"type":"string"},"timeoutMs":{"type":"number","exclusiveMinimum":0},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"]},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"]}]}},"devTunnel":{"type":"object","properties":{"previousUrl":{"type":"string"},"connectedAt":{"type":"string"},"heartbeatAt":{"type":"string"}}}},"required":["url"]}},"required":["name","type","config"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"workflowId":{"type":"string"},"copiedFromAgentId":{"type":"string"},"type":{"type":"string","const":"connected"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","type","config"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"workflowId":{"type":"string"},"copiedFromAgentId":{"type":"string"},"type":{"type":"string","const":"voice"},"config":{"oneOf":[{"type":"object","properties":{"transport":{"type":"string","const":"elevenlabs_convai"},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["transport","agentId"]},{"type":"object","properties":{"transport":{"type":"string","const":"phone"},"phoneNumber":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callDirection":{"default":"outbound","type":"string","enum":["inbound","outbound"]}},"required":["transport","phoneNumber"]}]}},"required":["name","type","config"]}]}}}}}},"/api/v1/agents/{id}":{"get":{"operationId":"getAgent","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"],"description":"The kind of agent. A connected agent is registered from code by the SDK and cannot be created or reconfigured through this API."},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"environment":{"description":"The environment a connected agent registered with, for example production or development. Null for every other kind.","type":["string","null"]},"ownerUserId":{"description":"The user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.","type":["string","null"]},"hostLabel":{"description":"The machine a development agent registered from with a project or service key. Null when the agent is personal or shared.","type":["string","null"]},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When an instance of a connected agent was last connected. Null for every other kind."},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultValue":{"type":["string","number","boolean"]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"type":"array","items":{"type":["string","number","boolean"]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false},"description":"The run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind."},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}],"description":"The person a personal development agent belongs to. Null when the agent is shared or host-scoped."},"status":{"type":"string","enum":["online","offline"],"description":"online while at least one process running the connected agent is connected; offline otherwise, and always for every other kind."},"instances":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string"},"hostname":{"type":"string"},"username":{"type":"string"},"pid":{"type":"number"},"label":{"type":["string","null"]},"sdk":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"language":{"type":"string"}},"required":["name","version","language"],"additionalProperties":false},"connectedAt":{"type":"string","format":"date-time"},"inflight":{"type":"number"},"maxConcurrency":{"type":"number"}},"required":["instanceId","hostname","username","pid","label","sdk","connectedAt","inflight","maxConcurrency"],"additionalProperties":false},"description":"The processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind."},"selectable":{"type":"boolean","description":"Whether the credential making this request can run simulations against the agent. False for a personal development agent that belongs to somebody else, which is listed all the same so it can be told apart from the other agents of the same name."},"notSelectableReason":{"anyOf":[{"type":"string","enum":["owned_by_another_person"]},{"type":"null"}],"description":"Why the agent cannot be run by this credential. Null when it can."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","type","config","environment","ownerUserId","hostLabel","lastSeenAt","parameters","owner","status","instances","selectable","notSelectableReason","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"summary":"Get an agent in the caller's project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The agent id."}]},"patch":{"operationId":"updateAgent","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"],"description":"The kind of agent. A connected agent is registered from code by the SDK and cannot be created or reconfigured through this API."},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"environment":{"description":"The environment a connected agent registered with, for example production or development. Null for every other kind.","type":["string","null"]},"ownerUserId":{"description":"The user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.","type":["string","null"]},"hostLabel":{"description":"The machine a development agent registered from with a project or service key. Null when the agent is personal or shared.","type":["string","null"]},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When an instance of a connected agent was last connected. Null for every other kind."},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultValue":{"type":["string","number","boolean"]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"type":"array","items":{"type":["string","number","boolean"]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false},"description":"The run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind."},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}],"description":"The person a personal development agent belongs to. Null when the agent is shared or host-scoped."},"status":{"type":"string","enum":["online","offline"],"description":"online while at least one process running the connected agent is connected; offline otherwise, and always for every other kind."},"instances":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string"},"hostname":{"type":"string"},"username":{"type":"string"},"pid":{"type":"number"},"label":{"type":["string","null"]},"sdk":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"language":{"type":"string"}},"required":["name","version","language"],"additionalProperties":false},"connectedAt":{"type":"string","format":"date-time"},"inflight":{"type":"number"},"maxConcurrency":{"type":"number"}},"required":["instanceId","hostname","username","pid","label","sdk","connectedAt","inflight","maxConcurrency"],"additionalProperties":false},"description":"The processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind."},"selectable":{"type":"boolean","description":"Whether the credential making this request can run simulations against the agent. False for a personal development agent that belongs to somebody else, which is listed all the same so it can be told apart from the other agents of the same name."},"notSelectableReason":{"anyOf":[{"type":"string","enum":["owned_by_another_person"]},{"type":"null"}],"description":"Why the agent cannot be run by this credential. Null when it can."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","type","config","environment","ownerUserId","hostLabel","lastSeenAt","parameters","owner","status","instances","selectable","notSelectableReason","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"summary":"Update an authored agent","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"workflowId":{"type":["string","null"]}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The agent id."}]},"put":{"operationId":"replaceAgent","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"],"description":"The kind of agent. A connected agent is registered from code by the SDK and cannot be created or reconfigured through this API."},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"environment":{"description":"The environment a connected agent registered with, for example production or development. Null for every other kind.","type":["string","null"]},"ownerUserId":{"description":"The user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.","type":["string","null"]},"hostLabel":{"description":"The machine a development agent registered from with a project or service key. Null when the agent is personal or shared.","type":["string","null"]},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When an instance of a connected agent was last connected. Null for every other kind."},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultValue":{"type":["string","number","boolean"]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"type":"array","items":{"type":["string","number","boolean"]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false},"description":"The run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind."},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}],"description":"The person a personal development agent belongs to. Null when the agent is shared or host-scoped."},"status":{"type":"string","enum":["online","offline"],"description":"online while at least one process running the connected agent is connected; offline otherwise, and always for every other kind."},"instances":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string"},"hostname":{"type":"string"},"username":{"type":"string"},"pid":{"type":"number"},"label":{"type":["string","null"]},"sdk":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"language":{"type":"string"}},"required":["name","version","language"],"additionalProperties":false},"connectedAt":{"type":"string","format":"date-time"},"inflight":{"type":"number"},"maxConcurrency":{"type":"number"}},"required":["instanceId","hostname","username","pid","label","sdk","connectedAt","inflight","maxConcurrency"],"additionalProperties":false},"description":"The processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind."},"selectable":{"type":"boolean","description":"Whether the credential making this request can run simulations against the agent. False for a personal development agent that belongs to somebody else, which is listed all the same so it can be told apart from the other agents of the same name."},"notSelectableReason":{"anyOf":[{"type":"string","enum":["owned_by_another_person"]},{"type":"null"}],"description":"Why the agent cannot be run by this credential. Null when it can."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","type","config","environment","ownerUserId","hostLabel","lastSeenAt","parameters","owner","status","instances","selectable","notSelectableReason","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"summary":"Update an authored agent; PUT retains partial update semantics","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"workflowId":{"type":["string","null"]}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The agent id."}]},"delete":{"operationId":"archiveAgent","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["signature","code","workflow","http","connected","voice"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","type","archivedAt"],"additionalProperties":false}}}}},"summary":"Archive an agent while keeping its runs","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:delete"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The agent id."}]}},"/api/v1/agents/{id}/call":{"post":{"operationId":"callConnectedAgent","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"output":{"anyOf":[{"type":"string"},{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}}}],"description":"What the function answered: text, one message, or a list of messages."},"session":{"description":"The agent's per-conversation memory, to send on the next turn."},"instance":{"type":"object","properties":{"hostname":{"type":"string"},"label":{"type":["string","null"]}},"required":["hostname","label"],"additionalProperties":false},"durationMs":{"type":"number"}},"required":["output","instance","durationMs"],"additionalProperties":false}}}}},"summary":"Send one conversation turn to an online connected agent","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The agent id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}},"description":"The whole conversation so far, OpenAI style."},"newMessages":{"description":"The messages added since the agent's last turn. Defaults to the last message.","type":"array","items":{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}}},"threadId":{"description":"The conversation id. Turns of one conversation share it; a new id starts a new one.","type":"string","maxLength":255},"params":{"description":"Run parameter values by name, as JSON scalars.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":["string","number","boolean"]}},"session":{"description":"The session the agent returned on its previous turn of this conversation, echoed back as is."},"traceparent":{"description":"The W3C trace context the agent adopts, so its spans join this turn's trace.","type":"string","maxLength":255},"run":{"description":"The simulation run this turn belongs to, if any.","type":"object","properties":{"scenarioRunId":{"type":"string"},"scenarioName":{"type":"string"},"batchRunId":{"type":"string"}}}},"required":["messages"]}}}}}},"/api/v1/agents/connect/register":{"post":{"operationId":"registerConnectedAgentInstance","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"frame":{"anyOf":[{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"registered"},"agents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"environment":{"type":"string"},"id":{"type":"string"},"url":{"type":"string"},"parameterNotes":{"type":"array","items":{"type":"string"}},"scope":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"shared"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"owner"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"host"},"hostLabel":{"type":"string"}},"required":["kind","hostLabel"],"additionalProperties":false}]}},"required":["name","environment","id","url","parameterNotes","scope"],"additionalProperties":false}},"heartbeatIntervalMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"instanceId":{"type":"string"}},"required":["protocol","type","agents","heartbeatIntervalMs","instanceId"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"refused"},"code":{"type":"string","enum":["api_key_invalid","project_required","permission_denied","key_type_not_allowed","replica_count_unsupported","parameters_invalid","environment_invalid","protocol_invalid"]},"message":{"type":"string"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["protocol","type","code","message"],"additionalProperties":false}]},"instanceToken":{"type":"string"}},"required":["frame"],"additionalProperties":false}}}}},"description":"Returns a registered frame and instance token, or refuses at the status of the reason.","summary":"Register this process's agents","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"register"},"sdk":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"version":{"type":"string","minLength":1,"maxLength":64},"language":{"type":"string","minLength":1,"maxLength":32}},"required":["name","version","language"]},"instance":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"hostname":{"type":"string","maxLength":255},"username":{"type":"string","maxLength":255},"pid":{"type":"integer","minimum":0,"maximum":9007199254740991},"startedAt":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":128},"inFlightCallIds":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","maxLength":128}},"maxConcurrency":{"type":"integer","exclusiveMinimum":0,"maximum":1000}},"required":["id","hostname","username","pid","startedAt"]},"agents":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"environment":{"type":"string","minLength":1,"maxLength":64},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"concurrency":{"type":"integer","exclusiveMinimum":0,"maximum":1000},"timeoutMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sticky":{"type":"boolean"}},"required":["name","environment"]}}},"required":["protocol","type","sdk","instance","agents"]}}}}}},"/api/v1/agents/connect/poll":{"get":{"operationId":"pollConnectedAgentInstance","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"frames":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"call"},"callId":{"type":"string"},"agentId":{"type":"string"},"threadId":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}}},"newMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}}},"params":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":["string","number","boolean"]}},"session":{},"traceparent":{"type":["string","null"]},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run":{"type":"object","properties":{"scenarioRunId":{"type":"string"},"scenarioName":{"type":"string"},"batchRunId":{"type":"string"}},"additionalProperties":false}},"required":["protocol","type","callId","agentId","threadId","messages","newMessages","params","traceparent","deadlineAt","run"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"cancel"},"callId":{"type":"string","minLength":1}},"required":["protocol","type","callId"],"additionalProperties":false}]}}},"required":["frames"],"additionalProperties":false}}}}},"summary":"Wait for call and cancel frames while refreshing this instance's presence","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"parameters":[{"in":"query","name":"inFlight","schema":{"type":"string","maxLength":200000}}]}},"/api/v1/agents/connect/frames":{"post":{"operationId":"postConnectedAgentFrames","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["accepted"],"additionalProperties":false}}}}},"summary":"Accept this instance's acknowledgements, results and deregistration","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"frames":{"minItems":1,"maxItems":100,"type":"array","items":{"anyOf":[{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"ack"},"callId":{"type":"string","minLength":1}},"required":["protocol","type","callId"]},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"result"},"callId":{"type":"string","minLength":1},"output":{"anyOf":[{"type":"string"},{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","minLength":1}},"required":["role"],"additionalProperties":{}}}]},"session":{},"error":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64},"message":{"type":"string","maxLength":4000}},"required":["code","message"]}},"required":["protocol","type","callId"]},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"deregister"}},"required":["protocol","type"]}]}}},"required":["frames"]}}}}}},"/api/v1/analytics/timeseries":{"post":{"operationId":"postApiAnalyticsTimeseries","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"currentPeriod":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"previousPeriod":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["currentPeriod","previousPeriod"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Query analytics timeseries data with metrics, aggregations, and filters","tags":["Analytics"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":["number","string"]},"endDate":{"type":["number","string"]},"query":{"type":"string"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["topics.topics","topics.subtopics","metadata.user_id","metadata.thread_id","metadata.customer_id","metadata.labels","metadata.key","metadata.value","metadata.prompt_ids","traces.origin","traces.error","traces.name","spans.type","spans.model","evaluations.evaluator_id","evaluations.evaluator_id.guardrails_only","evaluations.evaluator_id.has_passed","evaluations.evaluator_id.has_score","evaluations.evaluator_id.has_label","evaluations.passed","evaluations.score","evaluations.state","evaluations.label","events.event_type","events.metrics.key","events.metrics.value","events.event_details.key","annotations.hasAnnotation"]},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"properties":{"topics.topics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"topics.subtopics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.user_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.thread_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.customer_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.origin":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.error":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.name":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.model":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.guardrails_only":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.state":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_details.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"annotations.hasAnnotation":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}}},"traceIds":{"type":"array","items":{"type":"string"}},"negateFilters":{"type":"boolean"},"excludeOrigins":{"type":"array","items":{"type":"string"}},"series":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","minLength":1},"key":{"type":"string"},"subkey":{"type":"string"},"aggregation":{"type":"string","enum":["terms","cardinality","avg","sum","min","max","median","p99","p95","p90"]},"pipeline":{"type":"object","properties":{"field":{"type":"string","enum":["trace_id","user_id","thread_id","customer_id"]},"aggregation":{"type":"string","enum":["sum","avg","min","max"]}},"required":["field","aggregation"]},"filters":{"type":"object","propertyNames":{"type":"string","enum":["topics.topics","topics.subtopics","metadata.user_id","metadata.thread_id","metadata.customer_id","metadata.labels","metadata.key","metadata.value","metadata.prompt_ids","traces.origin","traces.error","traces.name","spans.type","spans.model","evaluations.evaluator_id","evaluations.evaluator_id.guardrails_only","evaluations.evaluator_id.has_passed","evaluations.evaluator_id.has_score","evaluations.evaluator_id.has_label","evaluations.passed","evaluations.score","evaluations.state","evaluations.label","events.event_type","events.metrics.key","events.metrics.value","events.event_details.key","annotations.hasAnnotation"]},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"properties":{"topics.topics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"topics.subtopics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.user_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.thread_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.customer_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.origin":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.error":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.name":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.model":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.guardrails_only":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.state":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_details.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"annotations.hasAnnotation":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}}},"asPercent":{"type":"boolean"}},"required":["metric","aggregation"]}},"groupBy":{"type":"string","minLength":1},"groupByKey":{"type":"string"},"timeScale":{"anyOf":[{"type":"string","const":"full"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]},"timeZone":{"type":"string"},"shouldSkipPreviousPeriod":{"type":"boolean"}},"required":["startDate","endDate","series","timeZone"]}}}}}},"/api/v1/analytics":{"post":{"operationId":"postApiAnalytics","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"currentPeriod":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"previousPeriod":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["currentPeriod","previousPeriod"],"additionalProperties":false}}}},"400":{"description":"The body was not valid JSON, or failed validation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Set when the request was rejected before validation","type":"string"},"error":{"description":"Set when the body parsed and then failed validation","type":"string"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}},"description":"Query analytics timeseries with metrics, aggregations and filters. Identical to `POST /api/analytics/timeseries`, which is the path to use in new integrations; this one stays for callers written against it.","summary":"Query analytics timeseries (legacy path)","tags":["Analytics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":["number","string"]},"endDate":{"type":["number","string"]},"query":{"type":"string"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["topics.topics","topics.subtopics","metadata.user_id","metadata.thread_id","metadata.customer_id","metadata.labels","metadata.key","metadata.value","metadata.prompt_ids","traces.origin","traces.error","traces.name","spans.type","spans.model","evaluations.evaluator_id","evaluations.evaluator_id.guardrails_only","evaluations.evaluator_id.has_passed","evaluations.evaluator_id.has_score","evaluations.evaluator_id.has_label","evaluations.passed","evaluations.score","evaluations.state","evaluations.label","events.event_type","events.metrics.key","events.metrics.value","events.event_details.key","annotations.hasAnnotation"]},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"properties":{"topics.topics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"topics.subtopics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.user_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.thread_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.customer_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.origin":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.error":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.name":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.model":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.guardrails_only":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.state":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_details.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"annotations.hasAnnotation":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}}},"traceIds":{"type":"array","items":{"type":"string"}},"negateFilters":{"type":"boolean"},"excludeOrigins":{"type":"array","items":{"type":"string"}},"series":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","minLength":1},"key":{"type":"string"},"subkey":{"type":"string"},"aggregation":{"type":"string","enum":["terms","cardinality","avg","sum","min","max","median","p99","p95","p90"]},"pipeline":{"type":"object","properties":{"field":{"type":"string","enum":["trace_id","user_id","thread_id","customer_id"]},"aggregation":{"type":"string","enum":["sum","avg","min","max"]}},"required":["field","aggregation"]},"filters":{"type":"object","propertyNames":{"type":"string","enum":["topics.topics","topics.subtopics","metadata.user_id","metadata.thread_id","metadata.customer_id","metadata.labels","metadata.key","metadata.value","metadata.prompt_ids","traces.origin","traces.error","traces.name","spans.type","spans.model","evaluations.evaluator_id","evaluations.evaluator_id.guardrails_only","evaluations.evaluator_id.has_passed","evaluations.evaluator_id.has_score","evaluations.evaluator_id.has_label","evaluations.passed","evaluations.score","evaluations.state","evaluations.label","events.event_type","events.metrics.key","events.metrics.value","events.event_details.key","annotations.hasAnnotation"]},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"properties":{"topics.topics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"topics.subtopics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.user_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.thread_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.customer_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.origin":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.error":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.name":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.model":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.guardrails_only":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.state":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_details.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"annotations.hasAnnotation":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}}},"asPercent":{"type":"boolean"}},"required":["metric","aggregation"]}},"groupBy":{"type":"string","minLength":1},"groupByKey":{"type":"string"},"timeScale":{"anyOf":[{"type":"string","const":"full"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]},"timeZone":{"type":"string"},"shouldSkipPreviousPeriod":{"type":"boolean"}},"required":["startDate","endDate","series","timeZone"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]}}},"/api/v1/query":{"post":{"operationId":"postApiV1Query","responses":{"200":{"description":"The query ran. Columns, rows, execution statistics and diagnostics, scoped to the projects the key can read, or to the one project `projectId` names.","content":{"application/json":{"schema":{"type":"object","properties":{"columns":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"readOnly":true,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"statistics":{"type":"object","properties":{"elapsedMs":{"type":"number"},"rowsRead":{"type":"number"},"bytesRead":{"type":"number"},"rowsReturned":{"type":"number"}},"required":["elapsedMs","rowsRead","bytesRead","rowsReturned"],"additionalProperties":false},"diagnostics":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["MULTI_PROJECT_RESULT","POSSIBLE_FANOUT","UNBOUNDED_TIME_RANGE","MISSING_TIME_BUCKETS","INCOMPLETE_COMPARISON_PERIOD","APP_FUNCTION_VALUE_TRUNCATED","APP_FUNCTION_UNRESOLVED_KEYS","APP_FUNCTION_RESULT_TRUNCATED","INSTANT_EVAL_SKIPPED"]},"message":{"type":"string"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"],"additionalProperties":false}},"followsTimeWindow":{"type":"boolean"},"followsGranularity":{"type":"boolean"},"granularitySeconds":{"type":"number"},"coarsenedFromSeconds":{"type":"number"},"completeness":{"type":"object","properties":{"state":{"type":"string","enum":["complete","partial","missing","no_traffic"]},"unit":{"type":"string"},"total":{"type":"number"},"fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"label":{"type":"string"},"present":{"type":"number"}},"required":["field","label","present"]}},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"n":{"type":"number"}},"required":["start","n"]}},"unpriced":{"type":"object","properties":{"count":{"type":"number"},"models":{"type":"array","items":{"type":"string"}}},"required":["count","models"]}},"required":["state","unit","total","fields"]}},"required":["columns","rows","statistics","diagnostics","followsTimeWindow","followsGranularity"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Executes one read-only LangWatchQL SELECT over the analytics views and returns typed columns, rows, execution statistics and diagnostics. The query runs as a restricted database identity scoped to the projects this key can read.\n\nDiagnostics are advisory and never reject a query. An empty diagnostics list means no known issue was detected. It is not proof that the answer is the one you meant.\n\nA projection may call the app functions the schema endpoint lists (`conversation`, `llm_readable_trace`, `llm_messages`, and so on). Those are computed by the application after the query, so they are allowed only as aliased entries in the top-level SELECT list; a call in WHERE, GROUP BY, ORDER BY, a join, a subquery or a nested expression is refused, and a UNION disqualifies both of its branches even where each reads as a top-level projection. A projection may also call the eval functions, which judge a text with a model and are charged for; their key is the text itself. A run that would need more distinct conversations, traces, spans or texts than the published cap answers 422 rather than a partial result, and a run whose texts would exceed the per-query token budget answers 422 before anything is sent.\n\nAny LangWatch API key — project, organization or personal — reaches every project it can read `analytics:view` on: an organization or personal key spans its projects, a project key its one. Rows from more than one project come back flagged with the `MULTI_PROJECT_RESULT` diagnostic — to read a single project, filter inside the statement with `WHERE TenantId = '<project id>'`.\n\nTo run over one project only, send its id as `projectId` in the body: the run then reads that project's rows alone, redacted by that project's own protections. A `projectId` the key cannot read `analytics:view` on, in its own organization, is refused with `project_not_found` (404), the same answer as a project that does not exist. Without `projectId` the run spans every project the key can read.\n\nA statement that names no `LIMIT` is capped at 10,000 rows: that `LIMIT` is appended before the query runs. A statement whose own `LIMIT` asks for more is refused with `LIMIT_TOO_HIGH` — lower it and page the rest with `LIMIT`/`OFFSET` and an `ORDER BY`. When using `UNION`, every top-level branch must carry its own `LIMIT` clause of 10,000 rows or fewer, or the query is refused with `LIMIT_REQUIRED_PER_BRANCH`. A result whose body exceeds about 8,000,000 bytes is refused outright with `lwql_result_too_large`, never cut — select fewer columns or a smaller `LIMIT`.\n\nFailures answer with their real HTTP status (a refused query is 403, not 200) and this API's canonical error envelope — the same `code` and `meta` every other REST family publishes.","summary":"Run a LangWatchQL query","tags":["Query"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"timeWindow":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"string","format":"date-time"}]},"end":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"string","format":"date-time"}]}},"required":["start","end"],"additionalProperties":false},"granularitySeconds":{"anyOf":[{"type":"number","const":1},{"type":"number","const":60},{"type":"number","const":3600},{"type":"number","const":86400},{"type":"number","const":604800}]},"projectId":{"description":"Narrows the run to this one project, which the key must hold analytics:view on. Without it the run spans every project the key can read.","type":"string","minLength":1}},"required":["sql"]}}}}}},"/api/v1/query/schema":{"get":{"operationId":"getApiV1QuerySchema","responses":{"200":{"description":"The views and columns this key may query, with the permissions that unlock each one.","content":{"application/json":{"schema":{"type":"object","properties":{"database":{"type":"string"},"functions":{"readOnly":true,"type":"array","items":{"type":"string"}},"views":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"grain":{"type":"string"},"joinKeys":{"readOnly":true,"type":"array","items":{"type":"string"}},"timeColumn":{"type":["string","null"]},"freshness":{"type":"string"},"columns":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"},"unit":{"type":["string","null"]},"gates":{"readOnly":true,"type":"array","items":{"anyOf":[{"type":"string","enum":["input","output","costs"]},{"type":"string","enum":["organization:view","organization:manage","organization:delete","project:view","project:create","project:update","project:delete","project:manage","team:view","team:manage","analytics:view","analytics:create","analytics:update","analytics:delete","analytics:manage","cost:view","traces:view","traces:create","traces:update","traces:share","scenarios:view","scenarios:create","scenarios:update","scenarios:delete","scenarios:manage","annotations:view","annotations:create","annotations:update","annotations:delete","annotations:manage","evaluations:view","evaluations:create","evaluations:update","evaluations:delete","evaluations:manage","datasets:view","datasets:create","datasets:update","datasets:delete","datasets:manage","triggers:view","triggers:create","triggers:update","triggers:delete","triggers:manage","workflows:view","workflows:create","workflows:update","workflows:delete","workflows:manage","experiments:view","experiments:create","experiments:update","experiments:delete","experiments:manage","prompts:view","prompts:create","prompts:update","prompts:delete","prompts:manage","secrets:view","secrets:create","secrets:update","secrets:delete","secrets:manage","playground:view","playground:create","playground:update","playground:delete","playground:manage","ops:view","ops:manage","auditLog:view","virtualKeys:view","virtualKeys:create","virtualKeys:update","virtualKeys:delete","virtualKeys:rotate","virtualKeys:manage","virtualKeys:viewOtherPersonal","gatewayBudgets:view","gatewayBudgets:create","gatewayBudgets:update","gatewayBudgets:delete","gatewayBudgets:manage","gatewayProviders:view","gatewayProviders:update","gatewayProviders:manage","routingPolicies:view","routingPolicies:manage","gatewayGuardrails:view","gatewayGuardrails:attach","gatewayGuardrails:detach","gatewayGuardrails:manage","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","gatewayCacheRules:create","gatewayCacheRules:update","gatewayCacheRules:delete","gatewayCacheRules:manage","governance:view","governance:manage","ingestionSources:view","ingestionSources:create","ingestionSources:update","ingestionSources:delete","ingestionSources:manage","anomalyRules:view","anomalyRules:create","anomalyRules:update","anomalyRules:delete","anomalyRules:manage","complianceExport:view","activityMonitor:view","aiTools:view","aiTools:manage","webhookEndpoints:view","webhookEndpoints:manage","gatewaySpend:view","gatewaySpend:manage","langy:view","langy:create","langy:update","langy:delete","langy:manage","agentCache:view","agentCache:manage","featureFlags:manageExperiments","governanceCost:view","sso:view","sso:manage"]}]}},"available":{"type":"boolean"}},"required":["name","type","description","unit","gates","available"],"additionalProperties":false}},"exampleSql":{"type":"string"}},"required":["name","description","grain","joinKeys","timeColumn","freshness","columns","exampleSql"],"additionalProperties":false}},"appFunctions":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"signature":{"type":"string"},"description":{"type":"string"},"returns":{"type":"string"},"encoding":{"type":"string"},"keyKind":{"type":"string"},"kind":{"type":"string","enum":["extraction","eval"]},"cap":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"gates":{"readOnly":true,"type":"array","items":{"anyOf":[{"type":"string","enum":["input","output","costs"]},{"type":"string","enum":["organization:view","organization:manage","organization:delete","project:view","project:create","project:update","project:delete","project:manage","team:view","team:manage","analytics:view","analytics:create","analytics:update","analytics:delete","analytics:manage","cost:view","traces:view","traces:create","traces:update","traces:share","scenarios:view","scenarios:create","scenarios:update","scenarios:delete","scenarios:manage","annotations:view","annotations:create","annotations:update","annotations:delete","annotations:manage","evaluations:view","evaluations:create","evaluations:update","evaluations:delete","evaluations:manage","datasets:view","datasets:create","datasets:update","datasets:delete","datasets:manage","triggers:view","triggers:create","triggers:update","triggers:delete","triggers:manage","workflows:view","workflows:create","workflows:update","workflows:delete","workflows:manage","experiments:view","experiments:create","experiments:update","experiments:delete","experiments:manage","prompts:view","prompts:create","prompts:update","prompts:delete","prompts:manage","secrets:view","secrets:create","secrets:update","secrets:delete","secrets:manage","playground:view","playground:create","playground:update","playground:delete","playground:manage","ops:view","ops:manage","auditLog:view","virtualKeys:view","virtualKeys:create","virtualKeys:update","virtualKeys:delete","virtualKeys:rotate","virtualKeys:manage","virtualKeys:viewOtherPersonal","gatewayBudgets:view","gatewayBudgets:create","gatewayBudgets:update","gatewayBudgets:delete","gatewayBudgets:manage","gatewayProviders:view","gatewayProviders:update","gatewayProviders:manage","routingPolicies:view","routingPolicies:manage","gatewayGuardrails:view","gatewayGuardrails:attach","gatewayGuardrails:detach","gatewayGuardrails:manage","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","gatewayCacheRules:create","gatewayCacheRules:update","gatewayCacheRules:delete","gatewayCacheRules:manage","governance:view","governance:manage","ingestionSources:view","ingestionSources:create","ingestionSources:update","ingestionSources:delete","ingestionSources:manage","anomalyRules:view","anomalyRules:create","anomalyRules:update","anomalyRules:delete","anomalyRules:manage","complianceExport:view","activityMonitor:view","aiTools:view","aiTools:manage","webhookEndpoints:view","webhookEndpoints:manage","gatewaySpend:view","gatewaySpend:manage","langy:view","langy:create","langy:update","langy:delete","langy:manage","agentCache:view","agentCache:manage","featureFlags:manageExperiments","governanceCost:view","sso:view","sso:manage"]}]}},"available":{"type":"boolean"},"exampleSql":{"type":"string"}},"required":["name","signature","description","returns","encoding","keyKind","kind","cap","gates","available","exampleSql"],"additionalProperties":false}}},"required":["database","functions","views","appFunctions"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Lists the LangWatchQL analytics views this key may query, with each column's type, description, the permissions that unlock it, and whether this caller holds them — plus each view's grain, join keys, partition-pruning time column, freshness and a runnable example query. It also lists, under `functions`, every function name a query may call.\n\nUnder `appFunctions` it lists the app functions a projection may call, each with its signature, the type and encoding of the value it returns, how many distinct keys one run may read, and the permissions it needs.\n\nScoped to the projects the credential can read and their permissions: a column or app function this key cannot read in every one of them is listed with `available: false` rather than hidden, so a caller can see what a wider key would unlock.\n\nAny LangWatch API key — project, organization or personal — reaches every project it can read `analytics:view` on: an organization or personal key spans its projects, a project key its one. Rows from more than one project come back flagged with the `MULTI_PROJECT_RESULT` diagnostic — to read a single project, filter inside the statement with `WHERE TenantId = '<project id>'`.","summary":"Discover the queryable LangWatchQL schema","tags":["Query"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]}}},"/api/v1/query/reference":{"get":{"operationId":"getApiV1QueryReference","responses":{"200":{"description":"The LangWatchQL schema and limits, the trace filter's syntax and fields, worked examples in both languages, and which language answers which kind of question.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"lwql":{"type":"object","properties":{"enabled":{"type":"boolean"},"schema":{"type":"object","properties":{"database":{"type":"string"},"functions":{"readOnly":true,"type":"array","items":{"type":"string"}},"views":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"grain":{"type":"string"},"joinKeys":{"readOnly":true,"type":"array","items":{"type":"string"}},"timeColumn":{"type":["string","null"]},"freshness":{"type":"string"},"columns":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"},"unit":{"type":["string","null"]},"gates":{"readOnly":true,"type":"array","items":{"anyOf":[{"type":"string","enum":["input","output","costs"]},{"type":"string","enum":["organization:view","organization:manage","organization:delete","project:view","project:create","project:update","project:delete","project:manage","team:view","team:manage","analytics:view","analytics:create","analytics:update","analytics:delete","analytics:manage","cost:view","traces:view","traces:create","traces:update","traces:share","scenarios:view","scenarios:create","scenarios:update","scenarios:delete","scenarios:manage","annotations:view","annotations:create","annotations:update","annotations:delete","annotations:manage","evaluations:view","evaluations:create","evaluations:update","evaluations:delete","evaluations:manage","datasets:view","datasets:create","datasets:update","datasets:delete","datasets:manage","triggers:view","triggers:create","triggers:update","triggers:delete","triggers:manage","workflows:view","workflows:create","workflows:update","workflows:delete","workflows:manage","experiments:view","experiments:create","experiments:update","experiments:delete","experiments:manage","prompts:view","prompts:create","prompts:update","prompts:delete","prompts:manage","secrets:view","secrets:create","secrets:update","secrets:delete","secrets:manage","playground:view","playground:create","playground:update","playground:delete","playground:manage","ops:view","ops:manage","auditLog:view","virtualKeys:view","virtualKeys:create","virtualKeys:update","virtualKeys:delete","virtualKeys:rotate","virtualKeys:manage","virtualKeys:viewOtherPersonal","gatewayBudgets:view","gatewayBudgets:create","gatewayBudgets:update","gatewayBudgets:delete","gatewayBudgets:manage","gatewayProviders:view","gatewayProviders:update","gatewayProviders:manage","routingPolicies:view","routingPolicies:manage","gatewayGuardrails:view","gatewayGuardrails:attach","gatewayGuardrails:detach","gatewayGuardrails:manage","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","gatewayCacheRules:create","gatewayCacheRules:update","gatewayCacheRules:delete","gatewayCacheRules:manage","governance:view","governance:manage","ingestionSources:view","ingestionSources:create","ingestionSources:update","ingestionSources:delete","ingestionSources:manage","anomalyRules:view","anomalyRules:create","anomalyRules:update","anomalyRules:delete","anomalyRules:manage","complianceExport:view","activityMonitor:view","aiTools:view","aiTools:manage","webhookEndpoints:view","webhookEndpoints:manage","gatewaySpend:view","gatewaySpend:manage","langy:view","langy:create","langy:update","langy:delete","langy:manage","agentCache:view","agentCache:manage","featureFlags:manageExperiments","governanceCost:view","sso:view","sso:manage"]}]}},"available":{"type":"boolean"}},"required":["name","type","description","unit","gates","available"],"additionalProperties":false}},"exampleSql":{"type":"string"}},"required":["name","description","grain","joinKeys","timeColumn","freshness","columns","exampleSql"],"additionalProperties":false}},"appFunctions":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"signature":{"type":"string"},"description":{"type":"string"},"returns":{"type":"string"},"encoding":{"type":"string"},"keyKind":{"type":"string"},"kind":{"type":"string","enum":["extraction","eval"]},"cap":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"gates":{"readOnly":true,"type":"array","items":{"anyOf":[{"type":"string","enum":["input","output","costs"]},{"type":"string","enum":["organization:view","organization:manage","organization:delete","project:view","project:create","project:update","project:delete","project:manage","team:view","team:manage","analytics:view","analytics:create","analytics:update","analytics:delete","analytics:manage","cost:view","traces:view","traces:create","traces:update","traces:share","scenarios:view","scenarios:create","scenarios:update","scenarios:delete","scenarios:manage","annotations:view","annotations:create","annotations:update","annotations:delete","annotations:manage","evaluations:view","evaluations:create","evaluations:update","evaluations:delete","evaluations:manage","datasets:view","datasets:create","datasets:update","datasets:delete","datasets:manage","triggers:view","triggers:create","triggers:update","triggers:delete","triggers:manage","workflows:view","workflows:create","workflows:update","workflows:delete","workflows:manage","experiments:view","experiments:create","experiments:update","experiments:delete","experiments:manage","prompts:view","prompts:create","prompts:update","prompts:delete","prompts:manage","secrets:view","secrets:create","secrets:update","secrets:delete","secrets:manage","playground:view","playground:create","playground:update","playground:delete","playground:manage","ops:view","ops:manage","auditLog:view","virtualKeys:view","virtualKeys:create","virtualKeys:update","virtualKeys:delete","virtualKeys:rotate","virtualKeys:manage","virtualKeys:viewOtherPersonal","gatewayBudgets:view","gatewayBudgets:create","gatewayBudgets:update","gatewayBudgets:delete","gatewayBudgets:manage","gatewayProviders:view","gatewayProviders:update","gatewayProviders:manage","routingPolicies:view","routingPolicies:manage","gatewayGuardrails:view","gatewayGuardrails:attach","gatewayGuardrails:detach","gatewayGuardrails:manage","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","gatewayCacheRules:create","gatewayCacheRules:update","gatewayCacheRules:delete","gatewayCacheRules:manage","governance:view","governance:manage","ingestionSources:view","ingestionSources:create","ingestionSources:update","ingestionSources:delete","ingestionSources:manage","anomalyRules:view","anomalyRules:create","anomalyRules:update","anomalyRules:delete","anomalyRules:manage","complianceExport:view","activityMonitor:view","aiTools:view","aiTools:manage","webhookEndpoints:view","webhookEndpoints:manage","gatewaySpend:view","gatewaySpend:manage","langy:view","langy:create","langy:update","langy:delete","langy:manage","agentCache:view","agentCache:manage","featureFlags:manageExperiments","governanceCost:view","sso:view","sso:manage"]}]}},"available":{"type":"boolean"},"exampleSql":{"type":"string"}},"required":["name","signature","description","returns","encoding","keyKind","kind","cap","gates","available","exampleSql"],"additionalProperties":false}}},"required":["database","functions","views","appFunctions"],"additionalProperties":false},"limits":{"type":"object","properties":{"maxStatementLength":{"type":"number"},"maxRowsReturned":{"type":"number"},"maxResultBytes":{"type":"number"},"maxExecutionTimeSeconds":{"type":"number"},"pagination":{"type":"string"}},"required":["maxStatementLength","maxRowsReturned","maxResultBytes","maxExecutionTimeSeconds","pagination"],"additionalProperties":false},"endpoints":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST"]},"path":{"type":"string"},"description":{"type":"string"}},"required":["method","path","description"],"additionalProperties":false}}},"required":["enabled","schema","limits","endpoints"],"additionalProperties":false},"traceFilter":{"type":"object","properties":{"syntax":{"type":"string"},"fields":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"valueType":{"type":"string","enum":["categorical","range","text","existence"]},"group":{"type":["string","null"]},"facetable":{"type":"boolean"},"knownValues":{"readOnly":true,"type":"array","items":{"type":"string"}}},"required":["name","label","valueType","group","facetable","knownValues"],"additionalProperties":false}},"dynamicPrefixes":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"prefix":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"aliases":{"readOnly":true,"type":"array","items":{"type":"string"}}},"required":["prefix","label","description","aliases"],"additionalProperties":false}},"endpoints":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST"]},"path":{"type":"string"},"description":{"type":"string"}},"required":["method","path","description"],"additionalProperties":false}}},"required":["syntax","fields","dynamicPrefixes","endpoints"],"additionalProperties":false},"examples":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"intent":{"type":"string","enum":["triage","cost","latency","quality","conversations","discovery","export"]},"language":{"type":"string","enum":["lwql","trace-filter"]},"tags":{"readOnly":true,"type":"array","items":{"type":"string"}},"text":{"type":"string"},"parameters":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"}},"required":["name","type","description"],"additionalProperties":false}},"requires":{"type":"object","properties":{"gates":{"readOnly":true,"type":"array","items":{"anyOf":[{"type":"string","enum":["input","output","costs"]},{"type":"string","enum":["organization:view","organization:manage","organization:delete","project:view","project:create","project:update","project:delete","project:manage","team:view","team:manage","analytics:view","analytics:create","analytics:update","analytics:delete","analytics:manage","cost:view","traces:view","traces:create","traces:update","traces:share","scenarios:view","scenarios:create","scenarios:update","scenarios:delete","scenarios:manage","annotations:view","annotations:create","annotations:update","annotations:delete","annotations:manage","evaluations:view","evaluations:create","evaluations:update","evaluations:delete","evaluations:manage","datasets:view","datasets:create","datasets:update","datasets:delete","datasets:manage","triggers:view","triggers:create","triggers:update","triggers:delete","triggers:manage","workflows:view","workflows:create","workflows:update","workflows:delete","workflows:manage","experiments:view","experiments:create","experiments:update","experiments:delete","experiments:manage","prompts:view","prompts:create","prompts:update","prompts:delete","prompts:manage","secrets:view","secrets:create","secrets:update","secrets:delete","secrets:manage","playground:view","playground:create","playground:update","playground:delete","playground:manage","ops:view","ops:manage","auditLog:view","virtualKeys:view","virtualKeys:create","virtualKeys:update","virtualKeys:delete","virtualKeys:rotate","virtualKeys:manage","virtualKeys:viewOtherPersonal","gatewayBudgets:view","gatewayBudgets:create","gatewayBudgets:update","gatewayBudgets:delete","gatewayBudgets:manage","gatewayProviders:view","gatewayProviders:update","gatewayProviders:manage","routingPolicies:view","routingPolicies:manage","gatewayGuardrails:view","gatewayGuardrails:attach","gatewayGuardrails:detach","gatewayGuardrails:manage","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","gatewayCacheRules:create","gatewayCacheRules:update","gatewayCacheRules:delete","gatewayCacheRules:manage","governance:view","governance:manage","ingestionSources:view","ingestionSources:create","ingestionSources:update","ingestionSources:delete","ingestionSources:manage","anomalyRules:view","anomalyRules:create","anomalyRules:update","anomalyRules:delete","anomalyRules:manage","complianceExport:view","activityMonitor:view","aiTools:view","aiTools:manage","webhookEndpoints:view","webhookEndpoints:manage","gatewaySpend:view","gatewaySpend:manage","langy:view","langy:create","langy:update","langy:delete","langy:manage","agentCache:view","agentCache:manage","featureFlags:manageExperiments","governanceCost:view","sso:view","sso:manage"]}]}},"functions":{"readOnly":true,"type":"array","items":{"type":"string"}}},"required":["gates","functions"],"additionalProperties":false},"available":{"type":"boolean"},"notes":{"type":"string"}},"required":["id","title","intent","language","tags","text","parameters","requires","available"],"additionalProperties":false}},"decisionTable":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"when":{"type":"string"},"use":{"type":"string"},"why":{"type":"string"}},"required":["when","use","why"],"additionalProperties":false}}},"required":["version","lwql","traceFilter","examples","decisionTable"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Describes both query languages in one payload: LangWatchQL (SQL over the analytics datasets) with its schema, limits and endpoints, and the trace filter (a Lucene-flavoured string over the trace list) with its syntax, its fields and their static value vocabularies, and the open-ended attribute namespaces.\n\nIt also carries worked examples in both languages and a table saying which language answers which kind of question. Every example is checked against the real validator before it ships, so a published example parses; whether THIS key can run one is its own `available` flag.\n\nPure: it reads the catalogues and this key's own permissions, never the project's traces, so it answers from memory rather than from the database.\n\nThe document is shaped by the calling credential — `available`, the embedded schema and the gated columns all differ between keys — so never cache it beyond the key that asked for it. Ask again rather than storing it.\n\nThe values a field actually holds change under you and are a separate call — `GET /api/traces/facets`.\n\nAn example this key cannot run is listed with `available: false` and keeps its `requires.gates`, so a caller can see which permission it needs.\n\nAny credential for the project may read it. The trace filter half is the traces family's vocabulary, so a key scoped to `traces:view` alone is answered rather than refused; for that key the LangWatchQL half arrives with `lwql.enabled: false` and an empty schema. `GET /api/v1/query/schema` is stricter and refuses that key outright, which is why this document withholds the catalogue rather than repeating it.","summary":"Discover both query languages","tags":["Query"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]}}},"/api/v1/annotations":{"get":{"operationId":"getApiAnnotations","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Annotation"}}},"required":["data"],"additionalProperties":false}}}}},"summary":"List annotations in the caller’s project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["annotations:view"]},"parameters":[{"in":"query","name":"anchor","schema":{"default":"all","type":"string","enum":["trace","all"]}}]}},"/api/v1/annotations/{id}":{"get":{"operationId":"getApiAnnotationsId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Annotation"}},"required":["data"],"additionalProperties":false}}}}},"summary":"Get an annotation in the caller’s project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["annotations:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiAnnotationsId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Annotation"}},"required":["data"],"additionalProperties":false}}}}},"summary":"Update an annotation in the caller’s project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["annotations:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","minLength":1},"isThumbsUp":{"type":"boolean"},"email":{"type":["string","null"]}},"required":["comment","isThumbsUp"]}}}}},"delete":{"operationId":"deleteApiAnnotationsId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}},"required":["status","message"],"additionalProperties":false}}}}},"summary":"Delete an annotation in the caller’s project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["annotations:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/annotations/trace/{id}":{"get":{"operationId":"getApiAnnotationsTraceId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Annotation"}}},"required":["data"],"additionalProperties":false}}}}},"summary":"List annotations on a trace in the caller’s project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["annotations:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"anchor","schema":{"default":"all","type":"string","enum":["trace","all"]}}]},"post":{"operationId":"postApiAnnotationsTraceId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Annotation"}},"required":["data"],"additionalProperties":false}}}}},"summary":"Create an unattributed annotation on a trace","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["annotations:create"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","minLength":1},"isThumbsUp":{"type":"boolean"},"email":{"type":["string","null"]}},"required":["comment","isThumbsUp"]}}}}}},"/api/v1/api-keys":{"get":{"operationId":"listApiKeys","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyInfo"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions (requires organization:view)","content":{}}},"description":"List all API keys owned by the authenticated user in this organization. Requires organization:view permission.","summary":"List API keys","tags":["API Keys"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:view"]}},"post":{"operationId":"createApiKey","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1},"apiKey":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","createdAt"],"additionalProperties":false}},"required":["token","apiKey"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Requested binding exceeds what the key making the request holds, or the scope does not belong to this organization (api_key_scope_violation); a service key or a key for another member was requested without organization admin rights (api_key_admin_required)","content":{}},"422":{"description":"Validation error, for example a missing name or empty bindings (validation_error), or a name LangWatch reserves for its own keys (api_key_reserved_name)","content":{}}},"description":"Create a new API key. For service keys, pass keyType:\"service\". Optionally scope to specific projects via projectIds (ADMIN on each). Omit projectIds for full org access. Pass assignedToUserId to mint the key for another member, and permissionMode:\"restricted\" with a permissions list to grant exactly those permissions. Minting a service key or a key for another member requires organization admin rights, held by both the key making the request and its member. A key can grant at most what the key making the request holds. The plaintext token is returned once — store it securely.","summary":"Create an API key","tags":["API Keys"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyType":{"default":"personal","description":"A personal key acts as the user who created it and needs explicit bindings. A service key is not tied to a user.","type":"string","enum":["personal","service"]},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Human-readable name for this key"},"description":{"type":"string","maxLength":500},"expiresAt":{"description":"ISO 8601 timestamp after which the key stops working","type":"string","format":"date-time"},"assignedToUserId":{"description":"Organization admins only: the member who owns the key and whose access caps it. Defaults to the caller.","type":"string","minLength":1},"permissionMode":{"default":"all","type":"string","enum":["all","readonly","restricted"],"description":"'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list."},"permissions":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$"},"description":"Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant."},"bindings":{"description":"What this key may do, and where. Required for a personal key.","maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"],"description":"CUSTOM grants exactly the listed permissions and requires permissionMode 'restricted'."},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"]}},"projectIds":{"description":"Service keys only: restricts the key to these projects","maxItems":50,"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]}}}}}},"/api/v1/api-keys/{id}":{"get":{"operationId":"getApiKey","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"description":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"roleBindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["id","role","scopeType","scopeId"],"additionalProperties":false}},"keyType":{"type":"string","enum":["personal","service"]},"assignedToUserId":{"type":["string","null"]},"createdByUserId":{"type":["string","null"]},"permissionMode":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$"}},"bindings":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"],"additionalProperties":false}}},"required":["id","name","description","createdAt","expiresAt","lastUsedAt","revokedAt","roleBindings","keyType","assignedToUserId","createdByUserId","permissionMode","permissions","bindings"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions (requires organization:view)","content":{}},"404":{"description":"API key not found (api_key_not_found)","content":{}}},"description":"Read one API key by id, including its role bindings, permission mode and explicit permissions. Returns your own keys; organization admins may read any key in the organization. The secret is never returned. An id that does not exist, belongs to another organization, or belongs to another member all answer 404 api_key_not_found, so the response cannot be used to probe for keys.","summary":"Get an API key","tags":["API Keys"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"updateApiKey","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"description":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"roleBindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["id","role","scopeType","scopeId"],"additionalProperties":false}},"keyType":{"type":"string","enum":["personal","service"]},"assignedToUserId":{"type":["string","null"]},"createdByUserId":{"type":["string","null"]},"permissionMode":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$"}},"bindings":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"],"additionalProperties":false}}},"required":["id","name","description","createdAt","expiresAt","lastUsedAt","revokedAt","roleBindings","keyType","assignedToUserId","createdByUserId","permissionMode","permissions","bindings"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions (requires organization:manage), the requested binding exceeds what the key owner or the key making the request holds, or the scope does not belong to this organization (api_key_scope_violation)","content":{}},"404":{"description":"API key not found, or not yours to edit (api_key_not_found)","content":{}},"409":{"description":"API key is already revoked (api_key_already_revoked)","content":{}},"422":{"description":"Validation error, for example restricted mode without a permissions list (validation_error)","content":{}}},"description":"Update an API key's name, description, permission mode, permissions or bindings. Every field is optional; bindings are replaced outright, and the response is exactly what a subsequent GET returns. You may update your own keys; organization admins may update any key in the organization. Bindings can never exceed the access of the member the key belongs to, and a key can grant at most what the key making the request holds. The token itself never changes.","summary":"Update an API key","tags":["API Keys"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"permissionMode":{"type":"string","enum":["all","readonly","restricted"],"description":"'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list."},"permissions":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$"},"description":"Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant."},"bindings":{"description":"Replaces the key's bindings outright. Whatever is accepted here is exactly what a subsequent GET returns.","minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"],"description":"CUSTOM grants exactly the listed permissions and requires permissionMode 'restricted'."},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"]}}}}}}},"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"revokeApiKey","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Not authorized to revoke this API key, which belongs to another member (api_key_not_owned)","content":{}},"404":{"description":"API key not found (api_key_not_found)","content":{}},"409":{"description":"API key is already revoked (api_key_already_revoked)","content":{}}},"description":"Revoke (soft-delete) an API key. Revoked keys can no longer authenticate. Requires organization:manage permission.","summary":"Revoke an API key","tags":["API Keys"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/api-keys/ingestion":{"post":{"operationId":"createIngestionApiKey","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1},"apiKey":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","createdAt"],"additionalProperties":false}},"required":["token","apiKey"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"The caller is not a person's sign-in session, lacks traces:create, or asked for any other shape (api_key_scope_violation)","content":{}},"422":{"description":"Validation error (validation_error)","content":{}}},"description":"Mint the caller's own ingestion key for the project their sign-in session is bound to, as `langwatch login --project` does. Only one shape is accepted: keyType \"personal\", owned by the caller, one CUSTOM binding to that project, permissionMode \"restricted\" and exactly the ingestion permissions. Name it after the machine; omit expiresAt for a key that never expires. Requires a person's project session holding traces:create; an API key cannot mint one.","summary":"Create an ingestion API key","tags":["API Keys"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyType":{"default":"personal","description":"A personal key acts as the user who created it and needs explicit bindings. A service key is not tied to a user.","type":"string","enum":["personal","service"]},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Human-readable name for this key"},"description":{"type":"string","maxLength":500},"expiresAt":{"description":"ISO 8601 timestamp after which the key stops working","type":"string","format":"date-time"},"assignedToUserId":{"description":"Organization admins only: the member who owns the key and whose access caps it. Defaults to the caller.","type":"string","minLength":1},"permissionMode":{"default":"all","type":"string","enum":["all","readonly","restricted"],"description":"'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list."},"permissions":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$"},"description":"Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant."},"bindings":{"description":"What this key may do, and where. Required for a personal key.","maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"],"description":"CUSTOM grants exactly the listed permissions and requires permissionMode 'restricted'."},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"]}},"projectIds":{"description":"Service keys only: restricts the key to these projects","maxItems":50,"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]}}}}}},"/api/v1/api-keys/full-access":{"post":{"operationId":"createFullAccessApiKey","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1},"apiKey":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","createdAt"],"additionalProperties":false}},"required":["token","apiKey"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"The caller is not a person's sign-in session, lacks project:manage, or asked for any other shape (api_key_scope_violation)","content":{}},"422":{"description":"Validation error (validation_error)","content":{}}},"description":"Mint the caller's own API key for the project their sign-in session is bound to, as `langwatch login --project` does: it can do everything the caller can do in that project (prompts, datasets, evaluations, simulations, traces). Only one shape is accepted: keyType \"personal\", owned by the caller, one ADMIN binding to that project and permissionMode \"all\". Name it after the machine; omit expiresAt for a key that never expires. Requires a person's project session holding project:manage; an API key cannot mint one.","summary":"Create a full-access API key","tags":["API Keys"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyType":{"default":"personal","description":"A personal key acts as the user who created it and needs explicit bindings. A service key is not tied to a user.","type":"string","enum":["personal","service"]},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Human-readable name for this key"},"description":{"type":"string","maxLength":500},"expiresAt":{"description":"ISO 8601 timestamp after which the key stops working","type":"string","format":"date-time"},"assignedToUserId":{"description":"Organization admins only: the member who owns the key and whose access caps it. Defaults to the caller.","type":"string","minLength":1},"permissionMode":{"default":"all","type":"string","enum":["all","readonly","restricted"],"description":"'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list."},"permissions":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$"},"description":"Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant."},"bindings":{"description":"What this key may do, and where. Required for a personal key.","maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"],"description":"CUSTOM grants exactly the listed permissions and requires permissionMode 'restricted'."},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"]}},"projectIds":{"description":"Service keys only: restricts the key to these projects","maxItems":50,"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]}}}}}},"/api/v1/projects":{"get":{"operationId":"listProjects","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions for this operation","content":{}}},"description":"List all non-archived projects for the organization (paginated). Requires an admin API key with project:view permission.","summary":"List projects","security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":[]},"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":1000}}]},"post":{"operationId":"createProject","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"language":{"type":"string"},"framework":{"type":"string"},"teamId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"serviceApiKey":{"type":"string","minLength":1},"serviceApiKeyId":{"type":"string","minLength":1}},"required":["id","name","slug","language","framework","teamId","createdAt","updatedAt","serviceApiKey","serviceApiKeyId"],"additionalProperties":false}}}},"400":{"description":"Team does not belong to this organization","content":{}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions (requires project:create)","content":{}},"409":{"description":"A project with this name already exists in the team","content":{}},"422":{"description":"Validation error (missing required fields)","content":{}}},"description":"Create a new project in the organization. Returns the project with a newly minted service API key (serviceApiKey) for sending traces. Provide either teamId (existing team) or newTeamName (creates a new team). Requires project:create permission.","summary":"Create a project","security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["project:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Project name"},"teamId":{"description":"Id of an existing team to put the project in","type":"string","minLength":1},"newTeamName":{"description":"Create a team with this name and put the project in it","type":"string","minLength":1,"maxLength":255},"language":{"type":"string","minLength":1,"description":"Programming language, such as python or typescript"},"framework":{"type":"string","minLength":1,"description":"Framework in use, such as langchain or openai"}},"required":["name","language","framework"]}}}}}},"/api/v1/organizations":{"post":{"operationId":"provisionOrganization","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"additionalProperties":false},"team":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"additionalProperties":false},"adminApiKey":{"type":"object","properties":{"id":{"type":"string","minLength":1},"token":{"type":"string","minLength":1}},"required":["id","token"],"additionalProperties":false}},"required":["organization","team","adminApiKey"],"additionalProperties":false}}}}},"description":"Provision a new organization with its first team and a bootstrap admin service key, self-hosted instance administrators only.","tags":["Organizations (Self-Hosted)"],"security":[{"instance_admin_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["instance_admin_api_key"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"slug":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"adminApiKeyName":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}}},"get":{"operationId":"listOrganizations","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","createdAt"],"additionalProperties":false}}},"required":["organizations"],"additionalProperties":false}}}}},"description":"List every organization this instance hosts, self-hosted instance administrators only.","tags":["Organizations (Self-Hosted)"],"security":[{"instance_admin_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["instance_admin_api_key"],"permissions":[]}}},"/api/v1/auth/cli/device-code":{"post":{"operationId":"startCliDeviceCode","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/auth/cli/exchange":{"post":{"operationId":"exchangeCliDeviceCode","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/auth/cli/refresh":{"post":{"operationId":"refreshCliDeviceSession","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/auth/cli/lookup":{"get":{"operationId":"lookupCliDeviceCode","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]},"parameters":[{"in":"query","name":"user_code","schema":{"type":"string"}}]}},"/api/v1/auth/cli/approve":{"post":{"operationId":"approveCliDeviceCode","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/auth/cli/deny":{"post":{"operationId":"denyCliDeviceCode","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/auth/cli/logout":{"post":{"operationId":"endCliDeviceSession","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/auth/cli/device-approval":{"get":{"operationId":"watchCliDeviceApproval","responses":{"200":{"description":"Success","content":{"text/event-stream":{}}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]},"parameters":[{"in":"query","name":"device_code","schema":{"type":"string","minLength":1},"required":true}]}},"/api/auth/validate":{"post":{"operationId":"validateProjectAuthToken","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"projectSlug":{"type":"string"}},"required":["projectSlug"],"additionalProperties":false}}}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/auth/session":{"get":{"operationId":"readBrowserAuthSession","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/auth/logout":{"get":{"operationId":"endBrowserSessionAndRedirect","responses":{"200":{"description":"Success","content":{"application/json":{},"text/html":{},"*/*":{}}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}},"post":{"operationId":"endBrowserSession","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/grants":{"get":{"operationId":"listGrants","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"grants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"builtIn":{"type":"boolean"}},"required":["id","name","builtIn"],"additionalProperties":false},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["organization","team","project"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"status":{"type":"string","enum":["active","expired"]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","principal","role","scope","status","expiresAt","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["grants","nextCursor"],"additionalProperties":false}}}}},"description":"List the organization's grants, oldest first unless `order=newest`, each naming its principal (user, group or API key), role and scope. Filter by principal, role, scope or status; `status` is derived from `expiresAt`. Pages by cursor: pass `nextCursor` back as `cursor` until it is null.","summary":"List grants","tags":["Grants"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"query","name":"principalType","schema":{"type":"string","enum":["user","group","apiKey"]}},{"in":"query","name":"principalId","schema":{"type":"string","minLength":1,"maxLength":128}},{"in":"query","name":"roleId","schema":{"type":"string","minLength":1,"maxLength":128}},{"in":"query","name":"scopeType","schema":{"type":"string","enum":["organization","team","project"]}},{"in":"query","name":"scopeId","schema":{"type":"string","minLength":1,"maxLength":128}},{"in":"query","name":"status","schema":{"type":"string","enum":["active","expired"]}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"in":"query","name":"cursor","schema":{"type":"string","pattern":"^\\d{1,16}\\.[A-Za-z0-9_-]{1,256}$"}},{"in":"query","name":"order","schema":{"type":"string","enum":["newest","oldest"]}}]},"post":{"operationId":"createGrant","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"builtIn":{"type":"boolean"}},"required":["id","name","builtIn"],"additionalProperties":false},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["organization","team","project"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"status":{"type":"string","enum":["active","expired"]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","principal","role","scope","status","expiresAt","createdAt"],"additionalProperties":false}}}}},"description":"Grant a role to a user, group or API key on the organization, a team or a project. `roleId` is `admin`, `member`, `viewer` or a custom role's id. Grants are never unique: each create is a new grant with its own id, up to the organization's limit (409 grant_limit_reached). Pass `expiresAt` to time-box the access. Send `Idempotency-Key` to make a retry safe. A grant never confers a permission the caller does not hold at that scope: 403 grant_exceeds_caller_permissions names the missing permissions.","summary":"Grant a role","tags":["Grants"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, 8 to 255 characters, that makes this create safe to retry. The first request to use a key runs normally and its response is stored for 24 hours. A later request with the same key and the same body is not executed again: it returns the stored response, marked with `X-Idempotent-Replay: true`. The same key with a different body is refused 409 `idempotency_error`, as is a retry sent while the original is still running. Only successful responses are stored, so a create that failed can simply be retried with the same key.","schema":{"type":"string","minLength":8,"maxLength":255}}],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["type","id"],"additionalProperties":false},"roleId":{"type":"string","minLength":1,"maxLength":128},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["organization","team","project"]},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["type","id"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time"}},"required":["principal","roleId","scope"],"additionalProperties":false}}}}}},"/api/v1/grants/{grantId}":{"get":{"operationId":"getGrant","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"builtIn":{"type":"boolean"}},"required":["id","name","builtIn"],"additionalProperties":false},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["organization","team","project"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"status":{"type":"string","enum":["active","expired"]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","principal","role","scope","status","expiresAt","createdAt"],"additionalProperties":false}}}}},"description":"Read one grant. An id outside the caller's organization answers 404 grant_not_found.","summary":"Get a grant","tags":["Grants"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"grantId","schema":{"type":"string","minLength":1,"maxLength":128},"required":true}]},"patch":{"operationId":"updateGrant","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"builtIn":{"type":"boolean"}},"required":["id","name","builtIn"],"additionalProperties":false},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["organization","team","project"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"status":{"type":"string","enum":["active","expired"]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","principal","role","scope","status","expiresAt","createdAt"],"additionalProperties":false}}}}},"description":"Change the role a grant confers. The principal and scope are the grant's identity and do not change. Lowering the organization's last administrator answers cannot_demote_last_admin. A grant never confers a permission the caller does not hold at that scope: 403 grant_exceeds_caller_permissions names the missing permissions.","summary":"Change a grant's role","tags":["Grants"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"grantId","schema":{"type":"string","minLength":1,"maxLength":128},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"roleId":{"type":"string","minLength":1,"maxLength":128}},"required":["roleId"],"additionalProperties":false}}}}},"delete":{"operationId":"revokeGrant","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false}}}}},"description":"Revoke a grant. Identical grants each hold until revoked, so the access lasts until the last of them ends. Revoking the organization's last administrator answers cannot_remove_last_admin.","summary":"Revoke a grant","tags":["Grants"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"grantId","schema":{"type":"string","minLength":1,"maxLength":128},"required":true}]}},"/api/v1/role-bindings":{"get":{"operationId":"listRoleBindings","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":["string","null"]},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["PROJECT","TEAM","ORGANIZATION"]},"scopeId":{"type":"string"},"scopeName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","principal","role","customRoleId","customRoleName","scopeType","scopeId","scopeName","createdAt","expiresAt"],"additionalProperties":false}},"totalCount":{"type":"number"}},"required":["bindings","totalCount"],"additionalProperties":false}}}}},"description":"List the organization's role bindings, each naming its principal (user, group or API key), role, scope, and the date its access ends if one was set. Filter by principal or scope; totalCount counts the filtered set. superseded by /api/grants, which answers the same rows as grants","tags":["Role Bindings"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"deprecated":true,"parameters":[{"in":"query","name":"userId","schema":{"type":"string","minLength":1}},{"in":"query","name":"groupId","schema":{"type":"string","minLength":1}},{"in":"query","name":"apiKeyId","schema":{"type":"string","minLength":1}},{"in":"query","name":"scopeType","schema":{"type":"string","enum":["PROJECT","TEAM","ORGANIZATION"]}},{"in":"query","name":"scopeId","schema":{"type":"string","minLength":1}},{"in":"query","name":"offset","schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":200}}]},"post":{"operationId":"createRoleBinding","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":["string","null"]},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["PROJECT","TEAM","ORGANIZATION"]},"scopeId":{"type":"string"},"scopeName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","principal","role","customRoleId","customRoleName","scopeType","scopeId","scopeName","createdAt","expiresAt"],"additionalProperties":false}}}}},"description":"Create a role binding for exactly one principal: a user, a group, or an API key. Every reference is checked against the caller's organization; an identical binding is written again, because bindings are never unique. Pass expiresAt to time-box the access: it stops granting at that moment on its own, without being revoked, and a date that has already passed answers 422 grant_expiry_in_past. The response always carries the new binding's id; the names of its principal, role and scope may be absent on this response alone, and a follow-up read carries them. superseded by /api/grants, which answers the same rows as grants","tags":["Role Bindings"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"deprecated":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"groupId":{"type":"string","minLength":1},"apiKeyId":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":"string","minLength":1},"scopeType":{"type":"string","enum":["PROJECT","TEAM","ORGANIZATION"]},"scopeId":{"type":"string","minLength":1},"expiresAt":{"type":"string","format":"date-time"}},"required":["role","scopeType","scopeId"]}}}}}},"/api/v1/role-bindings/{id}":{"patch":{"operationId":"updateRoleBinding","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"principal":{"type":"object","properties":{"type":{"type":"string","enum":["user","group","apiKey"]},"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":["string","null"]},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["PROJECT","TEAM","ORGANIZATION"]},"scopeId":{"type":"string"},"scopeName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","principal","role","customRoleId","customRoleName","scopeType","scopeId","scopeName","createdAt","expiresAt"],"additionalProperties":false}}}}},"description":"Change a binding's role (and custom role). The principal and scope are the binding's identity and do not change; create a new binding instead. superseded by /api/grants, which answers the same rows as grants","tags":["Role Bindings"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"deprecated":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":"string","minLength":1}},"required":["role"]}}}}},"delete":{"operationId":"deleteRoleBinding","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}}},"description":"Delete a role binding. An id that does not exist in the caller's organization answers 404 role_binding_not_found. superseded by /api/grants, which answers the same rows as grants","tags":["Role Bindings"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"deprecated":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/triggers":{"get":{"operationId":"getApiTriggers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["SEND_EMAIL","ADD_TO_DATASET","ADD_TO_ANNOTATION_QUEUE","SEND_SLACK_MESSAGE","SEND_WEBHOOK"]},"actionParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Where this automation delivers, with every credential value replaced by the `[redacted]` placeholder. Which channel is configured, which destination is set and which header names are in play all survive; the values never leave; a Slack automation names its connection by `slackIntegrationId` and carries no secret. Sending the placeholder back on an update keeps the stored value. The rule this automation fires by is not here: it is stated in `graphAlert` or `report`, and sending it in this field is refused."},"graphAlert":{"anyOf":[{"type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"],"additionalProperties":false},{"type":"null"}],"description":"The rule an alert fires by. Null for anything that is not one."},"report":{"anyOf":[{"type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind","filters","topN"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"],"additionalProperties":false},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule","compareToPrevious"],"additionalProperties":false},{"type":"null"}],"description":"What a report renders and when. Null for anything else."},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterQuery":{"type":["string","null"]},"kind":{"type":"string","enum":["AUTOMATION","ALERT","REPORT"],"description":"What this automation is about: matching traces, a metric crossing a threshold, or a schedule."},"customGraphId":{"type":["string","null"]},"notificationCadence":{"type":["string","null"]},"traceDebounceMs":{"type":["number","null"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"additionalProperties":false,"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"active":{"type":"boolean"},"message":{"type":["string","null"]},"alertType":{"anyOf":[{"type":"string","enum":["CRITICAL","WARNING","INFO"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","action","actionParams","graphAlert","report","filters","filterQuery","kind","customGraphId","notificationCadence","traceDebounceMs","templates","active","message","alertType","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}}},"description":"List the project's automations, newest first. Paused automations are included.","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:view"]}},"post":{"operationId":"postApiTriggers","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["SEND_EMAIL","ADD_TO_DATASET","ADD_TO_ANNOTATION_QUEUE","SEND_SLACK_MESSAGE","SEND_WEBHOOK"]},"actionParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Where this automation delivers, with every credential value replaced by the `[redacted]` placeholder. Which channel is configured, which destination is set and which header names are in play all survive; the values never leave; a Slack automation names its connection by `slackIntegrationId` and carries no secret. Sending the placeholder back on an update keeps the stored value. The rule this automation fires by is not here: it is stated in `graphAlert` or `report`, and sending it in this field is refused."},"graphAlert":{"anyOf":[{"type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"],"additionalProperties":false},{"type":"null"}],"description":"The rule an alert fires by. Null for anything that is not one."},"report":{"anyOf":[{"type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind","filters","topN"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"],"additionalProperties":false},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule","compareToPrevious"],"additionalProperties":false},{"type":"null"}],"description":"What a report renders and when. Null for anything else."},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterQuery":{"type":["string","null"]},"kind":{"type":"string","enum":["AUTOMATION","ALERT","REPORT"],"description":"What this automation is about: matching traces, a metric crossing a threshold, or a schedule."},"customGraphId":{"type":["string","null"]},"notificationCadence":{"type":["string","null"]},"traceDebounceMs":{"type":["number","null"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"additionalProperties":false,"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"active":{"type":"boolean"},"message":{"type":["string","null"]},"alertType":{"anyOf":[{"type":"string","enum":["CRITICAL","WARNING","INFO"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","action","actionParams","graphAlert","report","filters","filterQuery","kind","customGraphId","notificationCadence","traceDebounceMs","templates","active","message","alertType","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Create an automation. Send `customGraphId` + `graphAlert` for an alert on a metric, `report` for a scheduled report, or conditions for a trace automation. The delivery channel is fixed at creation.","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"SEND_EMAIL"},"actionParams":{"type":"object","properties":{"members":{"minItems":1,"type":"array","items":{"type":"string"},"description":"Who receives the email. Any address, not only teammates."}},"required":["members"],"additionalProperties":{},"description":"Email delivery."},"name":{"type":"string","minLength":1},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}},"filterQuery":{"description":"The trace query this automation is about, in the syntax the traces view uses. When set it supersedes `filters`.","type":["string","null"]},"message":{"type":"string"},"alertType":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"customGraphId":{"description":"Set to make this an alert on that graph. `graphAlert` and `alertType` are then required.","type":"string"},"graphAlert":{"description":"The rule an alert fires by: series, operator, threshold, window.","type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"]},"report":{"description":"What a scheduled report renders and when it sends.","type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"]},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"]},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind"]}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"]},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"notificationCadence":{"type":"string","enum":["immediate","5min_digest","15min_digest","hourly_digest"],"description":"How often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace."},"traceDebounceMs":{"type":"integer","minimum":0,"maximum":600000,"description":"How long to wait for a trace to settle before the conditions are read."}},"required":["action","actionParams","name"]},{"type":"object","properties":{"action":{"type":"string","const":"SEND_SLACK_MESSAGE"},"actionParams":{"type":"object","properties":{"slackIntegrationId":{"description":"The Slack connection this automation posts through: an organization connection or one of this project's, listed under Settings, Integrations, Slack. A bot connection also needs `slackChannelId`; a webhook connection needs nothing else. Preferred over `slackWebhook` and `slackBotToken`, and what a read returns in their place.","type":"string"},"slackDelivery":{"description":"How the message reaches Slack. `webhook` posts to an incoming webhook URL, `bot` posts as the LangWatch Slack app. With `slackIntegrationId` it follows the connection's kind. Absent without a connection means `webhook`.","type":"string","enum":["webhook","bot"]},"slackWebhook":{"description":"Legacy, accepted for one release: an incoming webhook URL, for `webhook` delivery. It is stored as a Slack connection (an existing one holding the same URL, else a new project connection) and the automation keeps only that connection's id. Send `slackIntegrationId` instead.","type":"string"},"slackChannelId":{"description":"The channel the bot posts in, for a bot connection or `bot` delivery. Invite the LangWatch app to it first.","type":"string"},"slackBotToken":{"description":"Legacy, accepted for one release: a bot token, for `bot` delivery. It is stored as a Slack connection (an existing one holding the same token, else a new project connection) and never reads back. Send `slackIntegrationId` instead.","type":"string"},"slackBotTokenSet":{"description":"Legacy and ignored: no read returns it. An update that retypes no secret moves an automation's own stored secret into a connection.","type":"boolean"}},"additionalProperties":{},"description":"Slack delivery through a Slack connection (`slackIntegrationId`), plus `slackChannelId` when the connection is a bot."},"name":{"type":"string","minLength":1},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}},"filterQuery":{"description":"The trace query this automation is about, in the syntax the traces view uses. When set it supersedes `filters`.","type":["string","null"]},"message":{"type":"string"},"alertType":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"customGraphId":{"description":"Set to make this an alert on that graph. `graphAlert` and `alertType` are then required.","type":"string"},"graphAlert":{"description":"The rule an alert fires by: series, operator, threshold, window.","type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"]},"report":{"description":"What a scheduled report renders and when it sends.","type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"]},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"]},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind"]}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"]},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"notificationCadence":{"type":"string","enum":["immediate","5min_digest","15min_digest","hourly_digest"],"description":"How often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace."},"traceDebounceMs":{"type":"integer","minimum":0,"maximum":600000,"description":"How long to wait for a trace to settle before the conditions are read."}},"required":["action","actionParams","name"]},{"type":"object","properties":{"action":{"type":"string","const":"SEND_WEBHOOK"},"actionParams":{"type":"object","properties":{"url":{"type":"string","description":"Where the request goes. https only, and not a private host."},"method":{"description":"The HTTP method. Absent means POST.","type":"string","enum":["POST","PUT","PATCH"]},"headers":{"description":"Static headers sent with every delivery. The values are credentials: they read back as the placeholder, and sending the placeholder back keeps the stored ones. Changing `url` means sending the values again in the same request.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"bodyTemplate":{"description":"A Liquid template for the body. Absent sends the standard LangWatch envelope for a JSON content type, and an empty body for any other.","type":["string","null"]},"contentType":{"description":"The `Content-Type` the delivery announces, which also decides how the body is treated: `application/json` (and any `+json` type) is checked and re-serialised; any other media type sends the rendered template verbatim. Absent means `application/json`.","type":"string"},"signingSecret":{"description":"Signs every delivery so the receiver can verify it came from LangWatch. A credential: it reads back as the placeholder, and sending the placeholder back keeps the stored one.","type":["string","null"]}},"required":["url"],"additionalProperties":{},"description":"Delivery to a customer endpoint over HTTP, with a body in any media type."},"name":{"type":"string","minLength":1},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}},"filterQuery":{"description":"The trace query this automation is about, in the syntax the traces view uses. When set it supersedes `filters`.","type":["string","null"]},"message":{"type":"string"},"alertType":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"customGraphId":{"description":"Set to make this an alert on that graph. `graphAlert` and `alertType` are then required.","type":"string"},"graphAlert":{"description":"The rule an alert fires by: series, operator, threshold, window.","type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"]},"report":{"description":"What a scheduled report renders and when it sends.","type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"]},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"]},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind"]}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"]},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"notificationCadence":{"type":"string","enum":["immediate","5min_digest","15min_digest","hourly_digest"],"description":"How often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace."},"traceDebounceMs":{"type":"integer","minimum":0,"maximum":600000,"description":"How long to wait for a trace to settle before the conditions are read."}},"required":["action","actionParams","name"]},{"type":"object","properties":{"action":{"type":"string","const":"ADD_TO_DATASET"},"actionParams":{"type":"object","properties":{"datasetId":{"type":"string","description":"The dataset matched traces are appended to."},"datasetMapping":{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expansions":{"type":"array","items":{"type":"string"}}},"required":["mapping"],"description":"How a trace becomes a row in that dataset."}},"required":["datasetId","datasetMapping"],"additionalProperties":{},"description":"Append matched traces to a dataset."},"name":{"type":"string","minLength":1},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}},"filterQuery":{"description":"The trace query this automation is about, in the syntax the traces view uses. When set it supersedes `filters`.","type":["string","null"]},"message":{"type":"string"},"alertType":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"customGraphId":{"description":"Set to make this an alert on that graph. `graphAlert` and `alertType` are then required.","type":"string"},"graphAlert":{"description":"The rule an alert fires by: series, operator, threshold, window.","type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"]},"report":{"description":"What a scheduled report renders and when it sends.","type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"]},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"]},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind"]}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"]},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"notificationCadence":{"type":"string","enum":["immediate","5min_digest","15min_digest","hourly_digest"],"description":"How often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace."},"traceDebounceMs":{"type":"integer","minimum":0,"maximum":600000,"description":"How long to wait for a trace to settle before the conditions are read."}},"required":["action","actionParams","name"]},{"type":"object","properties":{"action":{"type":"string","const":"ADD_TO_ANNOTATION_QUEUE"},"actionParams":{"type":"object","properties":{"annotators":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Who the queued items go to."}},"required":["annotators"],"additionalProperties":{},"description":"Queue matched traces for a person to label."},"name":{"type":"string","minLength":1},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}},"filterQuery":{"description":"The trace query this automation is about, in the syntax the traces view uses. When set it supersedes `filters`.","type":["string","null"]},"message":{"type":"string"},"alertType":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"customGraphId":{"description":"Set to make this an alert on that graph. `graphAlert` and `alertType` are then required.","type":"string"},"graphAlert":{"description":"The rule an alert fires by: series, operator, threshold, window.","type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"]},"report":{"description":"What a scheduled report renders and when it sends.","type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"]},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"]},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind"]}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"]},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"notificationCadence":{"type":"string","enum":["immediate","5min_digest","15min_digest","hourly_digest"],"description":"How often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace."},"traceDebounceMs":{"type":"integer","minimum":0,"maximum":600000,"description":"How long to wait for a trace to settle before the conditions are read."}},"required":["action","actionParams","name"]}]}}}}}},"/api/v1/triggers/{triggerId}":{"get":{"operationId":"getApiTriggersById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["SEND_EMAIL","ADD_TO_DATASET","ADD_TO_ANNOTATION_QUEUE","SEND_SLACK_MESSAGE","SEND_WEBHOOK"]},"actionParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Where this automation delivers, with every credential value replaced by the `[redacted]` placeholder. Which channel is configured, which destination is set and which header names are in play all survive; the values never leave; a Slack automation names its connection by `slackIntegrationId` and carries no secret. Sending the placeholder back on an update keeps the stored value. The rule this automation fires by is not here: it is stated in `graphAlert` or `report`, and sending it in this field is refused."},"graphAlert":{"anyOf":[{"type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"],"additionalProperties":false},{"type":"null"}],"description":"The rule an alert fires by. Null for anything that is not one."},"report":{"anyOf":[{"type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind","filters","topN"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"],"additionalProperties":false},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule","compareToPrevious"],"additionalProperties":false},{"type":"null"}],"description":"What a report renders and when. Null for anything else."},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterQuery":{"type":["string","null"]},"kind":{"type":"string","enum":["AUTOMATION","ALERT","REPORT"],"description":"What this automation is about: matching traces, a metric crossing a threshold, or a schedule."},"customGraphId":{"type":["string","null"]},"notificationCadence":{"type":["string","null"]},"traceDebounceMs":{"type":["number","null"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"additionalProperties":false,"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"active":{"type":"boolean"},"message":{"type":["string","null"]},"alertType":{"anyOf":[{"type":"string","enum":["CRITICAL","WARNING","INFO"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","action","actionParams","graphAlert","report","filters","filterQuery","kind","customGraphId","notificationCadence","traceDebounceMs","templates","active","message","alertType","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Get a trigger by its ID","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:view"]},"parameters":[{"in":"path","name":"triggerId","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiTriggersById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["SEND_EMAIL","ADD_TO_DATASET","ADD_TO_ANNOTATION_QUEUE","SEND_SLACK_MESSAGE","SEND_WEBHOOK"]},"actionParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Where this automation delivers, with every credential value replaced by the `[redacted]` placeholder. Which channel is configured, which destination is set and which header names are in play all survive; the values never leave; a Slack automation names its connection by `slackIntegrationId` and carries no secret. Sending the placeholder back on an update keeps the stored value. The rule this automation fires by is not here: it is stated in `graphAlert` or `report`, and sending it in this field is refused."},"graphAlert":{"anyOf":[{"type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"],"additionalProperties":false},{"type":"null"}],"description":"The rule an alert fires by. Null for anything that is not one."},"report":{"anyOf":[{"type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind","filters","topN"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"],"additionalProperties":false},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule","compareToPrevious"],"additionalProperties":false},{"type":"null"}],"description":"What a report renders and when. Null for anything else."},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterQuery":{"type":["string","null"]},"kind":{"type":"string","enum":["AUTOMATION","ALERT","REPORT"],"description":"What this automation is about: matching traces, a metric crossing a threshold, or a schedule."},"customGraphId":{"type":["string","null"]},"notificationCadence":{"type":["string","null"]},"traceDebounceMs":{"type":["number","null"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"additionalProperties":false,"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"active":{"type":"boolean"},"message":{"type":["string","null"]},"alertType":{"anyOf":[{"type":"string","enum":["CRITICAL","WARNING","INFO"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","action","actionParams","graphAlert","report","filters","filterQuery","kind","customGraphId","notificationCadence","traceDebounceMs","templates","active","message","alertType","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Update an automation. Every field is optional and what is left out is left alone, except `actionParams`, which replaces the delivery configuration as a whole. The delivery channel and an alert's graph cannot be changed.","tags":["Triggers"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"active":{"type":"boolean"},"message":{"type":["string","null"]},"alertType":{"anyOf":[{"type":"string","enum":["CRITICAL","WARNING","INFO"]},{"type":"null"}]},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}},"filterQuery":{"description":"The trace query this automation is about, in the syntax the traces view uses. When set it supersedes `filters`.","type":["string","null"]},"action":{"type":"string","enum":["SEND_EMAIL","ADD_TO_DATASET","ADD_TO_ANNOTATION_QUEUE","SEND_SLACK_MESSAGE","SEND_WEBHOOK"]},"customGraphId":{"description":"The graph this alert watches, which an update cannot change. Accepted so that writing the read response back works; a different graph is refused. Create an alert on the other graph and delete this one.","type":["string","null"]},"actionParams":{"description":"Replaces the delivery configuration as a whole rather than merging into it: send the fields this automation should have from now on, and anything left out is removed. The one exception is a credential the read hid: send back the `[redacted]` placeholder and the stored credential is kept (a Slack automation not yet on a connection has its stored secret moved into one), so reading an automation, changing one field and writing the whole object back is safe. Only this channel's fields are accepted; anything else is refused rather than dropped, and the rule this automation fires by belongs in `graphAlert` or `report`.","anyOf":[{"type":"object","properties":{"members":{"minItems":1,"type":"array","items":{"type":"string"},"description":"Who receives the email. Any address, not only teammates."}},"required":["members"],"additionalProperties":{},"description":"Email delivery."},{"type":"object","properties":{"slackIntegrationId":{"description":"The Slack connection this automation posts through: an organization connection or one of this project's, listed under Settings, Integrations, Slack. A bot connection also needs `slackChannelId`; a webhook connection needs nothing else. Preferred over `slackWebhook` and `slackBotToken`, and what a read returns in their place.","type":"string"},"slackDelivery":{"description":"How the message reaches Slack. `webhook` posts to an incoming webhook URL, `bot` posts as the LangWatch Slack app. With `slackIntegrationId` it follows the connection's kind. Absent without a connection means `webhook`.","type":"string","enum":["webhook","bot"]},"slackWebhook":{"description":"Legacy, accepted for one release: an incoming webhook URL, for `webhook` delivery. It is stored as a Slack connection (an existing one holding the same URL, else a new project connection) and the automation keeps only that connection's id. Send `slackIntegrationId` instead.","type":"string"},"slackChannelId":{"description":"The channel the bot posts in, for a bot connection or `bot` delivery. Invite the LangWatch app to it first.","type":"string"},"slackBotToken":{"description":"Legacy, accepted for one release: a bot token, for `bot` delivery. It is stored as a Slack connection (an existing one holding the same token, else a new project connection) and never reads back. Send `slackIntegrationId` instead.","type":"string"},"slackBotTokenSet":{"description":"Legacy and ignored: no read returns it. An update that retypes no secret moves an automation's own stored secret into a connection.","type":"boolean"}},"additionalProperties":{},"description":"Slack delivery through a Slack connection (`slackIntegrationId`), plus `slackChannelId` when the connection is a bot."},{"type":"object","properties":{"url":{"type":"string","description":"Where the request goes. https only, and not a private host."},"method":{"description":"The HTTP method. Absent means POST.","type":"string","enum":["POST","PUT","PATCH"]},"headers":{"description":"Static headers sent with every delivery. The values are credentials: they read back as the placeholder, and sending the placeholder back keeps the stored ones. Changing `url` means sending the values again in the same request.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"bodyTemplate":{"description":"A Liquid template for the body. Absent sends the standard LangWatch envelope for a JSON content type, and an empty body for any other.","type":["string","null"]},"contentType":{"description":"The `Content-Type` the delivery announces, which also decides how the body is treated: `application/json` (and any `+json` type) is checked and re-serialised; any other media type sends the rendered template verbatim. Absent means `application/json`.","type":"string"},"signingSecret":{"description":"Signs every delivery so the receiver can verify it came from LangWatch. A credential: it reads back as the placeholder, and sending the placeholder back keeps the stored one.","type":["string","null"]}},"required":["url"],"additionalProperties":{},"description":"Delivery to a customer endpoint over HTTP, with a body in any media type."},{"type":"object","properties":{"datasetId":{"type":"string","description":"The dataset matched traces are appended to."},"datasetMapping":{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expansions":{"type":"array","items":{"type":"string"}}},"required":["mapping"],"description":"How a trace becomes a row in that dataset."}},"required":["datasetId","datasetMapping"],"additionalProperties":{},"description":"Append matched traces to a dataset."},{"type":"object","properties":{"annotators":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Who the queued items go to."}},"required":["annotators"],"additionalProperties":{},"description":"Queue matched traces for a person to label."}]},"graphAlert":{"description":"The rule this alert fires by. Only for an automation that is one.","type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"]},"report":{"description":"What this report renders and when. Only for one that is a report.","type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"]},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"]},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind"]}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"]},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"notificationCadence":{"type":"string","enum":["immediate","5min_digest","15min_digest","hourly_digest"],"description":"How often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace."},"traceDebounceMs":{"type":"integer","minimum":0,"maximum":600000,"description":"How long to wait for a trace to settle before the conditions are read."}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:update"]},"parameters":[{"in":"path","name":"triggerId","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiTriggersById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Delete (soft-delete) a trigger","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:manage"]},"parameters":[{"in":"path","name":"triggerId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/triggers/{triggerId}/fires":{"get":{"operationId":"getApiTriggersByIdFires","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"fires":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"triggerId":{"type":"string"},"customGraphId":{"type":["string","null"]},"firedAt":{"type":"string"},"resolvedAt":{"type":["string","null"]}},"required":["id","triggerId","customGraphId","firedAt","resolvedAt"],"additionalProperties":false},"description":"One page of fires, newest first."},"nextCursor":{"description":"Pass as `cursor` to read the page after this one. Null on the last page.","type":["string","null"]}},"required":["fires","nextCursor"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"What this automation has done: its fires, newest first. Metadata only (no trace ids and no trace content). Send `nextCursor` back as `cursor` to read the page after this one.","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:view"]},"parameters":[{"in":"path","name":"triggerId","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"},"description":"The `nextCursor` from the previous page. Omit for the newest fires."}]}},"/api/v1/triggers/{triggerId}/enable":{"post":{"operationId":"postApiTriggersByIdEnable","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["SEND_EMAIL","ADD_TO_DATASET","ADD_TO_ANNOTATION_QUEUE","SEND_SLACK_MESSAGE","SEND_WEBHOOK"]},"actionParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Where this automation delivers, with every credential value replaced by the `[redacted]` placeholder. Which channel is configured, which destination is set and which header names are in play all survive; the values never leave; a Slack automation names its connection by `slackIntegrationId` and carries no secret. Sending the placeholder back on an update keeps the stored value. The rule this automation fires by is not here: it is stated in `graphAlert` or `report`, and sending it in this field is refused."},"graphAlert":{"anyOf":[{"type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"],"additionalProperties":false},{"type":"null"}],"description":"The rule an alert fires by. Null for anything that is not one."},"report":{"anyOf":[{"type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind","filters","topN"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"],"additionalProperties":false},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule","compareToPrevious"],"additionalProperties":false},{"type":"null"}],"description":"What a report renders and when. Null for anything else."},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterQuery":{"type":["string","null"]},"kind":{"type":"string","enum":["AUTOMATION","ALERT","REPORT"],"description":"What this automation is about: matching traces, a metric crossing a threshold, or a schedule."},"customGraphId":{"type":["string","null"]},"notificationCadence":{"type":["string","null"]},"traceDebounceMs":{"type":["number","null"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"additionalProperties":false,"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"active":{"type":"boolean"},"message":{"type":["string","null"]},"alertType":{"anyOf":[{"type":"string","enum":["CRITICAL","WARNING","INFO"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","action","actionParams","graphAlert","report","filters","filterQuery","kind","customGraphId","notificationCadence","traceDebounceMs","templates","active","message","alertType","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Resume a paused automation. A report goes back on its schedule; the pause record is cleared.","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:update"]},"parameters":[{"in":"path","name":"triggerId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/triggers/{triggerId}/disable":{"post":{"operationId":"postApiTriggersByIdDisable","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["SEND_EMAIL","ADD_TO_DATASET","ADD_TO_ANNOTATION_QUEUE","SEND_SLACK_MESSAGE","SEND_WEBHOOK"]},"actionParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Where this automation delivers, with every credential value replaced by the `[redacted]` placeholder. Which channel is configured, which destination is set and which header names are in play all survive; the values never leave; a Slack automation names its connection by `slackIntegrationId` and carries no secret. Sending the placeholder back on an update keeps the stored value. The rule this automation fires by is not here: it is stated in `graphAlert` or `report`, and sending it in this field is refused."},"graphAlert":{"anyOf":[{"type":"object","properties":{"threshold":{"type":"number"},"operator":{"type":"string","enum":["gt","lt","gte","lte","eq"]},"timePeriod":{"anyOf":[{"type":"number","const":1},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60},{"type":"number","const":1440}]},"seriesName":{"type":"string","minLength":1}},"required":["threshold","operator","timePeriod","seriesName"],"additionalProperties":false},{"type":"null"}],"description":"The rule an alert fires by. Null for anything that is not one."},"report":{"anyOf":[{"type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"dashboard"},"dashboardId":{"type":"string","minLength":1}},"required":["kind","dashboardId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"customGraph"},"customGraphId":{"type":"string","minLength":1}},"required":["kind","customGraphId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"traceQuery"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"metric":{"type":"string"},"topN":{"default":5,"type":"integer","minimum":1,"maximum":100}},"required":["kind","filters","topN"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"cron":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["cron","timezone"],"additionalProperties":false},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["source","schedule","compareToPrevious"],"additionalProperties":false},{"type":"null"}],"description":"What a report renders and when. Null for anything else."},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filterQuery":{"type":["string","null"]},"kind":{"type":"string","enum":["AUTOMATION","ALERT","REPORT"],"description":"What this automation is about: matching traces, a metric crossing a threshold, or a schedule."},"customGraphId":{"type":["string","null"]},"notificationCadence":{"type":["string","null"]},"traceDebounceMs":{"type":["number","null"]},"templates":{"type":"object","properties":{"slackTemplateType":{"anyOf":[{"type":"string","enum":["string","block_kit"]},{"type":"null"}]},"slackTemplate":{"type":["string","null"]},"emailSubjectTemplate":{"type":["string","null"]},"emailBodyTemplate":{"type":["string","null"]}},"additionalProperties":false,"description":"The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel."},"active":{"type":"boolean"},"message":{"type":["string","null"]},"alertType":{"anyOf":[{"type":"string","enum":["CRITICAL","WARNING","INFO"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","action","actionParams","graphAlert","report","filters","filterQuery","kind","customGraphId","notificationCadence","traceDebounceMs","templates","active","message","alertType","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Pause an automation. A report stops claiming its schedule.","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:update"]},"parameters":[{"in":"path","name":"triggerId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/triggers/{triggerId}/test-fire":{"post":{"operationId":"postApiTriggersByIdTestFire","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["email","slack","webhook"]},"recipientCount":{"type":"number"},"usedDefault":{"type":"boolean","description":"Whether the LangWatch default message was rendered because this automation states no template of its own."},"missingVariables":{"type":"array","items":{"type":"string"}},"errors":{"type":"array","items":{"type":"string"}},"httpStatus":{"description":"Webhook only: what the endpoint answered with.","type":"number"}},"required":["channel","recipientCount","usedDefault","missingVariables","errors"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Send this automation's message to the destination it is configured with, so you can confirm it arrives. Nothing is recorded as a fire.","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:update"]},"parameters":[{"in":"path","name":"triggerId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/trigger/slack":{"post":{"operationId":"postApiTriggerSlack","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"The body was not valid JSON","content":{}},"401":{"description":"Missing or invalid API key","content":{}},"403":{"description":"The API key lacks triggers:manage","content":{}},"422":{"description":"The body failed validation, the connection is not one this project can use (`slack_integration_missing`), or a bot connection was named without `slack_channel_id` (`invalid_action_params`)","content":{}}},"description":"Create a trigger that posts to Slack when traces match its filters, through a Slack connection (`slack_connection_id`, plus `slack_channel_id` for a bot) or an incoming webhook URL (`slack_webhook`), which is stored as a connection. The trigger stores no secret of its own. The `/api/triggers` family supersedes this narrower form, which stays for callers written against it.","summary":"Create a Slack alert trigger","tags":["Triggers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["triggers:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slack_webhook":{"description":"Incoming webhook URL the alert is posted to. It is stored as a Slack connection this project can use (an existing one holding the same URL, else a new project connection). Send this or `slack_connection_id`, not both.","type":"string","format":"uri"},"slack_connection_id":{"description":"The Slack connection the alert posts through: an organization connection or one of this project's, as `GET /api/slack-connections` and `langwatch slack-connection list` list them. Send this or `slack_webhook`, not both.","type":"string","minLength":1},"slack_channel_id":{"description":"The channel a bot connection posts in; required with one. Invite the LangWatch app to it first.","type":"string","minLength":1},"name":{"type":"string","description":"How the trigger is listed in the app"},"message":{"description":"Extra line included with each alert","type":"string"},"filters":{"default":{},"description":"Which traces the trigger fires on. An empty object fires on all of them.","type":"object","propertyNames":{"type":"string","enum":["topics.topics","topics.subtopics","metadata.user_id","metadata.thread_id","metadata.customer_id","metadata.labels","metadata.key","metadata.value","metadata.prompt_ids","traces.origin","traces.error","traces.name","spans.type","spans.model","evaluations.evaluator_id","evaluations.evaluator_id.guardrails_only","evaluations.evaluator_id.has_passed","evaluations.evaluator_id.has_score","evaluations.evaluator_id.has_label","evaluations.passed","evaluations.score","evaluations.state","evaluations.label","events.event_type","events.metrics.key","events.metrics.value","events.event_details.key","annotations.hasAnnotation"]},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"properties":{"topics.topics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"topics.subtopics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.user_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.thread_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.customer_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.origin":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.error":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.name":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.model":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.guardrails_only":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.state":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_details.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"annotations.hasAnnotation":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}}},"alert_type":{"type":"string","enum":["CRITICAL","WARNING","INFO"]}},"required":["name","alert_type"]}}}}}},"/api/v1/unsubscribe":{"post":{"operationId":"confirmOneClickUnsubscribe","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"The token is missing, invalid or tampered with","content":{}},"429":{"description":"Too many unsubscribe attempts from this caller","content":{}}},"description":"Stop the automation named by the signed token in `token` from mailing this recipient.","summary":"RFC 8058 one-click unsubscribe","tags":["Triggers"],"security":[],"x-access-policy":{"kind":"public","credential":["none"]},"parameters":[{"in":"query","name":"token","schema":{"type":"string"}}]}},"/api/v1/webhooks/stripe":{"post":{"operationId":"receiveStripeWebhook","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","const":true}},"required":["received"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/octet-stream":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/coding-agent/sessions/{sessionId}/events":{"get":{"operationId":"getApiCodingAgentSessionsBySessionIdEvents","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"sessionId":{"type":"string"},"timeUnixMs":{"type":"number"},"recordId":{"type":"string"},"eventKind":{"type":"string"},"agent":{"type":"string"},"sessionKeySource":{"type":"string"},"traceId":{"type":"string"},"spanId":{"type":"string"},"promptId":{"type":"string"},"querySource":{"type":"string"},"agentType":{"type":"string"},"eventSequence":{"type":"number"},"requestId":{"type":"string"},"model":{"type":"string"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"costUsd":{"type":"number"},"durationMs":{"type":"number"},"ttftMs":{"type":"number"},"attempt":{"type":"number"},"speed":{"type":"string"},"stopReason":{"type":"string"},"preTokens":{"type":"number"},"postTokens":{"type":"number"},"compactionTrigger":{"type":"string"},"precomputeReuse":{"type":"string"},"statusCode":{"type":"string"},"errorType":{"type":"string"},"rateLimitCarrier":{"type":"string"},"retryDurationMs":{"type":"number"},"toolName":{"type":"string"},"success":{"type":"string"},"decision":{"type":"string"},"decisionSource":{"type":"string"},"toolInputBytes":{"type":"number"},"toolResultBytes":{"type":"number"},"promptChars":{"type":"number"},"totalTokens":{"type":"number"},"repositoryHost":{"type":"string"},"repositoryOwner":{"type":"string"},"repositoryName":{"type":"string"},"branch":{"type":"string"}},"required":["sessionId","timeUnixMs","recordId","eventKind","agent","sessionKeySource","traceId","spanId","promptId","querySource","agentType","eventSequence","requestId","model","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","costUsd","durationMs","ttftMs","attempt","speed","stopReason","preTokens","postTokens","compactionTrigger","precomputeReuse","statusCode","errorType","rateLimitCarrier","retryDurationMs","toolName","success","decision","decisionSource","toolInputBytes","toolResultBytes","promptChars","totalTokens","repositoryHost","repositoryOwner","repositoryName","branch"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["events","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"List a coding-agent session's events (model calls, compactions, rate limits, tool runs, prompts) in time order, keyset-paginated. Pass the previous response's nextCursor to continue; filter with kinds (comma-separated).","summary":"List coding agent session events","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]},"parameters":[{"in":"path","name":"sessionId","schema":{"type":"string","minLength":1},"required":true,"description":"The agent's own session id (session.id / conversation id)."},{"in":"query","name":"limit","schema":{"default":500,"type":"integer","exclusiveMinimum":0,"maximum":1000}},{"in":"query","name":"kinds","schema":{"type":"string"},"description":"Comma-separated event kinds to include. Known kinds: model_call, compaction, rate_limit, api_error, retries_exhausted, tool_result, tool_decision, user_prompt, subagent_completed."},{"in":"query","name":"from","schema":{"type":"number"},"description":"Epoch ms lower bound on event time; with `to`, prunes storage partitions for faster reads."},{"in":"query","name":"to","schema":{"type":"number"},"description":"Epoch ms upper bound on event time."},{"in":"query","name":"cursor","schema":{"type":"string"},"description":"Opaque keyset cursor from the previous response's nextCursor."}]}},"/api/coding-agent/pull-request-usage":{"get":{"operationId":"getApiCodingAgentPullRequestUsage","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"pullRequest":{"type":"object","properties":{"repositoryHost":{"type":"string"},"repositoryFullName":{"type":"string"},"prNumber":{"type":"number"},"headBranch":{"type":"string"},"htmlUrl":{"type":"string"},"state":{"type":"string"},"isDraft":{"type":"boolean"},"authorLogin":{"type":["string","null"]},"prCreatedAtMs":{"type":"number"},"prClosedAtMs":{"type":["number","null"]},"prMergedAtMs":{"type":["number","null"]}},"required":["repositoryHost","repositoryFullName","prNumber","headBranch","htmlUrl","state","isDraft","authorLogin","prCreatedAtMs","prClosedAtMs","prMergedAtMs"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"projectId":{"type":"string"},"projectSlug":{"type":"string"},"contributorLabel":{"type":"string"},"contributorIsProject":{"type":"boolean"},"agent":{"type":"string"},"models":{"type":"array","items":{"type":"string"}},"sessionsCount":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"totalTokens":{"type":"number"},"costUsd":{"type":["number","null"]},"billedCostUsd":{"type":["number","null"]},"nonBilledCostUsd":{"type":["number","null"]}},"required":["projectId","projectSlug","contributorLabel","contributorIsProject","agent","models","sessionsCount","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","totalTokens","costUsd","billedCostUsd","nonBilledCostUsd"],"additionalProperties":false}},"totals":{"type":"object","properties":{"sessionsCount":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"totalTokens":{"type":"number"},"costUsd":{"type":["number","null"]},"billedCostUsd":{"type":["number","null"]},"nonBilledCostUsd":{"type":["number","null"]}},"required":["sessionsCount","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","totalTokens","costUsd","billedCostUsd","nonBilledCostUsd"],"additionalProperties":false},"modelBreakdown":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"totalTokens":{"type":"number"},"costUsd":{"type":["number","null"]},"tokensKnown":{"type":"boolean"}},"required":["model","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","totalTokens","costUsd","tokensKnown"],"additionalProperties":false}}},"required":["pullRequest","rows","totals","modelBreakdown"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Assistant usage for one pull request: sessions, tokens and cost, grouped by contributor and agent, plus per-model totals, over the pull request's whole lifetime rather than a time window. Every row and the totals split cost three ways: the part priced per token, the part a bundled subscription already covers, and the list-price total of both. Per-model totals carry the list price only. Cost is calculated from the tokens the agent reported and LangWatch's model prices, so it estimates spend rather than restating a provider invoice. Requires a personal-project API key; rows appear only for projects the calling user may view, and cost only for those they may price.","summary":"Get pull request coding agent usage","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]},"parameters":[{"in":"query","name":"repository","schema":{"type":"string","pattern":"^[^/\\s]+\\/[^/\\s]+$"},"required":true,"description":"The repository as \"owner/name\". Case is folded by the mapping store."},{"in":"query","name":"pullRequest","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"required":true,"description":"The pull request number."},{"in":"query","name":"host","schema":{"type":"string","minLength":1},"description":"The repository's host, e.g. github.com."}]}},"/api/v1/coding-agent/pull-request-usage":{"get":{"operationId":"getPullRequestUsage","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"pullRequest":{"type":"object","properties":{"repositoryHost":{"type":"string"},"repositoryFullName":{"type":"string"},"prNumber":{"type":"number"},"headBranch":{"type":"string"},"htmlUrl":{"type":"string"},"state":{"type":"string"},"isDraft":{"type":"boolean"},"authorLogin":{"type":["string","null"]},"prCreatedAtMs":{"type":"number"},"prClosedAtMs":{"type":["number","null"]},"prMergedAtMs":{"type":["number","null"]}},"required":["repositoryHost","repositoryFullName","prNumber","headBranch","htmlUrl","state","isDraft","authorLogin","prCreatedAtMs","prClosedAtMs","prMergedAtMs"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"projectId":{"type":"string"},"projectSlug":{"type":"string"},"contributorLabel":{"type":"string"},"contributorIsProject":{"type":"boolean"},"agent":{"type":"string"},"models":{"type":"array","items":{"type":"string"}},"sessionsCount":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"totalTokens":{"type":"number"},"costUsd":{"type":["number","null"]},"billedCostUsd":{"type":["number","null"]},"nonBilledCostUsd":{"type":["number","null"]}},"required":["projectId","projectSlug","contributorLabel","contributorIsProject","agent","models","sessionsCount","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","totalTokens","costUsd","billedCostUsd","nonBilledCostUsd"],"additionalProperties":false}},"totals":{"type":"object","properties":{"sessionsCount":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"totalTokens":{"type":"number"},"costUsd":{"type":["number","null"]},"billedCostUsd":{"type":["number","null"]},"nonBilledCostUsd":{"type":["number","null"]}},"required":["sessionsCount","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","totalTokens","costUsd","billedCostUsd","nonBilledCostUsd"],"additionalProperties":false},"modelBreakdown":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheCreationTokens":{"type":"number"},"totalTokens":{"type":"number"},"costUsd":{"type":["number","null"]},"tokensKnown":{"type":"boolean"}},"required":["model","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","totalTokens","costUsd","tokensKnown"],"additionalProperties":false}}},"required":["pullRequest","rows","totals","modelBreakdown"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Assistant usage for one pull request: sessions, tokens and cost, grouped by contributor and agent, plus per-model totals, over the pull request's whole lifetime rather than a time window. Every row and the totals split cost three ways: the part priced per token, the part a bundled subscription already covers, and the list-price total of both. Per-model totals carry the list price only. Cost is calculated from the tokens the agent reported and LangWatch's model prices, so it estimates spend rather than restating a provider invoice. Authenticate with an organization API key and nothing else: no project id is sent anywhere. A key created for you reads with your own access; an organization service key, such as one a continuous integration job holds, reads with the access its bindings grant. Rows appear only for projects the key may view, and cost only for those it may price.","summary":"Get pull request coding agent usage","security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":[]},"parameters":[{"in":"query","name":"repository","schema":{"type":"string","pattern":"^[^/\\s]+\\/[^/\\s]+$"},"required":true,"description":"The repository as \"owner/name\". Case is folded by the mapping store."},{"in":"query","name":"pullRequest","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"required":true,"description":"The pull request number."},{"in":"query","name":"host","schema":{"type":"string","minLength":1},"description":"The repository's host, e.g. github.com."}]}},"/api/v1/dashboards":{"get":{"operationId":"getApiDashboards","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255},"order":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"},"graphCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","order","createdAt","updatedAt","platformUrl","graphCount"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}},"description":"List all dashboards for the project with graph counts","tags":["Dashboards"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]}},"post":{"operationId":"postApiDashboards","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255},"order":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"}},"required":["id","name","order","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Create a new dashboard","tags":["Dashboards"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"]}}}}}},"/api/v1/dashboards/reorder":{"put":{"operationId":"putApiDashboardsReorder","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}}},"description":"Reorder dashboards by providing an ordered list of IDs","tags":["Dashboards"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dashboardIds":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}}},"required":["dashboardIds"]}}}}}},"/api/v1/dashboards/{id}":{"get":{"operationId":"getApiDashboardsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255},"order":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"},"graphs":{"type":"array","items":{"type":"object","properties":{"gridColumn":{"type":"integer","minimum":0,"maximum":7},"gridRow":{"type":"integer","minimum":0,"maximum":2000000000},"colSpan":{"type":"integer","minimum":1,"maximum":8},"rowSpan":{"type":"integer","minimum":1,"maximum":20},"id":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"graph":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filters":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"dashboardId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["gridColumn","gridRow","colSpan","rowSpan","id","projectId","name","graph","filters","dashboardId","createdAt","updatedAt"],"additionalProperties":false}}},"required":["id","name","order","createdAt","updatedAt","platformUrl","graphs"],"additionalProperties":false}}}}},"description":"Get a dashboard by its id, including its graphs","tags":["Dashboards"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiDashboardsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255},"order":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"}},"required":["id","name","order","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Rename a dashboard","tags":["Dashboards"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"]}}}}},"delete":{"operationId":"deleteApiDashboardsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255}},"required":["id","name"],"additionalProperties":false}}}}},"description":"Delete a dashboard and its graphs (hard delete, cascade)","tags":["Dashboards"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/projects/{projectId}/analytics/dashboard-widgets":{"get":{"operationId":"getApiV1ProjectsByProjectIdAnalyticsDashboardWidgets","responses":{"200":{"description":"The project's dashboard widgets","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"code":{"type":"string"},"queries":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"type":{"type":"string","enum":["string","number","boolean"]},"default":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"}]}},"required":["name","type"],"additionalProperties":false}}},"required":["name","sql"],"additionalProperties":false}},"description":{"type":"string"},"prompt":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"catalogue"},"catalogueId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","catalogueId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"langy"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"code"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"api"}},"required":["kind"],"additionalProperties":false}]}},"required":["version","code","queries"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Lists every dashboard widget in this project, each with the React source file it renders and the named LangWatchQL queries it may run. Saved workbench charts and builder charts are different kinds and are not listed here.","summary":"List dashboard widgets","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}]},"post":{"operationId":"postApiV1ProjectsByProjectIdAnalyticsDashboardWidgets","responses":{"201":{"description":"The widget was saved","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"code":{"type":"string"},"queries":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"type":{"type":"string","enum":["string","number","boolean"]},"default":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"}]}},"required":["name","type"],"additionalProperties":false}}},"required":["name","sql"],"additionalProperties":false}},"description":{"type":"string"},"prompt":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"catalogue"},"catalogueId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","catalogueId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"langy"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"code"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"api"}},"required":["kind"],"additionalProperties":false}]}},"required":["version","code","queries"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Saves a React source file and the named LangWatchQL queries it runs as one dashboard widget, with an optional description the card shows behind its info icon and an optional prompt Langy is drafted with when asked about it. `source` records where the widget came from; without it, the widget is recorded as made through the API. The queries' shape is validated against the widget schema; their SQL is governed at run time by LW.query inside the sandbox, not at save.","summary":"Create a dashboard widget","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:create"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"type":"string","minLength":1,"maxLength":200000},"queries":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"type":{"type":"string","enum":["string","number","boolean"]},"default":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"}]}},"required":["name","type"]}}},"required":["name","sql"]}},"description":{"type":"string","minLength":1,"maxLength":2000},"prompt":{"type":"string","minLength":1,"maxLength":2000},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"catalogue"},"catalogueId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","catalogueId"]},{"type":"object","properties":{"kind":{"type":"string","const":"langy"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"code"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"api"}},"required":["kind"]}]}},"required":["name","code","queries"]}}}}}},"/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}":{"get":{"operationId":"getApiV1ProjectsByProjectIdAnalyticsDashboardWidgetsByWidgetId","responses":{"200":{"description":"The dashboard widget","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"code":{"type":"string"},"queries":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"type":{"type":"string","enum":["string","number","boolean"]},"default":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"}]}},"required":["name","type"],"additionalProperties":false}}},"required":["name","sql"],"additionalProperties":false}},"description":{"type":"string"},"prompt":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"catalogue"},"catalogueId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","catalogueId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"langy"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"code"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"api"}},"required":["kind"],"additionalProperties":false}]}},"required":["version","code","queries"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No dashboard widget with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Returns one dashboard widget with its React source and named queries. A widget saved in another project is reported as not found.","summary":"Get a dashboard widget","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"widgetId","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiV1ProjectsByProjectIdAnalyticsDashboardWidgetsByWidgetId","responses":{"200":{"description":"The updated widget","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"code":{"type":"string"},"queries":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"type":{"type":"string","enum":["string","number","boolean"]},"default":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"}]}},"required":["name","type"],"additionalProperties":false}}},"required":["name","sql"],"additionalProperties":false}},"description":{"type":"string"},"prompt":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"catalogue"},"catalogueId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","catalogueId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"langy"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"code"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"api"}},"required":["kind"],"additionalProperties":false}]}},"required":["version","code","queries"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No dashboard widget with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Changes a dashboard widget's name, code, queries, description or source. A field the body leaves out keeps its stored value, so code alone keeps the queries and the source is kept unless the body names one. A body with none of these fields is refused.","summary":"Update a dashboard widget","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"widgetId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"type":"string","minLength":1,"maxLength":200000},"queries":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"type":{"type":"string","enum":["string","number","boolean"]},"default":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"}]}},"required":["name","type"]}}},"required":["name","sql"]}},"description":{"type":"string","minLength":1,"maxLength":2000},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"catalogue"},"catalogueId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","catalogueId"]},{"type":"object","properties":{"kind":{"type":"string","const":"langy"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"code"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"api"}},"required":["kind"]}]}},"minProperties":1}}}}},"delete":{"operationId":"deleteApiV1ProjectsByProjectIdAnalyticsDashboardWidgetsByWidgetId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"204":{"description":"The widget was deleted","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No dashboard widget with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Deletes one dashboard widget. Answers 204 with no body; deleting a widget that is not in this project is reported as not found.","summary":"Delete a dashboard widget","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:delete"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"widgetId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}/dashboard":{"post":{"operationId":"postApiV1ProjectsByProjectIdAnalyticsDashboardWidgetsByWidgetIdDashboard","responses":{"200":{"description":"The widget was added to the dashboard","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"code":{"type":"string"},"queries":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"sql":{"type":"string","minLength":1,"maxLength":50000},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"type":{"type":"string","enum":["string","number","boolean"]},"default":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"}]}},"required":["name","type"],"additionalProperties":false}}},"required":["name","sql"],"additionalProperties":false}},"description":{"type":"string"},"prompt":{"type":"string"},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"catalogue"},"catalogueId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","catalogueId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"langy"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"code"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"api"}},"required":["kind"],"additionalProperties":false}]}},"required":["version","code","queries"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No dashboard widget with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Assigns a dashboard widget to a dashboard. The widget is repositioned to the next free row on that dashboard; its size (colSpan/rowSpan) is preserved.","summary":"Add a dashboard widget to a dashboard","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"widgetId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dashboardId":{"type":"string","minLength":1}},"required":["dashboardId"]}}}}}},"/api/v1/projects/{projectId}/analytics/boards":{"get":{"operationId":"getApiV1ProjectsByProjectIdAnalyticsBoards","responses":{"200":{"description":"The project's Dashboards boards","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":["string","null"]},"scope":{"type":"string","enum":["PRIVATE","PROJECT","ORGANIZATION"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"widgetCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","description","scope","createdAt","updatedAt","platformUrl","widgetCount"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Lists this project's boards in the Dashboards area, each with how many widgets it holds. Pass a board's id to the dashboard widget's add-to-dashboard endpoint to place a widget on it. Analytics Reports boards are listed by /api/v1/dashboards instead.","summary":"List Dashboards boards","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/projects/{projectId}/analytics/boards/{boardId}":{"get":{"operationId":"getApiV1ProjectsByProjectIdAnalyticsBoardsByBoardId","responses":{"200":{"description":"The Dashboards board","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":["string","null"]},"scope":{"type":"string","enum":["PRIVATE","PROJECT","ORGANIZATION"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"}},"required":["id","name","description","scope","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No Dashboards board with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Returns one board of the Dashboards area. A board saved in another project, or one only Analytics Reports holds, is reported as not found.","summary":"Get a Dashboards board","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"boardId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/graphs":{"get":{"operationId":"getApiGraphs","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"graph":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filters":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"number"},"gridRow":{"type":"number"},"colSpan":{"type":"number"},"rowSpan":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","graph","filters","dashboardId","gridColumn","gridRow","colSpan","rowSpan","createdAt","updatedAt"],"additionalProperties":false}}}}}},"description":"List all custom graphs, optionally filtered by dashboard","tags":["Graphs"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"query","name":"dashboardId","schema":{"type":"string"}}]},"post":{"operationId":"postApiGraphs","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"graph":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filters":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"number"},"gridRow":{"type":"number"},"colSpan":{"type":"number"},"rowSpan":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","graph","filters","dashboardId","gridColumn","gridRow","colSpan","rowSpan","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Create a custom graph on a dashboard","tags":["Graphs"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"graph":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"dashboardId":{"type":"string"},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"gridColumn":{"type":"number","minimum":0,"maximum":1},"gridRow":{"type":"number","minimum":0},"colSpan":{"type":"number","minimum":1,"maximum":2},"rowSpan":{"type":"number","minimum":1,"maximum":2}},"required":["name","graph"]}}}}}},"/api/v1/graphs/{id}":{"get":{"operationId":"getApiGraphsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"graph":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filters":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"number"},"gridRow":{"type":"number"},"colSpan":{"type":"number"},"rowSpan":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","graph","filters","dashboardId","gridColumn","gridRow","colSpan","rowSpan","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Get a custom graph by its ID","tags":["Graphs"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiGraphsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"graph":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filters":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"number"},"gridRow":{"type":"number"},"colSpan":{"type":"number"},"rowSpan":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","graph","filters","dashboardId","gridColumn","gridRow","colSpan","rowSpan","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Update a custom graph's name, definition, or filters","tags":["Graphs"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"graph":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiGraphsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false}}}}},"description":"Delete a custom graph","tags":["Graphs"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/projects/{projectId}/analytics/charts":{"get":{"operationId":"getApiV1ProjectsByProjectIdAnalyticsCharts","responses":{"200":{"description":"The project's saved workbench charts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"sql":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"vegaLiteSpec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["version","sql","parameters"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"]}}},"required":["data"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Lists every saved LangWatchQL chart in this project, each with the statement it runs, the parameter values it was saved with and the Vega-Lite specification that draws it. Charts built with the chart builder are a different kind and are not listed here.","summary":"List saved workbench charts","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}]},"post":{"operationId":"postApiV1ProjectsByProjectIdAnalyticsCharts","responses":{"201":{"description":"The chart was saved","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"sql":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"vegaLiteSpec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["version","sql","parameters"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Saves a LangWatchQL statement, its bound parameter values and an optional Vega-Lite specification as one chart. The statement is validated by the LangWatchQL analytics SQL validator against this key's own permissions, and the specification by the visualization policy, before anything is written — a chart that could not be run or drawn is refused rather than stored.","summary":"Save a workbench chart","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:create"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"definition":{}},"required":["name"]}}}}}},"/api/v1/projects/{projectId}/analytics/charts/{chartId}":{"get":{"operationId":"getApiV1ProjectsByProjectIdAnalyticsChartsByChartId","responses":{"200":{"description":"The saved chart","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"sql":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"vegaLiteSpec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["version","sql","parameters"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No chart with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Returns one saved LangWatchQL chart with its statement, parameter values and specification. A chart saved in another project is reported as not found.","summary":"Get a saved workbench chart","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"chartId","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiV1ProjectsByProjectIdAnalyticsChartsByChartId","responses":{"200":{"description":"The updated chart","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"sql":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"vegaLiteSpec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["version","sql","parameters"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No chart with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Replaces a saved chart's name, its definition, or both. A definition offered here passes exactly the validators a save passes, resolved against this key's current permissions — so a chart cannot be edited into naming a column the caller may no longer read. A request carrying neither field is refused.","summary":"Update a saved workbench chart","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"chartId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"definition":{}},"minProperties":1}}}}},"delete":{"operationId":"deleteApiV1ProjectsByProjectIdAnalyticsChartsByChartId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"204":{"description":"The chart was deleted","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No chart with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Deletes one saved LangWatchQL chart. Answers 204 with no body; deleting a chart that is not in this project is reported as not found.","summary":"Delete a saved workbench chart","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:delete"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"chartId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/projects/{projectId}/analytics/charts/{chartId}/placement":{"put":{"operationId":"putApiV1ProjectsByProjectIdAnalyticsChartsByChartIdPlacement","responses":{"200":{"description":"The chart, now placed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"version":{"type":"number"},"sql":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"vegaLiteSpec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["version","sql","parameters"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string"},"dashboardId":{"type":["string","null"]},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","definition","createdAt","updatedAt","platformUrl","dashboardId","gridColumn","gridRow","colSpan","rowSpan"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No chart with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Places one saved LangWatchQL chart on a dashboard in the same project, at the grid position supplied — or, when no grid row is given, at the next row free on that dashboard, counting charts of every kind. A dashboard that is not in this project is reported as not found, exactly like a chart that is not, and nothing is written.","summary":"Place a saved workbench chart on a dashboard","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"chartId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dashboardId":{"type":"string","minLength":1},"gridColumn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gridRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rowSpan":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["dashboardId"]}}}}},"delete":{"operationId":"deleteApiV1ProjectsByProjectIdAnalyticsChartsByChartIdPlacement","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"204":{"description":"The chart is no longer on any dashboard","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"404":{"description":"No chart with this id in this project","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Removes one saved LangWatchQL chart from whatever dashboard it is on, clearing its grid position along with the dashboard id. Idempotent: unplacing a chart that is not placed answers 204 all the same. The chart itself — its statement, parameter values and specification — is untouched.","summary":"Remove a saved workbench chart from its dashboard","tags":["Analytics / LangWatchQL"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:update"]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"chartId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/dataset":{"get":{"operationId":"getApiDataset","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","slug","columnTypes","createdAt","updatedAt","platformUrl","recordCount"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}}},"description":"List all non-archived datasets for the project (paginated)","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:view"]},"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":1000}}]},"post":{"operationId":"postApiDataset","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"}},"required":["id","name","slug","columnTypes","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Create a new dataset","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"columnTypes":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"]}}},"required":["name"]}}}}}},"/api/v1/dataset/{slugOrId}/records":{"post":{"operationId":"postApiDatasetBySlugOrIdRecords","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"datasetId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","datasetId","projectId","entry","createdAt","updatedAt"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}},"description":"Create records in a dataset in batch","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:update"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"minItems":1,"maxItems":4000,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["entries"]}}}}},"get":{"operationId":"getApiDatasetBySlugOrIdRecords","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"datasetId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","datasetId","projectId","entry","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false},"dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"}},"required":["id","name","slug","columnTypes","createdAt","updatedAt","platformUrl"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}}},"description":"List records for a dataset (paginated). Each page also carries the dataset itself. A page too large for one response is refused with `dataset_page_too_large`: ask again with the smaller `limit` the error names.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:view"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true},{"in":"query","name":"page","schema":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":1000}}]},"delete":{"operationId":"deleteApiDatasetBySlugOrIdRecords","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deletedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["deletedCount"],"additionalProperties":false}}}}},"description":"Delete records from a dataset by IDs","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:manage"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recordIds":{"minItems":1,"maxItems":4000,"type":"array","items":{"type":"string"}}},"required":["recordIds"]}}}}}},"/api/v1/dataset/{datasetSlug}/entries":{"post":{"operationId":"postApiDatasetBySlugEntries","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}}},"description":"Add entries to a dataset","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:update"]},"parameters":[{"in":"path","name":"datasetSlug","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetPostEntries"}}}}},"get":{"operationId":"getApiDatasetBySlugEntries","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"datasetId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","datasetId","projectId","entry","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false},"dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"}},"required":["id","name","slug","columnTypes","createdAt","updatedAt","platformUrl"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}}},"description":"List entries of a dataset (paginated). Same as GET /:slugOrId/records.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:view"]},"parameters":[{"in":"path","name":"datasetSlug","schema":{"type":"string"},"required":true},{"in":"query","name":"page","schema":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":1000}}]}},"/api/v1/dataset/imports":{"post":{"operationId":"postApiDatasetImports","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","const":"processing"}},"required":["datasetId","slug","status"],"additionalProperties":false}}}}},"description":"Create a dataset from an uploaded and confirmed file","summary":"Create a dataset from an uploaded file","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetImport"}}}}}},"/api/v1/dataset/{slugOrId}/imports":{"post":{"operationId":"postApiDatasetBySlugOrIdImports","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"recordsCreated":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["datasetId","recordsCreated"],"additionalProperties":false}}}}},"description":"Add an uploaded and confirmed file's rows to a dataset","summary":"Import an uploaded file into a dataset","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:update"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetAppendImport"}}}}}},"/api/v1/dataset/upload":{"post":{"operationId":"postApiDatasetUpload","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"recordsCreated":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","slug","columnTypes","createdAt","updatedAt","recordsCreated"],"additionalProperties":false}}}}},"description":"Create a new dataset from an uploaded file (CSV, JSON, JSONL) upload the file as a stored object with the purpose dataset_import, then create the dataset from it","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"file":{"type":"string","format":"binary"}},"required":["name","file"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:create"]},"deprecated":true}},"/api/v1/dataset/{slugOrId}/upload":{"post":{"operationId":"postApiDatasetBySlugOrIdUpload","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"recordsCreated":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["datasetId","recordsCreated"],"additionalProperties":false}}}}},"description":"Upload a file (CSV, JSON, JSONL) to an existing dataset upload the file as a stored object with the purpose dataset_import, then create the dataset from it","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:update"]},"deprecated":true,"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true}]}},"/api/v1/dataset/attachments":{"post":{"operationId":"postApiDatasetAttachments","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetAttachment"}}}},"413":{"description":"The file is larger than the upload limit.","content":{}},"415":{"description":"The media type is not accepted.","content":{}},"429":{"description":"Too many uploads for this project in one minute.","content":{}}},"description":"Upload a file for an image or file column and get the reference a cell holds. The project is named by the `projectId` query parameter; the file goes in the `file` multipart field, with an optional `datasetId` field. create the upload, send the file to the address it answers, confirm it as a stored object, then put its reference in the cell","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"datasetId":{"description":"The dataset that owns the file. Omit it while the dataset is still a draft.","type":"string"},"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:manage"]},"deprecated":true,"parameters":[{"in":"query","name":"projectId","schema":{"type":"string","minLength":1},"required":true,"description":"The project the file is stored for."}]}},"/api/v1/dataset/attachments/uploads":{"post":{"operationId":"postApiDatasetAttachmentsUploads","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"objectId":{"type":"string","minLength":1},"uploadUrl":{"type":"string","format":"uri"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"expiresAt":{"type":"string","minLength":1}},"required":["objectId","uploadUrl","method","expiresAt"],"additionalProperties":false}}}},"413":{"description":"The file is larger than the organization's limit.","content":{}},"415":{"description":"The media type is not accepted.","content":{}},"429":{"description":"Too many uploads for this project in one minute.","content":{}}},"description":"Answers the address to PUT the file to. After the PUT, confirm the upload at `POST /api/v1/stored-objects/uploads/{objectId}/confirmation`, then write `/api/files/{projectId}/{objectId}/{filename}` into the cell.","summary":"Create an upload for an image or file cell","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:update"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"description":"The file name the reference will carry.","type":"string","minLength":1},"mediaType":{"type":"string","minLength":1,"maxLength":127,"pattern":"^[\\u0020-\\u007e]+$","description":"The media type of the file."},"byteLength":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The size of the file, in bytes."}},"required":["filename","mediaType","byteLength"]}}}}}},"/api/v1/dataset/{slugOrId}":{"get":{"operationId":"getApiDatasetBySlugOrId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"datasetId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","datasetId","projectId","entry","createdAt","updatedAt"],"additionalProperties":false}}},"required":["id","name","slug","columnTypes","createdAt","updatedAt","platformUrl","data"],"additionalProperties":false}}}}},"description":"Get a dataset by its slug or id, with every record inline. A dataset too large for one response is refused: read it page by page from `GET /{slugOrId}/records`.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:view"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true}]},"patch":{"operationId":"patchApiDatasetBySlugOrId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"platformUrl":{"type":"string"}},"required":["id","name","slug","columnTypes","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Update a dataset by its slug or id","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"columnTypes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"]}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:manage"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true}]},"delete":{"operationId":"deleteApiDatasetBySlugOrId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"archived":{"type":"boolean","const":true}},"required":["id","archived"],"additionalProperties":false}}}}},"description":"Archive a dataset (soft-delete)","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:manage"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true}]}},"/api/v1/dataset/{slugOrId}/records/{recordId}":{"patch":{"operationId":"patchApiDatasetBySlugOrIdRecordsByRecordId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"datasetId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","datasetId","projectId","entry","createdAt","updatedAt"],"additionalProperties":false}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"datasetId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","datasetId","projectId","entry","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Update or create a record in a dataset","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["datasets:update"]},"parameters":[{"in":"path","name":"slugOrId","schema":{"type":"string"},"required":true},{"in":"path","name":"recordId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["entry"]}}}}}},"/api/v1/evaluations/list":{"get":{"operationId":"getApiEvaluationsList","responses":{"200":{"description":"The evaluator catalogue","content":{"application/json":{"schema":{"type":"object","properties":{"evaluators":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string","description":"Display name of the evaluator"},"description":{"type":"string"},"category":{"type":"string"},"docsUrl":{"type":"string"},"isGuardrail":{"type":"boolean","description":"Whether this evaluator can gate a request as a guardrail"},"requiredFields":{"type":"array","items":{"type":"string"},"description":"`data` keys the evaluate call must supply"},"optionalFields":{"type":"array","items":{"type":"string"}},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Each setting's default and description"},"settings_json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"JSON Schema for this evaluator's settings object"},"envVars":{"type":"array","items":{"type":"string"},"description":"Server-side variables the evaluator needs configured"},"result":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"What its score, passed and label mean"}},"required":["name","description","category","isGuardrail","requiredFields","optionalFields","settings","settings_json_schema","envVars","result"]},"description":"Keyed by evaluator id, the value you put in the evaluate path"}},"required":["evaluators"]}}}}},"description":"List every evaluator this server ships with, along with the `data` fields each one needs and the settings it accepts. The keys of `evaluators` are the ids you put in the evaluate path. The list is the same for every caller and needs no credential.","summary":"List the built-in evaluators","tags":["Evaluations"],"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/evaluations/{evaluator}/evaluate":{"post":{"operationId":"postApiEvaluationsByEvaluatorEvaluate","responses":{"200":{"description":"The evaluator ran, declined, or failed. Branch on `status`; in guardrail mode `passed` is set on all three.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"processed"},"score":{"type":"number"},"passed":{"type":"boolean"},"label":{"type":"string"},"details":{"type":"string"},"cost":{"description":"What running the evaluator cost","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"raw_response":{"description":"The evaluator's own output, unprocessed"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"skipped"},"details":{"description":"Why the evaluator declined to score this input","type":"string"},"cost":{"description":"What the attempt cost, when the evaluator spent money before declining to score","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"passed":{"description":"Always true in guardrail mode, so a skip does not block","type":"boolean"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"error"},"error_type":{"type":"string","const":"EVALUATOR_ERROR","description":"Constant: the evaluator's own type is not exposed"},"details":{"type":"string"},"passed":{"description":"Always true in guardrail mode, so a failure does not block","type":"boolean"}},"required":["status","error_type","details"]}]}}}},"400":{"description":"The body was not valid JSON, failed validation, or omitted a field this evaluator requires","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"403":{"description":"The API key lacks evaluations:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"404":{"description":"No evaluator answers to that id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}}},"description":"Run one evaluator over a single input and get its score back. Built-in evaluators whose id has two segments, such as `ragas/faithfulness`, are addressed with the two-segment form of this path. Bodies up to 30MB are accepted.","summary":"Run an evaluator","tags":["Evaluations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trace_id":{"description":"Attaches the result to a trace you already sent","type":["string","null"]},"evaluation_id":{"description":"Supply your own id to make the call idempotent","type":["string","null"]},"evaluator_id":{"type":["string","null"]},"name":{"description":"Overrides the name the result is recorded under","type":["string","null"]},"data":{"type":"object","properties":{},"additionalProperties":{},"description":"What the evaluator scores. Which fields are required depends on the evaluator; its own entry under Built-in Evaluators lists them."},"settings":{"anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}],"description":"Per-call overrides of the evaluator's settings. Anything omitted falls back to the saved evaluator or monitor, then to the evaluator's own defaults."},"as_guardrail":{"default":false,"description":"Evaluate as a guardrail: a skipped or failed evaluation answers `passed` rather than an error, so a caller can gate on one field. The /api/guardrails path sets this for you.","type":["boolean","null"]}},"required":["data"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:manage"]},"parameters":[{"in":"path","name":"evaluator","schema":{"type":"string"},"required":true,"description":"Which evaluator to run. Either a built-in id (`ragas/faithfulness`), the slug of a monitor configured in this project, or `evaluators/{slug|id}` for a saved evaluator. `GET /api/evaluations/list` returns the built-in ids."}]}},"/api/v1/evaluations/{evaluator}/{subpath}/evaluate":{"post":{"operationId":"postApiEvaluationsByEvaluatorBySubpathEvaluate","responses":{"200":{"description":"The evaluator ran, declined, or failed. Branch on `status`; in guardrail mode `passed` is set on all three.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"processed"},"score":{"type":"number"},"passed":{"type":"boolean"},"label":{"type":"string"},"details":{"type":"string"},"cost":{"description":"What running the evaluator cost","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"raw_response":{"description":"The evaluator's own output, unprocessed"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"skipped"},"details":{"description":"Why the evaluator declined to score this input","type":"string"},"cost":{"description":"What the attempt cost, when the evaluator spent money before declining to score","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"passed":{"description":"Always true in guardrail mode, so a skip does not block","type":"boolean"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"error"},"error_type":{"type":"string","const":"EVALUATOR_ERROR","description":"Constant: the evaluator's own type is not exposed"},"details":{"type":"string"},"passed":{"description":"Always true in guardrail mode, so a failure does not block","type":"boolean"}},"required":["status","error_type","details"]}]}}}},"400":{"description":"The body was not valid JSON, failed validation, or omitted a field this evaluator requires","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"403":{"description":"The API key lacks evaluations:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"404":{"description":"No evaluator answers to that id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}}},"description":"Run one evaluator whose id has two segments, such as `ragas/faithfulness` or `langevals/valid_format`. Identical to the single-segment form in every other respect; the id is simply split across two path segments.","summary":"Run a namespaced evaluator","tags":["Evaluations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trace_id":{"description":"Attaches the result to a trace you already sent","type":["string","null"]},"evaluation_id":{"description":"Supply your own id to make the call idempotent","type":["string","null"]},"evaluator_id":{"type":["string","null"]},"name":{"description":"Overrides the name the result is recorded under","type":["string","null"]},"data":{"type":"object","properties":{},"additionalProperties":{},"description":"What the evaluator scores. Which fields are required depends on the evaluator; its own entry under Built-in Evaluators lists them."},"settings":{"anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}],"description":"Per-call overrides of the evaluator's settings. Anything omitted falls back to the saved evaluator or monitor, then to the evaluator's own defaults."},"as_guardrail":{"default":false,"description":"Evaluate as a guardrail: a skipped or failed evaluation answers `passed` rather than an error, so a caller can gate on one field. The /api/guardrails path sets this for you.","type":["boolean","null"]}},"required":["data"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:manage"]},"parameters":[{"in":"path","name":"evaluator","schema":{"type":"string"},"required":true,"description":"First segment of the evaluator id, such as `ragas`"},{"in":"path","name":"subpath","schema":{"type":"string"},"required":true,"description":"Second segment of the evaluator id, such as `faithfulness`"}]}},"/api/v1/guardrails/{evaluator}/evaluate":{"post":{"operationId":"postApiGuardrailsByEvaluatorEvaluate","responses":{"200":{"description":"The evaluator ran, declined, or failed. Branch on `status`; in guardrail mode `passed` is set on all three.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"processed"},"score":{"type":"number"},"passed":{"type":"boolean"},"label":{"type":"string"},"details":{"type":"string"},"cost":{"description":"What running the evaluator cost","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"raw_response":{"description":"The evaluator's own output, unprocessed"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"skipped"},"details":{"description":"Why the evaluator declined to score this input","type":"string"},"cost":{"description":"What the attempt cost, when the evaluator spent money before declining to score","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"passed":{"description":"Always true in guardrail mode, so a skip does not block","type":"boolean"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"error"},"error_type":{"type":"string","const":"EVALUATOR_ERROR","description":"Constant: the evaluator's own type is not exposed"},"details":{"type":"string"},"passed":{"description":"Always true in guardrail mode, so a failure does not block","type":"boolean"}},"required":["status","error_type","details"]}]}}}},"400":{"description":"The body was not valid JSON, failed validation, or omitted a field this evaluator requires","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"403":{"description":"The API key lacks evaluations:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"404":{"description":"No evaluator answers to that id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}}},"description":"Run an evaluator inline and gate on one boolean. Same call as the evaluate path with `as_guardrail` set: every outcome carries `passed`, so an evaluator that skips or fails does not block the request it was guarding. Check `passed` and let the request through when it is true.","summary":"Run an evaluator as a guardrail","tags":["Evaluations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trace_id":{"description":"Attaches the result to a trace you already sent","type":["string","null"]},"evaluation_id":{"description":"Supply your own id to make the call idempotent","type":["string","null"]},"evaluator_id":{"type":["string","null"]},"name":{"description":"Overrides the name the result is recorded under","type":["string","null"]},"data":{"type":"object","properties":{},"additionalProperties":{},"description":"What the evaluator scores. Which fields are required depends on the evaluator; its own entry under Built-in Evaluators lists them."},"settings":{"anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}],"description":"Per-call overrides of the evaluator's settings. Anything omitted falls back to the saved evaluator or monitor, then to the evaluator's own defaults."},"as_guardrail":{"default":false,"description":"Evaluate as a guardrail: a skipped or failed evaluation answers `passed` rather than an error, so a caller can gate on one field. The /api/guardrails path sets this for you.","type":["boolean","null"]}},"required":["data"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:manage"]},"parameters":[{"in":"path","name":"evaluator","schema":{"type":"string"},"required":true,"description":"Which evaluator to run. Either a built-in id (`ragas/faithfulness`), the slug of a monitor configured in this project, or `evaluators/{slug|id}` for a saved evaluator. `GET /api/evaluations/list` returns the built-in ids."}]}},"/api/v1/evaluators":{"get":{"operationId":"getApiEvaluators","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"type":{"type":"string"},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"workflowId":{"type":["string","null"]},"copiedFromEvaluatorId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"fields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"outputFields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"workflowName":{"type":"string"},"workflowIcon":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","projectId","name","slug","type","config","workflowId","copiedFromEvaluatorId","createdAt","updatedAt","fields","outputFields","platformUrl"],"additionalProperties":false}}}}}},"description":"Get all evaluators for a project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:view"]}},"post":{"operationId":"postApiEvaluators","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"type":{"type":"string"},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"workflowId":{"type":["string","null"]},"copiedFromEvaluatorId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"fields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"outputFields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"workflowName":{"type":"string"},"workflowIcon":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","projectId","name","slug","type","config","workflowId","copiedFromEvaluatorId","createdAt","updatedAt","fields","outputFields","platformUrl"],"additionalProperties":false}}}}},"description":"Create a new evaluator","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","config"]}}}}}},"/api/v1/evaluators/{idOrSlug}":{"get":{"operationId":"getApiEvaluatorsByIdOrSlug","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"type":{"type":"string"},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"workflowId":{"type":["string","null"]},"copiedFromEvaluatorId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"fields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"outputFields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"workflowName":{"type":"string"},"workflowIcon":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","projectId","name","slug","type","config","workflowId","copiedFromEvaluatorId","createdAt","updatedAt","fields","outputFields","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Get a specific evaluator by ID or slug","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:view"]},"parameters":[{"in":"path","name":"idOrSlug","schema":{"type":"string","minLength":1},"required":true,"description":"The evaluator id or its project-unique slug."}]}},"/api/v1/evaluators/{id}":{"put":{"operationId":"putApiEvaluatorsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"type":{"type":"string"},"config":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"workflowId":{"type":["string","null"]},"copiedFromEvaluatorId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"fields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"outputFields":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string"},"type":{"type":"string"},"optional":{"type":"boolean"}},"required":["identifier","type"],"additionalProperties":false}},"workflowName":{"type":"string"},"workflowIcon":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","projectId","name","slug","type","config","workflowId","copiedFromEvaluatorId","createdAt","updatedAt","fields","outputFields","platformUrl"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Update an existing evaluator","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The evaluator id."}]},"delete":{"operationId":"deleteApiEvaluatorsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Archive (soft-delete) an evaluator","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The evaluator id."}]}},"/api/v1/experiments/{slug}/run":{"post":{"operationId":"postApiExperimentsBySlugRun","responses":{"200":{"description":"Run started","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string","description":"Identifier to poll this run with"},"status":{"type":"string","const":"running"},"total":{"type":"number","description":"Number of cells this run will execute"},"runUrl":{"description":"Link to the run in the LangWatch app","type":"string"}},"required":["runId","status","total"],"additionalProperties":false}},"text/event-stream":{"schema":{"type":"string","description":"Progress events, ending with a done event carrying the summary"}}}},"400":{"description":"The body was not valid JSON, failed input validation, or the experiment has no dataset configured","content":{}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such experiment or run in this project","content":{}}},"description":"Start a run of a saved experiment, addressed by slug. Returns a runId to poll straight away. Send `Accept: text/event-stream` instead to stream progress events until the run finishes.","summary":"Run an experiment","tags":["Experiments"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"maxItems":4000,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"dataset_id":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"row_indices":{"type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:create"]},"parameters":[{"in":"path","name":"slug","schema":{"type":"string","minLength":1},"required":true,"description":"The experiment's slug, or its id"}]}},"/api/v1/experiments/runs":{"get":{"operationId":"getApiExperimentsRuns","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"experimentId":{"type":"string"},"experimentSlug":{"type":"string"},"runs":{"type":"array","items":{"type":"object","properties":{"experimentId":{"type":"string"},"runId":{"type":"string"},"workflowVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"string"},"commitMessage":{"type":"string"},"author":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"image":{"type":["string","null"]}},"required":["name","image"],"additionalProperties":false},{"type":"null"}]}},"required":["id","version","commitMessage","author"],"additionalProperties":false},{"type":"null"}]},"timestamps":{"type":"object","properties":{"createdAt":{"type":"number"},"updatedAt":{"type":"number"},"finishedAt":{"type":["number","null"]},"stoppedAt":{"type":["number","null"]}},"required":["createdAt","updatedAt"],"additionalProperties":false},"progress":{"type":["number","null"]},"total":{"type":["number","null"]},"summary":{"type":"object","properties":{"datasetCost":{"type":"number"},"evaluationsCost":{"type":"number"},"datasetAverageCost":{"type":"number"},"datasetAverageDuration":{"type":"number"},"evaluationsAverageCost":{"type":"number"},"evaluationsAverageDuration":{"type":"number"},"evaluations":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"averageScore":{"type":["number","null"]},"averagePassed":{"type":"number"}},"required":["name","averageScore"],"additionalProperties":false}}},"required":["evaluations"],"additionalProperties":false}},"required":["experimentId","runId","workflowVersion","timestamps","summary"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"totalHits":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["page","pageSize","totalHits","hasMore"],"additionalProperties":false}},"required":["experimentId","experimentSlug","runs","pagination"],"additionalProperties":false}}}},"400":{"description":"experimentSlug was not supplied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"What was wrong with the request, as a sentence"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such experiment in this project","content":{}}},"description":"Runs recorded for one experiment, newest first. Page through them with `page` and `pageSize`.","summary":"List runs of an experiment","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:view"]},"parameters":[{"in":"query","name":"experimentSlug","schema":{"type":"string"},"description":"Slug of the experiment whose runs you want"},{"in":"query","name":"page","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"1-based page number"},{"in":"query","name":"pageSize","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Runs per page, capped at 200"}]}},"/api/v1/experiments/runs/{runId}":{"get":{"operationId":"getApiExperimentsRunsByRunId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","stopped"]},"progress":{"type":"number","description":"Cells finished so far"},"total":{"type":"number","description":"Cells in the run"},"startedAt":{"description":"Unix milliseconds","type":"number"},"finishedAt":{"description":"Unix milliseconds; set once the run is no longer running","type":"number"},"summary":{"description":"Present when completed","type":"object","properties":{"runId":{"type":"string"},"totalCells":{"type":"number","description":"Cells the run set out to execute"},"completedCells":{"type":"number"},"failedCells":{"type":"number"},"duration":{"type":"number","description":"Wall-clock milliseconds"},"chDispatchFailures":{"description":"Non-zero means some rows may be missing from the stored results","type":"number"},"timestamps":{"type":"object","properties":{"startedAt":{"type":"number"},"finishedAt":{"type":"number"},"stoppedAt":{"type":"number"}},"required":["startedAt"],"additionalProperties":false},"targets":{"type":"array","items":{"type":"object","properties":{"targetId":{"type":"string"},"name":{"type":"string"},"passed":{"type":"number"},"failed":{"type":"number"},"avgLatency":{"type":"number"},"totalCost":{"type":"number"}},"required":["targetId","name","passed","failed","avgLatency","totalCost"],"additionalProperties":false}},"evaluators":{"type":"array","items":{"type":"object","properties":{"evaluatorId":{"type":"string"},"name":{"type":"string"},"passed":{"type":"number"},"failed":{"type":"number"},"passRate":{"type":"number"},"avgScore":{"type":"number"}},"required":["evaluatorId","name","passed","failed","passRate"],"additionalProperties":false}},"totalPassed":{"type":"number"},"totalFailed":{"type":"number"},"passRate":{"type":"number"},"totalCost":{"type":"number"},"runUrl":{"description":"Link to the run in the LangWatch app","type":"string"}},"required":["runId","totalCells","completedCells","failedCells","duration","timestamps"],"additionalProperties":false},"error":{"description":"Stable failure code, present when failed. Not display copy: render your own wording keyed on it.","type":"string"},"domainError":{"description":"The full failure envelope, when the failure carried one","type":"object","properties":{"code":{"type":"string","description":"Stable failure code; branch on this"},"kind":{"type":"string","description":"Deprecated alias of code, for older clients"},"message":{"type":"string"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"httpStatus":{"type":"number"},"fault":{"description":"Who the failure is attributable to: customer, platform, presumed_platform, provider","type":"string"},"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"retryable":{"type":"boolean"},"tips":{"readOnly":true,"type":"array","items":{"type":"string"}},"docsUrl":{"type":"string"},"reasons":{"type":"array","items":{}}},"required":["code","kind"],"additionalProperties":false},"traceId":{"description":"Trace id for failures that carry no code, to quote in support","type":"string"}},"required":["runId","status","progress","total"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such run in this project","content":{}}},"description":"Current state of one run. Returns progress while it is going and a summary once it finishes, so a CI job can poll this until `status` leaves `running`.","summary":"Poll a run","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:view"]},"parameters":[{"in":"path","name":"runId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/experiments/runs/{runId}/results":{"get":{"operationId":"getApiExperimentsRunsByRunIdResults","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"experimentId":{"type":"string"},"runId":{"type":"string"},"projectId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"progress":{"type":["number","null"]},"total":{"type":["number","null"]},"targets":{"description":"Resolves the targetId each dataset row and evaluation carries","anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"promptId":{"type":["string","null"]},"promptVersion":{"type":["number","null"]},"agentId":{"type":["string","null"]},"evaluatorId":{"type":["string","null"]},"model":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},{"type":"null"}]}},"required":["id","name","type"],"additionalProperties":false}},{"type":"null"}]},"dataset":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"targetId":{"type":["string","null"]},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"predicted":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"cost":{"type":["number","null"]},"duration":{"type":["number","null"]},"error":{"description":"The engine's own string. Prefer domainError.code to branch on","type":["string","null"]},"domainError":{"description":"Set on rows written since failures started carrying codes","type":"object","properties":{"code":{"type":"string","description":"Stable failure code; branch on this"},"kind":{"type":"string","description":"Deprecated alias of code, for older clients"},"message":{"type":"string"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"httpStatus":{"type":"number"},"fault":{"description":"Who the failure is attributable to: customer, platform, presumed_platform, provider","type":"string"},"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"retryable":{"type":"boolean"},"tips":{"readOnly":true,"type":"array","items":{"type":"string"}},"docsUrl":{"type":"string"},"reasons":{"type":"array","items":{}}},"required":["code","kind"],"additionalProperties":false},"traceId":{"type":["string","null"]}},"required":["index","entry"],"additionalProperties":false},"description":"One row per dataset entry, with what the target predicted"},"evaluations":{"type":"array","items":{"type":"object","properties":{"evaluator":{"type":"string"},"name":{"type":["string","null"]},"targetId":{"type":["string","null"]},"status":{"type":"string","enum":["processed","skipped","error"]},"index":{"type":"number"},"score":{"type":["number","null"]},"label":{"type":["string","null"]},"passed":{"type":["boolean","null"]},"details":{"type":["string","null"]},"cost":{"type":["number","null"]},"duration":{"type":["number","null"]},"inputs":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["evaluator","status","index"],"additionalProperties":false},"description":"One row per evaluator per dataset entry"},"timestamps":{"type":"object","properties":{"createdAt":{"type":"number"},"updatedAt":{"type":"number"},"finishedAt":{"type":["number","null"]},"stoppedAt":{"type":["number","null"]}},"required":["createdAt","updatedAt"],"additionalProperties":false},"completeness":{"type":"object","properties":{"complete":{"type":"boolean"},"dataset":{"type":"object","properties":{"received":{"type":"integer","minimum":0,"maximum":9007199254740991},"expected":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["received","expected"],"additionalProperties":false},"evaluations":{"type":"object","properties":{"received":{"type":"integer","minimum":0,"maximum":9007199254740991},"expected":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["received","expected"],"additionalProperties":false}},"required":["complete","dataset","evaluations"],"additionalProperties":false,"description":"What is stored against what the run reported. Results are stored after they are reported, so a read can hold part of a run: `complete` is false until the run has ended and every reported row and evaluation is stored. `expected` is null when the run reported no counts"}},"required":["experimentId","runId","projectId","dataset","evaluations","timestamps","completeness"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such run in this project","content":{}}},"description":"Every dataset row of a run with what the target predicted, plus one entry per evaluator per row. Runs older than the status cache need `experimentSlug` as well, since a run id is only unique within its experiment.","summary":"Read run results","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:view"]},"parameters":[{"in":"path","name":"runId","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"experimentSlug","schema":{"type":"string"},"description":"Owning experiment. Required once the run has aged out of the status cache."}]}},"/api/v1/experiments/{slug}/workbench-state":{"get":{"operationId":"getApiExperimentsBySlugWorkbenchState","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":["string","null"]},"state":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The experiment setup: datasets, targets and evaluators. Read it, change it, send it back whole."},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Send this back as expectedVersion to save safely"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp of the last save"}},"required":["id","slug","version","updatedAt"],"additionalProperties":false}}}},"400":{"description":"The experiment is not an evaluations workbench (experiment_type_mismatch)","content":{}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such experiment in this project","content":{}}},"description":"The experiment's datasets, targets and evaluators, with the version to send back when you save. Ask for `fields=version` to check for changes without transferring the setup.","summary":"Read an experiment's setup","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:view"]},"parameters":[{"in":"path","name":"slug","schema":{"type":"string","minLength":1},"required":true,"description":"The experiment's slug, or its id"},{"in":"query","name":"fields","schema":{"type":"string"},"description":"Set to `version` to answer with the version and timestamp only"}]},"put":{"operationId":"putApiExperimentsBySlugWorkbenchState","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The version the save produced"}},"required":["version"],"additionalProperties":false}}}},"400":{"description":"The setup did not match the schema (experiment_invalid_workbench_state), points at something that no longer exists (experiment_workbench_missing_reference), or the experiment is not an evaluations workbench (experiment_type_mismatch)","content":{}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such experiment in this project","content":{}},"409":{"description":"Someone else saved since you read this state (experiment_stale_workbench_state). `currentVersion` carries the version to read again.","content":{}}},"description":"Replace the experiment's setup. Send `expectedVersion` with the version you read and the save is refused with a 409 when someone else wrote first, instead of overwriting their work.","summary":"Save an experiment's setup","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:update"]},"parameters":[{"in":"path","name":"slug","schema":{"type":"string","minLength":1},"required":true,"description":"The experiment's slug, or its id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The full setup to save"},"expectedVersion":{"description":"The version you read. Sending it refuses the save when someone else already wrote on top of it.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"commitMessage":{"description":"Names this version in the history list","type":"string"}},"required":["state"]}}}}}},"/api/v1/experiments/{slug}/versions":{"get":{"operationId":"getApiExperimentsBySlugVersions","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Restore this version by this number. Named versions run 1, 2, 3 with no gaps. The autosave row also has a number, but it changes with every save, so read it as a handle and not as a place in the history."},"counterVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The setup version this row was written at. It says how recent the row is, and it equals the experiment's current version on the row holding the live setup."},"autoSaved":{"type":"boolean","description":"True for the single autosave row, which every ordinary save rewrites in place"},"commitMessage":{"type":["string","null"]},"authorLabel":{"type":"string","description":"Who wrote it: user, langy or api","example":"user"},"authorId":{"description":"User id, when a person wrote it","type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 timestamp of the first write"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp of the last write. The autosave row is rewritten in place, so this is what says how old its content is."}},"required":["version","counterVersion","autoSaved","commitMessage","authorLabel","authorId","createdAt","updatedAt"],"additionalProperties":false},"description":"Newest first, by `counterVersion`"},"nextCursor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Pass as `cursor` to read the next page, null on the last one"}},"required":["versions","nextCursor"],"additionalProperties":false}}}},"400":{"description":"The experiment is not an evaluations workbench (experiment_type_mismatch)","content":{}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such experiment in this project","content":{}}},"description":"Every saved version of the experiment's setup, newest first. A commit, an agent write and a restore each add a numbered version. Ordinary typing rewrites one autosave row, which is the entry with `autoSaved` true. Page through them with `limit` and `cursor`.","summary":"List an experiment's versions","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:view"]},"parameters":[{"in":"path","name":"slug","schema":{"type":"string","minLength":1},"required":true,"description":"The experiment's slug, or its id"},{"in":"query","name":"limit","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Versions per page, capped at 100"},{"in":"query","name":"cursor","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"The `nextCursor` of the previous page"}]}},"/api/v1/experiments/{slug}/versions/{version}/restore":{"post":{"operationId":"postApiExperimentsBySlugVersionsByVersionRestore","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number","description":"The new version the restore wrote. History is never rewritten, so the restored version is still in the list."}},"required":["version"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key, or the key lacks the permission","content":{}},"404":{"description":"No such experiment or version in this project","content":{}},"409":{"description":"Someone else saved since you read this state (experiment_stale_workbench_state).","content":{}}},"description":"Bring an old setup back by writing it forward as a new save. History is never rewritten: the version you restored from stays in the list, and the restore is one more entry after it.","summary":"Restore an experiment version","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:update"]},"parameters":[{"in":"path","name":"slug","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"version","schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":true,"description":"The version to restore, as listed by `GET /api/experiments/{slug}/versions`"}]}},"/api/v1/experiments":{"get":{"operationId":"getApiExperiments","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"experiments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"workflowId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"runsCount":{"type":"number"},"lastRunAt":{"type":["string","null"]}},"required":["id","slug","name","type","workflowId","createdAt","updatedAt","runsCount","lastRunAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"totalHits":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["page","pageSize","totalHits","hasMore"],"additionalProperties":false}},"required":["experiments","pagination"],"additionalProperties":false}}}}},"description":"List experiments for the project. Includes a runs count and last-run timestamp per experiment.","summary":"List experiments for the project","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:view"]},"parameters":[{"in":"query","name":"page","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"1-based page number"},{"in":"query","name":"pageSize","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Experiments per page, capped at 200"}]},"post":{"operationId":"postApiExperiments","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the created experiment"},"slug":{"type":"string","description":"Slug to address the experiment by"},"version":{"type":"number","description":"Version of the saved setup, starting at 1"}},"required":["id","slug","version"],"additionalProperties":false}}}},"400":{"description":"The setup did not match the schema (experiment_invalid_workbench_state) or points at something that no longer exists (experiment_workbench_missing_reference)","content":{}}},"description":"Create an evaluations experiment. Send a setup to start from, or send none and get a blank workbench with one inline dataset. The slug it answers with is what every other experiment endpoint takes.","summary":"Create an experiment and its setup","tags":["Experiments"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name for the experiment. A draft name is picked when omitted.","type":"string","minLength":1},"state":{"description":"Setup to start from. Omit for a blank workbench with one inline dataset.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:create"]}}},"/api/v1/experiments/{slug}":{"get":{"operationId":"getApiExperimentsBySlug","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"workflowId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"runsCount":{"type":"number"},"lastRunAt":{"type":["string","null"]}},"required":["id","slug","name","type","workflowId","createdAt","updatedAt","runsCount","lastRunAt"],"additionalProperties":false}}}},"404":{"description":"No experiment with that slug or id in this project","content":{}}},"description":"Read a single experiment by its slug, in the same shape the list returns. Accepts the experiment id as well, so either identifier the list hands back can be used.","summary":"Read one experiment","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:view"]},"parameters":[{"in":"path","name":"slug","schema":{"type":"string","minLength":1},"required":true,"description":"The experiment's slug, or its id"}]}},"/api/v1/experiment/init":{"post":{"operationId":"postApiExperimentInit","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","description":"Slug of the experiment, created or existing"},"path":{"type":"string","description":"Path to the experiment in the LangWatch app"}},"required":["slug","path"],"additionalProperties":false}}}},"400":{"description":"The body was not valid JSON","content":{}},"401":{"description":"Missing or invalid API key","content":{}},"403":{"description":"The API key lacks experiments:manage, or the plan's experiment limit is already reached","content":{}},"413":{"description":"The body is larger than the deployment accepts","content":{}},"422":{"description":"The body failed validation, or neither experiment_slug nor experiment_id was supplied","content":{}}},"description":"Create an experiment, or return the existing one when the slug is already taken. This is the first call in an experiment run: take the slug back, report results against it, and every run under that slug groups together in the app. The SDKs call this endpoint for you. The body carries `experiment_type` and at least one of `experiment_slug` (the stable slug you choose, which is what makes repeated runs land together) or `experiment_id`; `experiment_name` names it on creation and `workflowId` ties it to an Optimization Studio workflow.","summary":"Create an experiment","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"experiment_id":{"type":["string","null"]},"experiment_slug":{"type":["string","null"]},"experiment_type":{"type":"string","enum":["DSPY","BATCH_EVALUATION","BATCH_EVALUATION_V2"]},"experiment_name":{"type":"string"},"workflowId":{"type":"string"}},"required":["experiment_type"]}}}}}},"/api/v1/dspy/log_steps":{"post":{"operationId":"postApiDspyLogSteps","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable confirmation"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"The body was not valid JSON","content":{}},"401":{"description":"Missing or invalid API key","content":{}},"403":{"description":"The API key lacks experiments:manage","content":{}},"413":{"description":"The body is larger than 20MB","content":{}},"422":{"description":"The body failed validation, or carried timestamps in seconds rather than milliseconds","content":{}},"500":{"description":"A step could not be stored. The cause is on our side and is logged with the run and step ids; retrying the batch is safe.","content":{}}},"description":"Report the steps of a DSPy optimizer run against an experiment, so the run's progress and scores show up in the app. Send the steps as an array; the optimizer typically posts each batch as it finishes. Bodies up to 20MB are accepted.","summary":"Report DSPy optimizer steps","tags":["Experiments"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["experiments:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string"},"workflow_version_id":{"type":["string","null"]},"index":{"type":"string"},"score":{"type":"number"},"label":{"type":"string"},"optimizer":{"type":"object","properties":{"name":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","parameters"]},"predictors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"predictor":{"allOf":[{"type":"object","properties":{"__class__":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},"required":["name","predictor"]}},"experiment_id":{"type":["string","null"]},"experiment_slug":{"type":["string","null"]},"timestamps":{"type":"object","properties":{"created_at":{"type":"number"}},"required":["created_at"]},"examples":{"type":"array","items":{"type":"object","properties":{"example":{"allOf":[{"type":"object","properties":{"__class__":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"pred":{"allOf":[{"type":"object","properties":{"__class__":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"score":{"type":"number"},"trace":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"input":{"allOf":[{"type":"object","properties":{"__class__":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"pred":{"allOf":[{"type":"object","properties":{"__class__":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},"required":["input","pred"]}},{"type":"null"}]}},"required":["example","pred","score"]}},"llm_calls":{"type":"array","items":{"type":"object","properties":{"__class__":{"type":"string"},"response":{"allOf":[{"type":"object","properties":{"__class__":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"model":{"type":["string","null"]},"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"cost":{"type":["number","null"]}},"required":["__class__","response"]}}},"required":["run_id","index","score","label","optimizer","predictors","timestamps","examples","llm_calls"]}}}}}}},"/api/v1/evaluations/batch/log_results":{"post":{"operationId":"postApiEvaluationsBatchLogResults","responses":{"200":{"description":"The rows were recorded","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable confirmation"}},"required":["message"]}}}},"400":{"description":"The request was not sent as application/json, failed validation, named neither experiment_id nor experiment_slug, or carried timestamps in seconds rather than milliseconds","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Set when the request was rejected before validation","type":"string"},"error":{"description":"Set when the body parsed and then failed validation","type":"string"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"403":{"description":"The API key lacks evaluations:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"413":{"description":"The body is larger than the organization accepts in one request; `error.code` is `evaluation_log_results_too_large` and `error.meta.maxBytes` is the limit","content":{}}},"description":"Report the rows of a batch evaluation against an experiment, so its scores and progress show up in the app. This is the second half of an SDK batch evaluation: create the experiment with `POST /api/experiment/init`, then post rows here as they finish. Identify the experiment by either `experiment_id` or `experiment_slug`. Bodies up to 267 MB are accepted, sized for one dataset row with ten 20 MB images inline. A larger body is refused with `evaluation_log_results_too_large`.","summary":"Report batch evaluation results","tags":["Evaluations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string"},"workflow_version_id":{"type":["string","null"]},"progress":{"type":["number","null"]},"total":{"type":["number","null"]},"dataset":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"target_id":{"type":["string","null"]},"entry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"predicted":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cost":{"type":["number","null"]},"duration":{"type":["number","null"]},"error":{"type":["string","null"]},"trace_id":{"type":["string","null"]}},"required":["index","entry"]}},"evaluations":{"type":"array","items":{"type":"object","properties":{"evaluator":{"type":"string"},"name":{"type":["string","null"]},"target_id":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","const":"processed"},{"type":"string","const":"skipped"},{"type":"string","const":"error"}]},"index":{"type":"number"},"duration":{"type":["number","null"]},"inputs":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"score":{"type":["number","null"]},"label":{"type":["string","null"]},"passed":{"type":["boolean","null"]},"details":{"type":["string","null"]},"cost":{"type":["number","null"]}},"required":["evaluator","status","index"]}},"experiment_id":{"type":["string","null"]},"experiment_slug":{"type":["string","null"]},"workflow_id":{"type":["string","null"]},"name":{"type":["string","null"]},"targets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prompt_id":{"type":["string","null"]},"prompt_version":{"type":["number","null"]},"agent_id":{"type":["string","null"]},"evaluator_id":{"type":["string","null"]},"model":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},{"type":"null"}]},"type":{"anyOf":[{"type":"string","const":"prompt"},{"type":"string","const":"agent"},{"type":"string","const":"evaluator"},{"type":"string","const":"workflow"},{"type":"string","const":"custom"}]}},"required":["id","name"]}},{"type":"null"}]},"timestamps":{"type":"object","properties":{"created_at":{"type":["number","null"]},"finished_at":{"type":["number","null"]},"stopped_at":{"type":["number","null"]}}},"expected":{"anyOf":[{"type":"object","properties":{"dataset":{"type":"integer","minimum":0,"maximum":9007199254740991},"evaluations":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["dataset","evaluations"]},{"type":"null"}]}},"required":["run_id"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:manage"]}}},"/api/v1/dataset/evaluate":{"post":{"operationId":"postApiDatasetEvaluate","responses":{"200":{"description":"The evaluator ran; branch on `status`","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"processed"},"score":{"type":"number"},"passed":{"type":"boolean"},"label":{"type":"string"},"details":{"type":"string"},"cost":{"description":"What running the evaluator cost","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"raw_response":{"description":"The evaluator's own output, unprocessed"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"skipped"},"details":{"description":"Why the evaluator declined to score this input","type":"string"},"cost":{"description":"What the attempt cost, when the evaluator spent money before declining to score","type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"passed":{"description":"Always true in guardrail mode, so a skip does not block","type":"boolean"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"error"},"error_type":{"type":"string","const":"EVALUATOR_ERROR","description":"Constant: the evaluator's own type is not exposed"},"details":{"type":"string"},"passed":{"description":"Always true in guardrail mode, so a failure does not block","type":"boolean"}},"required":["status","error_type","details"]}]}}}},"400":{"description":"The body was not valid JSON, failed validation, or named an evaluator that does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Set when the request was rejected before validation","type":"string"},"error":{"description":"Set when the body parsed and then failed validation","type":"string"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Set when the request was rejected before validation","type":"string"},"error":{"description":"Set when the body parsed and then failed validation","type":"string"}}}}}},"403":{"description":"The API key lacks evaluations:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"404":{"description":"No dataset with that slug","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The failure, as a sentence"},"kind":{"description":"Stable failure code, on the failures that carry one","type":"string"},"meta":{"description":"What the code needs to be acted on, such as the missing field","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error"]}}}},"413":{"description":"The body is larger than 30MB; refused before it is read with the `payload_too_large` HandledError","content":{}}},"description":"Run one evaluator across a saved dataset and record the result against an experiment. Name the dataset by slug and the evaluator the same way the evaluate endpoints do; results are grouped under `experimentSlug`, or under a generated batch id when you omit it. Bodies up to 30MB are accepted.","summary":"Evaluate a dataset","tags":["Datasets"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation":{"type":"string","description":"Which evaluator to run, addressed the same way the evaluate endpoints address it"},"experimentSlug":{"description":"Groups the results under an experiment. Omit it and a batch id is generated instead.","type":"string"},"batchId":{"description":"Older name for experimentSlug, used when that is absent","type":"string"},"datasetSlug":{"type":"string","description":"The saved dataset to evaluate"},"data":{"anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}],"description":"Extra fields merged into every row before evaluating"},"settings":{"anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}],"description":"Per-call overrides of the evaluator's settings"}},"required":["evaluation","datasetSlug"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:manage"]}}},"/api/v1/workflows/{id}/evaluate":{"post":{"operationId":"postApiWorkflowsByIdEvaluate","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string"},"run_url":{"type":"string"},"workflow_version_id":{"type":"string"},"version":{"type":"string"}},"required":["run_id","run_url","workflow_version_id","version"],"additionalProperties":false}}}},"400":{"description":"The workflow has no committed version, or the run could not start","content":{}},"403":{"description":"The API key cannot read the evaluation run it would start","content":{}},"404":{"description":"The project holds no such workflow or dataset","content":{}},"422":{"description":"The body failed validation","content":{}}},"description":"Trigger an evaluation run of a workflow's committed version through the evaluations pipeline. Evaluate the workflow's attached dataset, inline data, or a platform dataset id; parameters bind as constant entry inputs on every row. Returns a run id and a results URL to poll or open in the browser.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version_id":{"description":"Committed version to evaluate; defaults to the latest commit","type":"string"},"data":{"description":"Inline rows to evaluate instead of the workflow's attached dataset","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"dataset_id":{"description":"Platform dataset id to evaluate; mutually exclusive with data","type":"string"},"parameters":{"description":"Constant entry inputs applied to every row, e.g. a feature flag or PR number","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"row_indices":{"description":"Subset of dataset row indices to evaluate","type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:create","evaluations:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/agent-cache/{name}":{"get":{"operationId":"getApiAgentCacheByName","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Read a cache entry by name. An absent or expired entry answers 404. The value is returned only to a caller that can manage the project's agent cache.","summary":"Read an agent cache entry","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["agentCache:manage"]},"parameters":[{"in":"path","name":"name","schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Z][A-Z0-9_]*$"},"required":true}]},"put":{"operationId":"putApiAgentCacheByName","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"ttl_seconds":{"type":"number"}},"required":["name","ttl_seconds"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Store or replace an encrypted value. It expires after ttl_seconds, which defaults to 900.","summary":"Store an agent cache entry","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["agentCache:manage"]},"parameters":[{"in":"path","name":"name","schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Z][A-Z0-9_]*$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","minLength":1},"ttl_seconds":{"type":"integer","minimum":5,"maximum":86400}},"required":["value"]}}}}},"delete":{"operationId":"deleteApiAgentCacheByName","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"deleted":{"type":"boolean"}},"required":["name","deleted"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Delete by name. Removing a name the project does not hold still succeeds.","summary":"Delete an agent cache entry","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["agentCache:manage"]},"parameters":[{"in":"path","name":"name","schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Z][A-Z0-9_]*$"},"required":true}]}},"/api/v1/agent-cache/{name}/claim":{"post":{"operationId":"postApiAgentCacheByNameClaim","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"ttl_seconds":{"type":"number"},"claimed":{"type":"boolean"}},"required":["name","ttl_seconds","claimed"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Store the value only while the name is free. The claimed field reports whether this caller took it.","summary":"Claim an agent cache entry","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["agentCache:manage"]},"parameters":[{"in":"path","name":"name","schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Z][A-Z0-9_]*$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","minLength":1},"ttl_seconds":{"type":"integer","minimum":5,"maximum":86400}},"required":["value"]}}}}}},"/api/v1/elevenlabs/webhook/{modelProviderId}":{"post":{"operationId":"receiveElevenLabsWebhook","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"requestBody":{"required":true,"content":{"text/plain":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]},"parameters":[{"in":"path","name":"modelProviderId","schema":{"type":"string"},"required":true}]}},"/api/gateway/v1/virtual-keys":{"get":{"operationId":"getApiGatewayV1VirtualKeys","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass back as cursor for the next page. Null means the walk is exhausted.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Returns the virtual keys the caller can see. A credential that names a project (a project key, or an API key with X-Project-Id) sees the keys scoped to that project, to its team, or to the whole organization. An API key that names no project sees every key in its organization it holds virtualKeys:view on. Newest first, paged by cursor; a page can hold fewer rows than the limit before the walk is done.","summary":"List virtual keys","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:view"]},"parameters":[{"in":"query","name":"cursor","schema":{"type":"string","maxLength":500}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":200}},{"in":"query","name":"external_id","schema":{"type":"string","maxLength":128},"description":"Exact match on the resource's external_id."}]},"post":{"operationId":"postApiGatewayV1VirtualKeys","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false},"secret":{"description":"The secret, absent when `reveal_once` was set.","type":"string"},"reveal_id":{"description":"With `reveal_once`: the id that serves the secret once, through the app.","type":"string"},"preview":{"description":"With `reveal_once`: the key's display prefix, safe to show in place of the secret.","type":"string"}},"required":["virtual_key"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Mints a new virtual key and returns the secret exactly once. With `reveal_once` the response withholds the secret and carries `reveal_id` and `preview` instead: the secret is parked for 24 hours and served once, to the person the key is for, through the LangWatch app. scopes defaults to the project the caller names; an API key that names no project must send scopes. Org- and team-scoped keys require virtualKeys:manage at each requested scope.","summary":"Create virtual key","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, 8 to 255 characters, that makes this create safe to retry. The first request to use a key runs normally and its response is stored for 24 hours. A later request with the same key and the same body is not executed again: it returns the stored response, marked with `X-Idempotent-Replay: true`. The same key with a different body is refused 409 `idempotency_error`, as is a retry sent while the original is still running. Only successful responses are stored, so a create that failed can simply be retried with the same key.","schema":{"type":"string","minLength":8,"maxLength":255}}],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string"},"principal_user_id":{"type":["string","null"]},"reveal_once":{"type":"boolean"},"scopes":{"minItems":1,"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string","minLength":1}},"required":["scope_type","scope_id"]}},"trace_project_id":{"type":["string","null"]},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"expires_at":{"type":"string","format":"date-time"},"budget":{"anyOf":[{"type":"object","properties":{"limit_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}]},"window":{"type":"string","enum":["day","week","month"]},"on_breach":{"type":"string","enum":["block","warn"]},"name":{"type":"string","minLength":1,"maxLength":128}},"required":["limit_usd","window"]},{"type":"null"}]},"config":{"type":"object","properties":{"modelsAllowed":{"default":null,"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"providersAllowed":{"default":null,"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"cache":{"default":{"mode":"respect","ttlS":3600},"type":"object","properties":{"mode":{"default":"respect","type":"string","enum":["respect","force","disable"]},"ttlS":{"default":3600,"type":"integer","minimum":0,"maximum":9007199254740991}}},"fallback":{"default":{"maxAttempts":3},"type":"object","properties":{"maxAttempts":{"default":3,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}},"guardrailAttachments":{"default":[],"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["pre","post","stream_chunk"]},"guardrailIds":{"default":[],"type":"array","items":{"type":"string"}}},"required":["direction"]}},"rateLimits":{"default":{"rpm":null,"tpm":null,"rpd":null},"type":"object","properties":{"rpm":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tpm":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rpd":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},"realtime":{"default":{"maxOpenSessions":null},"type":"object","properties":{"maxOpenSessions":{"default":null,"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}}},"metadata":{"type":"object","properties":{"label":{"type":"string"},"tags":{"default":[],"type":"array","items":{"type":"string"}}}}}},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","maxLength":500}},"purpose":{"type":"string","const":"user"}},"required":["name"]}}}}}},"/api/gateway/v1/virtual-keys/{id}":{"get":{"operationId":"getApiGatewayV1VirtualKeysById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false}},"required":["virtual_key"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"summary":"Get virtual key","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiGatewayV1VirtualKeysById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false}},"required":["virtual_key"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Partial update: send only the fields you want to change.","summary":"Update virtual key","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":["string","null"]},"scopes":{"minItems":1,"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string","minLength":1}},"required":["scope_type","scope_id"]}},"trace_project_id":{"type":["string","null"]},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"expires_at":{"anyOf":[{},{"type":"null"}]},"budget":{"anyOf":[{"type":"object","properties":{"limit_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}]},"window":{"type":"string","enum":["day","week","month"]},"on_breach":{"type":"string","enum":["block","warn"]},"name":{"type":"string","minLength":1,"maxLength":128}},"required":["limit_usd","window"]},{"type":"null"}]},"config":{"type":"object","properties":{"modelsAllowed":{"default":null,"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"providersAllowed":{"default":null,"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"cache":{"default":{"mode":"respect","ttlS":3600},"type":"object","properties":{"mode":{"default":"respect","type":"string","enum":["respect","force","disable"]},"ttlS":{"default":3600,"type":"integer","minimum":0,"maximum":9007199254740991}}},"fallback":{"default":{"maxAttempts":3},"type":"object","properties":{"maxAttempts":{"default":3,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}},"guardrailAttachments":{"default":[],"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["pre","post","stream_chunk"]},"guardrailIds":{"default":[],"type":"array","items":{"type":"string"}}},"required":["direction"]}},"rateLimits":{"default":{"rpm":null,"tpm":null,"rpd":null},"type":"object","properties":{"rpm":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tpm":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rpd":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},"realtime":{"default":{"maxOpenSessions":null},"type":"object","properties":{"maxOpenSessions":{"default":null,"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}}},"metadata":{"type":"object","properties":{"label":{"type":"string"},"tags":{"default":[],"type":"array","items":{"type":"string"}}}}}},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","maxLength":500}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/virtual-keys/{id}/spend":{"get":{"operationId":"getApiGatewayV1VirtualKeysByIdSpend","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key_id":{"type":"string"},"spent_usd":{"type":"string"},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"window":{"type":"object","properties":{"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","to"],"additionalProperties":false}},"required":["virtual_key_id","spent_usd","requests","window"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Aggregate spend and request count for one key over a window given in epoch milliseconds (default: current UTC calendar month). Returns 412 spend_source_unavailable on deploys without a ClickHouse spend source.","summary":"Read a virtual key's spend","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayUsage:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"from","schema":{"type":"integer","exclusiveMinimum":0,"maximum":8640000000000000}},{"in":"query","name":"to","schema":{"type":"integer","exclusiveMinimum":0,"maximum":8640000000000000}}]}},"/api/gateway/v1/virtual-keys/{id}/rotate":{"post":{"operationId":"postApiGatewayV1VirtualKeysByIdRotate","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false},"secret":{"type":"string"}},"required":["virtual_key","secret"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Mints a fresh secret for an existing VK. The old secret remains valid for 24h.","summary":"Rotate virtual key secret","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, 8 to 255 characters, that makes this create safe to retry. The first request to use a key runs normally and its response is stored for 24 hours. A later request with the same key and the same body is not executed again: it returns the stored response, marked with `X-Idempotent-Replay: true`. The same key with a different body is refused 409 `idempotency_error`, as is a retry sent while the original is still running. Only successful responses are stored, so a create that failed can simply be retried with the same key.","schema":{"type":"string","minLength":8,"maxLength":255}},{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:rotate"]}}},"/api/gateway/v1/virtual-keys/{id}/disable":{"post":{"operationId":"postApiGatewayV1VirtualKeysByIdDisable","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false}},"required":["virtual_key"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Reversible stop: requests on the key are rejected with virtual_key_disabled until it is enabled again. Idempotent.","summary":"Disable virtual key","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/virtual-keys/{id}/enable":{"post":{"operationId":"postApiGatewayV1VirtualKeysByIdEnable","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false}},"required":["virtual_key"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Reverses disable: the key returns to active exactly as it was. Idempotent.","summary":"Enable virtual key","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/virtual-keys/{id}/revoke":{"post":{"operationId":"postApiGatewayV1VirtualKeysByIdRevoke","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"virtual_key":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"purpose":{"type":"string","enum":["user","langy"]},"display_prefix":{"type":"string"},"principal_user_id":{"type":["string","null"]},"trace_project_id":{"description":"The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.","type":["string","null"]},"trace_project_archived":{"type":"boolean","description":"True when the project in trace_project_id has been deleted. The key goes on sending its traces there."},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string","enum":["organization","team","project"]},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"],"additionalProperties":false}},"routing_policy_id":{"type":["string","null"]},"routing_mode":{"type":"string","enum":["none","fallback_all","policy"]},"config":{},"revision":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops serving, or null for a key that never expires. status stays active past the date on purpose."}},"required":["id","organization_id","name","description","status","purpose","display_prefix","principal_user_id","trace_project_id","trace_project_archived","external_id","metadata","scopes","routing_policy_id","routing_mode","config","revision","created_at","updated_at","last_used_at","revoked_at","expires_at"],"additionalProperties":false}},"required":["virtual_key"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Marks the virtual key as revoked and archives its own budgets. Idempotent.","summary":"Revoke virtual key","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["virtualKeys:delete"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/budgets":{"get":{"operationId":"getApiGatewayV1Budgets","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"scope_type":{"type":"string","enum":["organization","team","project","virtual_key","principal","group","attributed_user"]},"scope_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"window":{"type":"string","enum":["minute","hour","day","week","month","total","manual"]},"on_breach":{"type":"string","enum":["block","warn"]},"limit_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use limit_nano_usd for arithmetic."},"limit_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"spent_usd":{"type":["string","null"]},"spent_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":["string","null"]},"provider_key":{"type":["string","null"]},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"current_period_started_at":{"type":"string"},"resets_at":{"type":"string"},"cycle_anchor_at":{"type":["string","null"]},"last_reset_at":{"type":["string","null"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_over":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope_reach":{"type":"string","enum":["reachable","unreachable"]}},"required":["id","organization_id","scope_type","scope_id","name","description","window","on_breach","limit_usd","limit_nano_usd","spent_usd","spent_nano_usd","timezone","provider_key","external_id","metadata","current_period_started_at","resets_at","cycle_anchor_at","last_reset_at","archived_at","created_at"],"additionalProperties":false}},"spend_available":{"type":"boolean"},"next_cursor":{"description":"Pass back as cursor for the next page. Null means the walk is exhausted.","type":["string","null"]}},"required":["data","spend_available","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Returns the non-archived budgets in the caller's organization across all seven scope types, with live spent_usd from the spend ledger. Takes a project key or an organization key; requires gatewayBudgets:view at the key's project, or at the organization for a key that names no project.","summary":"List budgets","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayBudgets:view"]},"parameters":[{"in":"query","name":"cursor","schema":{"type":"string","maxLength":500}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":200}},{"in":"query","name":"scope_type","schema":{"type":"string"},"description":"Comma-separated subset of the scope types, lowercase."},{"in":"query","name":"external_id","schema":{"type":"string","maxLength":128},"description":"Exact match on the resource's external_id."}]},"post":{"operationId":"postApiGatewayV1Budgets","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"budget":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"scope_type":{"type":"string","enum":["organization","team","project","virtual_key","principal","group","attributed_user"]},"scope_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"window":{"type":"string","enum":["minute","hour","day","week","month","total","manual"]},"on_breach":{"type":"string","enum":["block","warn"]},"limit_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use limit_nano_usd for arithmetic."},"limit_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"spent_usd":{"type":["string","null"]},"spent_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":["string","null"]},"provider_key":{"type":["string","null"]},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"current_period_started_at":{"type":"string"},"resets_at":{"type":"string"},"cycle_anchor_at":{"type":["string","null"]},"last_reset_at":{"type":["string","null"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_over":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope_reach":{"type":"string","enum":["reachable","unreachable"]}},"required":["id","organization_id","scope_type","scope_id","name","description","window","on_breach","limit_usd","limit_nano_usd","spent_usd","spent_nano_usd","timezone","provider_key","external_id","metadata","current_period_started_at","resets_at","cycle_anchor_at","last_reset_at","archived_at","created_at"],"additionalProperties":false}},"required":["budget"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Creates an organization-owned budget across all seven scope types. Spend is counted from the moment the budget is created, so spend earlier in the current window is not included. Requires gatewayBudgets:create at the organization; a project key or an organization key may call it.","summary":"Create budget","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, 8 to 255 characters, that makes this create safe to retry. The first request to use a key runs normally and its response is stored for 24 hours. A later request with the same key and the same body is not executed again: it returns the stored response, marked with `X-Idempotent-Replay: true`. The same key with a different body is refused 409 `idempotency_error`, as is a retry sent while the original is still running. Only successful responses are stored, so a create that failed can simply be retried with the same key.","schema":{"type":"string","minLength":8,"maxLength":255}}],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayBudgets:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"organization_id":{"type":"string"}},"required":["kind","organization_id"]},{"type":"object","properties":{"kind":{"type":"string","const":"team"},"team_id":{"type":"string"}},"required":["kind","team_id"]},{"type":"object","properties":{"kind":{"type":"string","const":"project"},"project_id":{"type":"string"}},"required":["kind","project_id"]},{"type":"object","properties":{"kind":{"type":"string","const":"virtual_key"},"virtual_key_id":{"type":"string"}},"required":["kind","virtual_key_id"]},{"type":"object","properties":{"kind":{"type":"string","const":"principal"},"principal_user_id":{"type":"string"}},"required":["kind","principal_user_id"]},{"type":"object","properties":{"kind":{"type":"string","const":"group"},"group_id":{"type":"string"}},"required":["kind","group_id"]},{"type":"object","properties":{"kind":{"type":"string","const":"attributed_user"},"anchor_virtual_key_id":{"type":"string"},"anchor_project_id":{"type":"string"}},"required":["kind"]}]},"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string"},"window":{"type":"string","enum":["minute","hour","day","week","month","total","manual"]},"limit_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}]},"on_breach":{"type":"string","enum":["block","warn"]},"timezone":{"type":["string","null"]},"provider_key":{"type":["string","null"]},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","maxLength":500}},"cycle_anchor_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"allow_unreachable":{"type":"boolean"}},"required":["scope","name","window","limit_usd"]}}}}}},"/api/gateway/v1/budgets/{id}":{"get":{"operationId":"getApiGatewayV1BudgetsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"budget":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"scope_type":{"type":"string","enum":["organization","team","project","virtual_key","principal","group","attributed_user"]},"scope_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"window":{"type":"string","enum":["minute","hour","day","week","month","total","manual"]},"on_breach":{"type":"string","enum":["block","warn"]},"limit_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use limit_nano_usd for arithmetic."},"limit_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"spent_usd":{"type":["string","null"]},"spent_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":["string","null"]},"provider_key":{"type":["string","null"]},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"current_period_started_at":{"type":"string"},"resets_at":{"type":"string"},"cycle_anchor_at":{"type":["string","null"]},"last_reset_at":{"type":["string","null"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_over":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope_reach":{"type":"string","enum":["reachable","unreachable"]}},"required":["id","organization_id","scope_type","scope_id","name","description","window","on_breach","limit_usd","limit_nano_usd","spent_usd","spent_nano_usd","timezone","provider_key","external_id","metadata","current_period_started_at","resets_at","cycle_anchor_at","last_reset_at","archived_at","created_at"],"additionalProperties":false},"spend_available":{"type":"boolean"}},"required":["budget","spend_available"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Takes a project key or an organization key; requires gatewayBudgets:view at the key's project, or at the organization for a key that names no project.","summary":"Get budget","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayBudgets:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiGatewayV1BudgetsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"budget":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"scope_type":{"type":"string","enum":["organization","team","project","virtual_key","principal","group","attributed_user"]},"scope_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"window":{"type":"string","enum":["minute","hour","day","week","month","total","manual"]},"on_breach":{"type":"string","enum":["block","warn"]},"limit_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use limit_nano_usd for arithmetic."},"limit_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"spent_usd":{"type":["string","null"]},"spent_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":["string","null"]},"provider_key":{"type":["string","null"]},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"current_period_started_at":{"type":"string"},"resets_at":{"type":"string"},"cycle_anchor_at":{"type":["string","null"]},"last_reset_at":{"type":["string","null"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_over":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope_reach":{"type":"string","enum":["reachable","unreachable"]}},"required":["id","organization_id","scope_type","scope_id","name","description","window","on_breach","limit_usd","limit_nano_usd","spent_usd","spent_nano_usd","timezone","provider_key","external_id","metadata","current_period_started_at","resets_at","cycle_anchor_at","last_reset_at","archived_at","created_at"],"additionalProperties":false}},"required":["budget"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Partial update. Scope, window and cycle_anchor_at are immutable after create. Answers with the budget's live spend, the same figure `GET /budgets` reports. Requires gatewayBudgets:update at the organization.","summary":"Update budget","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":["string","null"]},"limit_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}]},"on_breach":{"type":"string","enum":["block","warn"]},"timezone":{"type":["string","null"]},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","maxLength":500}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayBudgets:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiGatewayV1BudgetsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"budget":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"scope_type":{"type":"string","enum":["organization","team","project","virtual_key","principal","group","attributed_user"]},"scope_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"window":{"type":"string","enum":["minute","hour","day","week","month","total","manual"]},"on_breach":{"type":"string","enum":["block","warn"]},"limit_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use limit_nano_usd for arithmetic."},"limit_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"spent_usd":{"type":["string","null"]},"spent_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":["string","null"]},"provider_key":{"type":["string","null"]},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"current_period_started_at":{"type":"string"},"resets_at":{"type":"string"},"cycle_anchor_at":{"type":["string","null"]},"last_reset_at":{"type":["string","null"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_over":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope_reach":{"type":"string","enum":["reachable","unreachable"]}},"required":["id","organization_id","scope_type","scope_id","name","description","window","on_breach","limit_usd","limit_nano_usd","spent_usd","spent_nano_usd","timezone","provider_key","external_id","metadata","current_period_started_at","resets_at","cycle_anchor_at","last_reset_at","archived_at","created_at"],"additionalProperties":false}},"required":["budget"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Soft-delete: the row is marked archived and no longer counted by the budget engine. Requires gatewayBudgets:delete at the organization.","summary":"Archive budget","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayBudgets:delete"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/budgets/{id}/reset":{"post":{"operationId":"postApiGatewayV1BudgetsByIdReset","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"budget":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"scope_type":{"type":"string","enum":["organization","team","project","virtual_key","principal","group","attributed_user"]},"scope_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"window":{"type":"string","enum":["minute","hour","day","week","month","total","manual"]},"on_breach":{"type":"string","enum":["block","warn"]},"limit_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use limit_nano_usd for arithmetic."},"limit_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"spent_usd":{"type":["string","null"]},"spent_nano_usd":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timezone":{"type":["string","null"]},"provider_key":{"type":["string","null"]},"external_id":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"current_period_started_at":{"type":"string"},"resets_at":{"type":"string"},"cycle_anchor_at":{"type":["string","null"]},"last_reset_at":{"type":["string","null"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_users_over":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scope_reach":{"type":"string","enum":["reachable","unreachable"]}},"required":["id","organization_id","scope_type","scope_id","name","description","window","on_breach","limit_usd","limit_nano_usd","spent_usd","spent_nano_usd","timezone","provider_key","external_id","metadata","current_period_started_at","resets_at","cycle_anchor_at","last_reset_at","archived_at","created_at"],"additionalProperties":false}},"required":["budget"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Moves the budget's period boundary to now; recorded spend is never mutated. Requires gatewayBudgets:update at the organization.","summary":"Reset budget period","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayBudgets:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"end_user_id","schema":{"type":"string","minLength":1}}]}},"/api/gateway/v1/cache-rules":{"get":{"operationId":"getApiGatewayV1CacheRules","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"matchers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"action":{"type":"object","properties":{"mode":{"type":"string","enum":["respect","force","disable"]},"ttl":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"salt":{"type":"string"}},"required":["mode"],"additionalProperties":false},"mode_enum":{"type":"string","enum":["respect","force","disable"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","name","description","priority","enabled","matchers","action","mode_enum","archived_at","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass back as cursor for the next page. Null means the walk is exhausted.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Organization-scoped operator-authored rules, priority-ordered, archived rules excluded.","summary":"List cache-control rules","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayCacheRules:view"]},"parameters":[{"in":"query","name":"cursor","schema":{"type":"string","maxLength":500}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":200}}]},"post":{"operationId":"postApiGatewayV1CacheRules","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cache_rule":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"matchers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"action":{"type":"object","properties":{"mode":{"type":"string","enum":["respect","force","disable"]},"ttl":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"salt":{"type":"string"}},"required":["mode"],"additionalProperties":false},"mode_enum":{"type":"string","enum":["respect","force","disable"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","name","description","priority","enabled","matchers","action","mode_enum","archived_at","created_at","updated_at"],"additionalProperties":false}},"required":["cache_rule"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Matchers are ANDed across non-null fields; at least one matcher is required.","summary":"Create a cache rule","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, 8 to 255 characters, that makes this create safe to retry. The first request to use a key runs normally and its response is stored for 24 hours. A later request with the same key and the same body is not executed again: it returns the stored response, marked with `X-Idempotent-Replay: true`. The same key with a different body is refused 409 `idempotency_error`, as is a retry sent while the original is still running. Only successful responses are stored, so a create that failed can simply be retried with the same key.","schema":{"type":"string","minLength":8,"maxLength":255}}],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayCacheRules:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"priority":{"type":"integer","minimum":0,"maximum":1000},"enabled":{"type":"boolean"},"matchers":{"type":"object","properties":{"vk_id":{"type":"string"},"vk_tags":{"type":"array","items":{"type":"string"}},"vk_prefix":{"type":"string"},"principal_id":{"type":"string"},"model":{"type":"string"},"request_metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"additionalProperties":false},"action":{"type":"object","properties":{"mode":{"type":"string","enum":["respect","force","disable"]},"ttl":{"type":"integer","minimum":0,"maximum":86400},"salt":{"type":"string","maxLength":64}},"required":["mode"],"additionalProperties":false}},"required":["name","matchers","action"]}}}}}},"/api/gateway/v1/cache-rules/{id}":{"get":{"operationId":"getApiGatewayV1CacheRulesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cache_rule":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"matchers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"action":{"type":"object","properties":{"mode":{"type":"string","enum":["respect","force","disable"]},"ttl":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"salt":{"type":"string"}},"required":["mode"],"additionalProperties":false},"mode_enum":{"type":"string","enum":["respect","force","disable"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","name","description","priority","enabled","matchers","action","mode_enum","archived_at","created_at","updated_at"],"additionalProperties":false}},"required":["cache_rule"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Returns the rule if it belongs to the caller's organisation; 404 otherwise.","summary":"Get a cache rule","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayCacheRules:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiGatewayV1CacheRulesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cache_rule":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"matchers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"action":{"type":"object","properties":{"mode":{"type":"string","enum":["respect","force","disable"]},"ttl":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"salt":{"type":"string"}},"required":["mode"],"additionalProperties":false},"mode_enum":{"type":"string","enum":["respect","force","disable"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","name","description","priority","enabled","matchers","action","mode_enum","archived_at","created_at","updated_at"],"additionalProperties":false}},"required":["cache_rule"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Partial update. matchers and action REPLACE the stored value when provided.","summary":"Update a cache rule","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"priority":{"type":"integer","minimum":0,"maximum":1000},"enabled":{"type":"boolean"},"matchers":{"type":"object","properties":{"vk_id":{"type":"string"},"vk_tags":{"type":"array","items":{"type":"string"}},"vk_prefix":{"type":"string"},"principal_id":{"type":"string"},"model":{"type":"string"},"request_metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"additionalProperties":false},"action":{"type":"object","properties":{"mode":{"type":"string","enum":["respect","force","disable"]},"ttl":{"type":"integer","minimum":0,"maximum":86400},"salt":{"type":"string","maxLength":64}},"required":["mode"],"additionalProperties":false}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayCacheRules:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiGatewayV1CacheRulesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cache_rule":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"matchers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"action":{"type":"object","properties":{"mode":{"type":"string","enum":["respect","force","disable"]},"ttl":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"salt":{"type":"string"}},"required":["mode"],"additionalProperties":false},"mode_enum":{"type":"string","enum":["respect","force","disable"]},"archived_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","name","description","priority","enabled","matchers","action","mode_enum","archived_at","created_at","updated_at"],"additionalProperties":false}},"required":["cache_rule"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Soft-delete: sets archivedAt. The rule stops matching new requests.","summary":"Archive a cache rule","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayCacheRules:delete"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/providers":{"get":{"operationId":"getApiGatewayV1Providers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"410":{"description":"Gone. Gateway provider bindings folded into ModelProvider in iteration 110.","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Retired. Gateway provider bindings are model-provider rows now; list them at GET /api/model-providers.","summary":"List provider bindings","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayProviders:view"]}},"post":{"operationId":"postApiGatewayV1Providers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"410":{"description":"Gone. Gateway provider bindings folded into ModelProvider in iteration 110.","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Retired. Rate limits, rotation and fallback priority are configured on the model provider itself.","summary":"Bind a model provider to the gateway","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayProviders:manage"]}}},"/api/gateway/v1/providers/{id}":{"patch":{"operationId":"patchApiGatewayV1ProvidersById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"410":{"description":"Gone. Gateway provider bindings folded into ModelProvider in iteration 110.","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Retired. The advanced gateway fields are patched on the model provider itself.","summary":"Update provider binding","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayProviders:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiGatewayV1ProvidersById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"410":{"description":"Gone. Gateway provider bindings folded into ModelProvider in iteration 110.","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Retired. Disabling the underlying model provider is the replacement.","summary":"Disable provider binding","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["gatewayProviders:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/spend-summaries":{"get":{"operationId":"getApiGatewayV1SpendSummaries","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"group":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"bucket_start":{"type":["string","null"]},"event_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"settled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_read_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_creation_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasoning_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_image_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Image tokens billed on the input side, 0 when no image was used. Priced at its own rate and disjoint from input_tokens, which never includes it."},"output_image_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Image tokens the answer was billed for, 0 when no answer held one. Priced at its own rate and disjoint from output_tokens: an image_generation row reports output_tokens 0 and its render here, so a reconciler reading output_tokens alone sees none of the image traffic."},"image_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Images carried, 0 when none were. Display only: no rate prices it, so it never belongs in a cost sum."}},"required":["input_tokens","output_tokens","cache_read_input_tokens","cache_creation_input_tokens","reasoning_tokens","input_image_tokens","output_image_tokens","image_count"],"additionalProperties":false},"cost":{"type":"object","properties":{"total_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use nano_usd for arithmetic."},"nano_usd":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Canonical integer cost, nano-USD. Rated as an integer and summed as one, so this is the figure to reconcile against."}},"required":["total_usd","nano_usd"],"additionalProperties":false}},"required":["key","group","bucket_start","event_count","settled_count","usage","cost"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Reconciliation checksum fast path: spend rollups with token classes and integer nano-USD cost. Settled (unpriced) requests are counted separately as settled_count and never included in cost sums. Diff individual items via /spend-events only when a checksum diverges. `group_by` takes one or two of virtual_key, end_user, project, model, provider, principal and request_type, comma-separated, and `bucket` adds an hour or day column in the `timezone` you name. `key` stays the first dimension's value for consumers written against the single-dimension surface; read `group` to tell two dimensions apart. Paged by group key ascending: follow next_cursor until it comes back null, because a page that is full does not mean the window held nothing more. Grouping by model or provider, or into time buckets, is refused with `gateway_spend_group_by_unstable` while the window is recent enough that outcomes can still arrive, because those groups can move under a page walk and the totals would double-count some requests and miss others; ask for an older range, or send `allow_unstable` when an approximate shape is enough. Every filter here is accepted by /spend-events too, and the reverse holds apart from `status=admitted`: a rollup sums the cost of requests past admission, so an admitted request has none to contribute and that narrowing is refused rather than answered with a zero. Ask /spend-events for those.","summary":"List spend summaries","tags":["Gateway Spend"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["gatewaySpend:view"]},"parameters":[{"in":"query","name":"group_by","schema":{"example":"model,end_user","type":"string"},"required":true,"description":"One or two dimensions, comma separated: virtual_key, end_user, project, model, provider, principal, request_type. A dimension may not repeat. Each row's `key` is the first dimension's value and `group` names them all, so two rows may share a key."},{"in":"query","name":"bucket","schema":{"default":"none","type":"string","enum":["none","hour","day"]}},{"in":"query","name":"timezone","schema":{"default":"UTC","type":"string","minLength":1,"maxLength":64}},{"in":"query","name":"allow_unstable","schema":{"example":"true","default":"false","type":"string"},"description":"true, 1, yes for yes; false, 0, no or omitted for no. Case does not matter, so a Python True is accepted as sent."},{"in":"query","name":"from","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"example":1782864000000},"required":true,"description":"Milliseconds since the Unix epoch, not seconds. An epoch in seconds is a valid integer here and answers for 1970, so a mismatched unit reads as an empty window rather than as an error."},{"in":"query","name":"to","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"example":1782864000000},"required":true,"description":"Milliseconds since the Unix epoch, not seconds. An epoch in seconds is a valid integer here and answers for 1970, so a mismatched unit reads as an empty window rather than as an error."},{"in":"query","name":"cursor","schema":{"type":"string","maxLength":500}},{"in":"query","name":"limit","schema":{"default":500,"type":"integer","exclusiveMinimum":0,"maximum":1000}},{"in":"query","name":"project_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"team_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"external_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]}},{"in":"query","name":"virtual_key_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"end_user_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}]}},{"in":"query","name":"principal_user_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"model","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]}},{"in":"query","name":"provider_key","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"request_type","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":50},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}]}},{"in":"query","name":"label","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]}},{"in":"query","name":"metadata","schema":{"anyOf":[{"type":"string","minLength":3,"maxLength":640},{"maxItems":100,"type":"array","items":{"type":"string","minLength":3,"maxLength":640}}]}},{"in":"query","name":"status","schema":{"type":"string","enum":["success","error","confirmed","failed","settled"]},"description":"Narrow to one lifecycle status. `admitted` is not accepted here: a rollup sums the cost of requests past admission, and an admitted request is still in flight with no cost of its own yet. Ask /spend-events for those."}]}},"/api/gateway/v1/spend-events":{"get":{"operationId":"getApiGatewayV1SpendEvents","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"created":{"type":"string"},"schema_version":{"type":"string"},"data":{"type":"object","properties":{"event_id":{"type":"string"},"event_type":{"type":"string"},"gateway_request_id":{"type":"string"},"occurred_at":{"type":"string"},"usage":{"anyOf":[{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_read_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_creation_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasoning_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_image_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Image tokens billed on the input side, disjoint from input_tokens."},"output_image_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Image tokens the answer was billed for, disjoint from output_tokens."},"image_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Images the request carried. Display only: never part of a cost sum."}},"required":["input_tokens","output_tokens","cache_read_input_tokens","cache_creation_input_tokens","reasoning_tokens","input_image_tokens","output_image_tokens","image_count"],"additionalProperties":false},{"type":"null"}]},"cost":{"anyOf":[{"type":"object","properties":{"total_usd":{"type":"string","description":"Display value. Use nano_usd for arithmetic."},"nano_usd":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Canonical integer cost, nano-USD."},"rate_version":{"type":["string","null"]}},"required":["total_usd","nano_usd"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"needs_reconciliation":{"type":["boolean","null"]},"settle_reason":{"type":["string","null"]},"error":{"anyOf":[{"type":"object","properties":{"class":{"type":"string"},"http_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["class","http_status"],"additionalProperties":false},{"type":"null"}]},"duration_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"labels":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["event_id","event_type","gateway_request_id","occurred_at","usage","cost","status","needs_reconciliation","settle_reason","error","duration_ms","labels","metadata"],"additionalProperties":{}}},"required":["id","type","created","schema_version","data"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Cursor-paged pull over the per-request spend record, ascending by insert order so rows folded late are never skipped by an in-flight cursor. Events are the same canonical objects webhook deliveries carry. Retention is a fixed 13 months, which bounds reconciliation and replay. When feeding a downstream biller, mind its dedup window (Metronome 34 days and Stripe meters 24h+ at the time of writing; both vendors own those numbers, so confirm the current one before you rely on it): re-pulling older ranges into a biller past its window can double-bill. Every filter here is accepted by /spend-summaries too, so a checksum that disagrees can be diffed on exactly the same narrowing; the one difference is `status=admitted`, which only this read answers, because an admitted request is still in flight and contributes no cost to a rollup. Repeat a filter to widen it (`model=a&model=b` matches either); name two different filters to narrow. `metadata` is written `key:value`, split on the first colon, and repeating a key widens that key. `team_id` and `external_id` name Postgres records and are resolved to the projects and keys they cover, so a team with no projects or an external id nobody minted answers with no spend rather than with everything.","summary":"List spend events","tags":["Gateway Spend"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["gatewaySpend:view"]},"parameters":[{"in":"query","name":"from","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"example":1782864000000},"required":true,"description":"Milliseconds since the Unix epoch, not seconds. An epoch in seconds is a valid integer here and answers for 1970, so a mismatched unit reads as an empty window rather than as an error."},{"in":"query","name":"to","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"example":1782864000000},"required":true,"description":"Milliseconds since the Unix epoch, not seconds. An epoch in seconds is a valid integer here and answers for 1970, so a mismatched unit reads as an empty window rather than as an error."},{"in":"query","name":"cursor","schema":{"type":"string","maxLength":500}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":200}},{"in":"query","name":"project_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"team_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"external_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]}},{"in":"query","name":"virtual_key_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"end_user_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}]}},{"in":"query","name":"principal_user_id","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"model","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]}},{"in":"query","name":"provider_key","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}]}},{"in":"query","name":"request_type","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":50},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}]}},{"in":"query","name":"label","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]}},{"in":"query","name":"metadata","schema":{"anyOf":[{"type":"string","minLength":3,"maxLength":640},{"maxItems":100,"type":"array","items":{"type":"string","minLength":3,"maxLength":640}}]}},{"in":"query","name":"status","schema":{"type":"string","enum":["success","error","admitted","confirmed","failed","settled"]}}]}},"/api/gateway/v1/end-users/{id}/spend":{"get":{"operationId":"getApiGatewayV1EndUsersByIdSpend","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"end_user_id":{"type":"string"},"window":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"cost":{"type":"object","properties":{"total_usd":{"type":"string","description":"Display value. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation. Use nano_usd for arithmetic."},"nano_usd":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Canonical integer cost, nano-USD. Rated as an integer and summed as one, so this is the figure to reconcile against."}},"required":["total_usd","nano_usd"],"additionalProperties":false},"request_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_read_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_creation_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasoning_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_image_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Image tokens billed on the input side, 0 when no image was used. Priced at its own rate and disjoint from input_tokens, which never includes it."},"output_image_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Image tokens the answer was billed for, 0 when no answer held one. Priced at its own rate and disjoint from output_tokens: an image_generation row reports output_tokens 0 and its render here, so a reconciler reading output_tokens alone sees none of the image traffic."},"image_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Images carried, 0 when none were. Display only: no rate prices it, so it never belongs in a cost sum."}},"required":["input_tokens","output_tokens","cache_read_input_tokens","cache_creation_input_tokens","reasoning_tokens","input_image_tokens","output_image_tokens","image_count"],"additionalProperties":false},"caps":{"type":"array","items":{"type":"object","properties":{"budget_id":{"type":"string"},"anchor_id":{"type":"string"},"window":{"type":"string"},"on_breach":{"type":"string","enum":["block","warn"]},"limit_usd":{"type":"string","description":"The cap for this end user. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation."},"spent_usd":{"type":"string","description":"Spend against that cap. Decimal string, up to 9 fractional digits, trailing zeros trimmed, never exponent notation."},"period_started_at":{"type":"string"}},"required":["budget_id","anchor_id","window","on_breach","limit_usd","spent_usd","period_started_at"],"additionalProperties":false}}},"required":["end_user_id","window","from","to","cost","request_count","usage","caps"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Windowed spend rollup for one external end user across the organization (the /customer/info-style read a rebilling integration polls). `caps` lists every attributed-user budget that applies to this end user, each with its limit and the spend against it. It is an empty array until such a budget template applies, never null.","summary":"Read one end user's spend","tags":["Gateway Spend"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["gatewaySpend:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"window","schema":{"default":"month","type":"string","enum":["day","week","month"]}},{"in":"query","name":"from","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"to","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"virtual_key_id","schema":{"type":"string","minLength":1,"maxLength":100}}]}},"/api/v1/governance/ingestion-templates":{"get":{"operationId":"getApiGovernanceIngestionTemplates","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"source_type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"icon_asset":{"type":["string","null"]},"credential_schema":{"type":["string","null"]},"ottl_rules":{"type":"string"},"platform_published":{"type":"boolean"},"enabled":{"type":"boolean"},"organization_id":{"type":["string","null"]}},"required":["id","slug","source_type","display_name","description","icon_asset","credential_schema","ottl_rules","platform_published","enabled","organization_id"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Returns the union of platform-published default templates and any org-authored templates visible to the caller's organization. Disabled / archived rows are filtered out. `ottl_rules` is empty in this end-user shape; admins use GET /ingestion-templates/admin to read the canonical OTTL.","summary":"List ingestion templates","tags":["Governance / Ingestion Templates"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["aiTools:view"]}},"post":{"operationId":"postApiGovernanceIngestionTemplates","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ingestion_template":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"source_type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"icon_asset":{"type":["string","null"]},"credential_schema":{"type":["string","null"]},"ottl_rules":{"type":"string"},"platform_published":{"type":"boolean"},"enabled":{"type":"boolean"},"organization_id":{"type":["string","null"]}},"required":["id","slug","source_type","display_name","description","icon_asset","credential_schema","ottl_rules","platform_published","enabled","organization_id"],"additionalProperties":false}},"required":["ingestion_template"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Creates a brand-new template scoped to the caller's organization. Slug is auto-generated. Platform rows (organizationId IS NULL) are NEVER created via this endpoint — admins customize platform defaults via POST /ingestion-templates/clone instead.","summary":"Create org-authored ingestion template","tags":["Governance / Ingestion Templates"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["aiTools:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_type":{"type":"string"},"display_name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":2000},"icon_asset":{"type":"string","maxLength":20000},"credential_schema":{"anyOf":[{"type":"string","enum":["otlp_token","static_api_key","agent_id"]},{"type":"null"}]},"ottl_rules":{"type":"string","maxLength":50000}},"required":["source_type","display_name"]}}}}}},"/api/v1/governance/ingestion-templates/admin":{"get":{"operationId":"getApiGovernanceIngestionTemplatesAdmin","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"source_type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"icon_asset":{"type":["string","null"]},"credential_schema":{"type":["string","null"]},"ottl_rules":{"type":"string"},"platform_published":{"type":"boolean"},"enabled":{"type":"boolean"},"organization_id":{"type":["string","null"]}},"required":["id","slug","source_type","display_name","description","icon_asset","credential_schema","ottl_rules","platform_published","enabled","organization_id"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Same union as the user list but includes the canonical `ottl_rules` source for every row. Used by admin tooling to render the transparency block / authoring drawer.","summary":"List ingestion templates (admin shape, includes OTTL)","tags":["Governance / Ingestion Templates"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["aiTools:manage"]}}},"/api/v1/governance/ingestion-templates/{ingestionTemplateId}":{"get":{"operationId":"getApiGovernanceIngestionTemplatesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ingestion_template":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"source_type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"icon_asset":{"type":["string","null"]},"credential_schema":{"type":["string","null"]},"ottl_rules":{"type":"string"},"platform_published":{"type":"boolean"},"enabled":{"type":"boolean"},"organization_id":{"type":["string","null"]}},"required":["id","slug","source_type","display_name","description","icon_asset","credential_schema","ottl_rules","platform_published","enabled","organization_id"],"additionalProperties":false}},"required":["ingestion_template"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Single-template lookup by id, scoped to the caller's organization, including the canonical `ottl_rules`. Cross-org probes collapse to 404 (no enumeration vector). Members read the same row without `ottl_rules` from GET /ingestion-templates.","summary":"Get ingestion template","tags":["Governance / Ingestion Templates"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["aiTools:manage"]},"parameters":[{"in":"path","name":"ingestionTemplateId","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiGovernanceIngestionTemplatesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"boolean","const":true}},"required":["archived"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Marks the row archived; existing ingestion keys continue to land traces but the row disappears from list views. Platform-published rows reject with 403.","summary":"Soft-archive an org-authored template","tags":["Governance / Ingestion Templates"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["aiTools:manage"]},"parameters":[{"in":"path","name":"ingestionTemplateId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/governance/ingestion-templates/{ingestionTemplateId}/ottl-rules":{"patch":{"operationId":"patchApiGovernanceIngestionTemplatesByIdOttlRules","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ingestion_template":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"source_type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"icon_asset":{"type":["string","null"]},"credential_schema":{"type":["string","null"]},"ottl_rules":{"type":"string"},"platform_published":{"type":"boolean"},"enabled":{"type":"boolean"},"organization_id":{"type":["string","null"]}},"required":["id","slug","source_type","display_name","description","icon_asset","credential_schema","ottl_rules","platform_published","enabled","organization_id"],"additionalProperties":false}},"required":["ingestion_template"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Audit-logged with line counts pre/post. Platform-published rows reject with 403. Admins must clone a platform row before editing it.","summary":"Replace ottl_rules on an org-authored template","tags":["Governance / Ingestion Templates"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["aiTools:manage"]},"parameters":[{"in":"path","name":"ingestionTemplateId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ottl_rules":{"type":"string","maxLength":50000}},"required":["ottl_rules"]}}}}}},"/api/v1/governance/ingestion-templates/clone":{"post":{"operationId":"postApiGovernanceIngestionTemplatesClone","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ingestion_template":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"source_type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"icon_asset":{"type":["string","null"]},"credential_schema":{"type":["string","null"]},"ottl_rules":{"type":"string"},"platform_published":{"type":"boolean"},"enabled":{"type":"boolean"},"organization_id":{"type":["string","null"]}},"required":["id","slug","source_type","display_name","description","icon_asset","credential_schema","ottl_rules","platform_published","enabled","organization_id"],"additionalProperties":false}},"required":["ingestion_template"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Forks the source row's source_type / display_name / OTTL into a fresh org-authored row that the admin can then edit via PATCH /ingestion-templates/:id/ottl-rules.","summary":"Clone a platform-published template into the caller's org","tags":["Governance / Ingestion Templates"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["aiTools:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_template_id":{"type":"string"}},"required":["source_template_id"]}}}}}},"/api/v1/auth/cli/budget/status":{"get":{"operationId":"readCliBudgetStatus","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","const":"budget_exceeded"},"scope":{"type":"string"},"limit_usd":{"type":"string"},"spent_usd":{"type":"string"},"period":{"type":"string"},"request_increase_url":{"type":"string"},"admin_email":{"type":["string","null"]}},"required":["type","scope","limit_usd","spent_usd","period","request_increase_url","admin_email"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/bootstrap":{"get":{"operationId":"readCliBootstrap","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1}},"required":["slug","displayName"],"additionalProperties":false}},"providers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"configured":{"type":"boolean"}},"required":["name","displayName","configured"],"additionalProperties":false}},"gatewayProviders":{"type":"array","items":{"type":"string","minLength":1}},"budget":{"type":"object","properties":{"monthlyLimitUsd":{"type":["number","null"]},"monthlyUsedUsd":{"type":"number"},"period":{"type":"string","const":"MONTHLY"}},"required":["monthlyLimitUsd","monthlyUsedUsd","period"],"additionalProperties":false},"gatewayUrl":{"type":"string","format":"uri"},"adminEmail":{"type":["string","null"]},"toolPolicies":{"type":"object","properties":{"claude":{"type":"object","properties":{"allowVk":{"type":"boolean"},"allowOtelDirect":{"type":"boolean"}},"required":["allowVk","allowOtelDirect"],"additionalProperties":false},"codex":{"type":"object","properties":{"allowVk":{"type":"boolean"},"allowOtelDirect":{"type":"boolean"}},"required":["allowVk","allowOtelDirect"],"additionalProperties":false},"gemini":{"type":"object","properties":{"allowVk":{"type":"boolean"},"allowOtelDirect":{"type":"boolean"}},"required":["allowVk","allowOtelDirect"],"additionalProperties":false},"opencode":{"type":"object","properties":{"allowVk":{"type":"boolean"},"allowOtelDirect":{"type":"boolean"}},"required":["allowVk","allowOtelDirect"],"additionalProperties":false},"cursor":{"type":"object","properties":{"allowVk":{"type":"boolean"},"allowOtelDirect":{"type":"boolean"}},"required":["allowVk","allowOtelDirect"],"additionalProperties":false},"copilot":{"type":"object","properties":{"allowVk":{"type":"boolean"},"allowOtelDirect":{"type":"boolean"}},"required":["allowVk","allowOtelDirect"],"additionalProperties":false},"code":{"type":"object","properties":{"allowVk":{"type":"boolean"},"allowOtelDirect":{"type":"boolean"}},"required":["allowVk","allowOtelDirect"],"additionalProperties":false}},"required":["claude","codex","gemini","opencode","cursor","copilot","code"],"additionalProperties":false}},"required":["tools","providers","gatewayProviders","budget","gatewayUrl","adminEmail","toolPolicies"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/budget-overview":{"get":{"operationId":"readCliBudgetOverview","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"gatewayAccess":{"type":"boolean"},"reason":{"type":"string","enum":["flag_off","no_membership"]},"budgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopeType":{"type":"string"},"scopeId":{"type":"string"},"scopeLabel":{"type":"string"},"window":{"type":"string"},"limitUsd":{"type":"string"},"spentUsd":{"type":"string"},"onBreach":{"type":"string"},"timezone":{"type":["string","null"]},"providerKey":{"type":["string","null"]},"providerLabel":{"type":["string","null"]},"isPerMember":{"type":"boolean"},"managedByVirtualKeyId":{"type":["string","null"]},"scopeClass":{"type":"string","enum":["organization","team","project","personal","key","department","other"]},"scopePhrase":{"type":"string"},"resetsAt":{"type":["string","null"]},"topModels":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"spentUsd":{"type":"number"}},"required":["model","spentUsd"],"additionalProperties":false}}},"required":["id","name","scopeType","scopeId","scopeLabel","window","limitUsd","spentUsd","onBreach","timezone","providerKey","providerLabel","isPerMember","managedByVirtualKeyId","scopeClass","scopePhrase","resetsAt"],"additionalProperties":false}}},"required":["gatewayAccess","budgets"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/personal-project":{"get":{"operationId":"readCliPersonalProject","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false}},"required":["project"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/project-key":{"post":{"operationId":"readCliProjectKey","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false}},"required":["project"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"410":{"description":"Gone","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/virtual-key":{"post":{"operationId":"issueCliVirtualKey","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"},"prefix":{"type":"string"}},"required":["id","secret","prefix"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/governance/ingest/sources":{"get":{"operationId":"listCliIngestionSources","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sourceType":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string"},"lastEventAt":{"type":["string","null"]},"createdAt":{"type":"string"},"archivedAt":{"type":["string","null"]}},"required":["id","name","sourceType","description","status","lastEventAt","createdAt","archivedAt"],"additionalProperties":false}}},"required":["sources"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":["ingestionSources:view"]},"parameters":[{"in":"query","name":"include_archived","schema":{"type":"string"}}]}},"/api/v1/auth/cli/governance/ingest/sources/{sourceId}/events":{"get":{"operationId":"listCliIngestionSourceEvents","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string"},"eventType":{"type":"string"},"actor":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"costUsd":{"type":"string"},"tokensInput":{"type":"integer","minimum":0,"maximum":9007199254740991},"tokensOutput":{"type":"integer","minimum":0,"maximum":9007199254740991},"eventTimestampIso":{"type":"string"},"ingestedAtIso":{"type":"string"},"rawPayload":{"type":"string"}},"required":["eventId","eventType","actor","action","target","costUsd","tokensInput","tokensOutput","eventTimestampIso","ingestedAtIso","rawPayload"],"additionalProperties":false}}},"required":["events"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":["activityMonitor:view"]},"parameters":[{"in":"path","name":"sourceId","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"limit","schema":{"type":"string"}},{"in":"query","name":"before_iso","schema":{"type":"string"}}]}},"/api/v1/auth/cli/governance/ingest/sources/{sourceId}/health":{"get":{"operationId":"readCliIngestionSourceHealth","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false},"health":{"type":"object","properties":{"events24h":{"type":"integer","minimum":0,"maximum":9007199254740991},"events7d":{"type":"integer","minimum":0,"maximum":9007199254740991},"events30d":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastSuccessIso":{"type":["string","null"]}},"required":["events24h","events7d","events30d","lastSuccessIso"],"additionalProperties":false}},"required":["source","health"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":["activityMonitor:view"]},"parameters":[{"in":"path","name":"sourceId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/auth/cli/governance/status":{"get":{"operationId":"readCliGovernanceStatus","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"setup":{"type":"object","properties":{"hasPersonalVKs":{"type":"boolean"},"hasRoutingPolicies":{"type":"boolean"},"hasIngestionSources":{"type":"boolean"},"hasAnomalyRules":{"type":"boolean"},"hasRecentActivity":{"type":"boolean"},"hasApplicationTraces":{"type":"boolean"},"governanceActive":{"type":"boolean"}},"required":["hasPersonalVKs","hasRoutingPolicies","hasIngestionSources","hasAnomalyRules","hasRecentActivity","hasApplicationTraces","governanceActive"],"additionalProperties":false}},"required":["setup"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/governance/ingestion-templates":{"get":{"operationId":"listCliIngestionTemplates","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ingestion_templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":["string","null"]},"slug":{"type":"string"},"source_type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"icon_asset":{"type":["string","null"]},"credential_schema":{"type":["string","null"]},"ottl_rules":{"type":"string"},"platform_published":{"type":"boolean"},"enabled":{"type":"boolean"}},"required":["id","organization_id","slug","source_type","display_name","description","icon_asset","credential_schema","ottl_rules","platform_published","enabled"],"additionalProperties":false}}},"required":["ingestion_templates"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/governance/ingestion-key":{"post":{"operationId":"mintCliIngestionKey","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"prefix":{"type":"string"},"endpoint":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false}},"required":["token","prefix","endpoint"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/json":{}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/governance/ingestion-keys":{"get":{"operationId":"listCliIngestionKeys","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"source_type":{"type":"string"},"lookup_id":{"type":"string"},"ingestion_template_id":{"type":["string","null"]}},"required":["source_type","lookup_id","ingestion_template_id"],"additionalProperties":false}}},"required":["keys"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]}}},"/api/v1/auth/cli/governance/ingestion-keys/{lookup_id}":{"get":{"operationId":"readCliIngestionKeyState","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"lookup_id":{"type":"string"},"status":{"type":"string","enum":["unknown","live","revoked"]},"source_type":{"type":"string"},"revocation_cause":{"type":["string","null"]}},"required":["lookup_id","status"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"402":{"description":"Response 402","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"412":{"description":"Response 412","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"upgrade_url":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}},"security":[{"cli_access_token":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["cli_access_token"],"permissions":[]},"parameters":[{"in":"path","name":"lookup_id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/me/usage":{"get":{"operationId":"getApiMeUsage","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"spentUsd":{"type":"number"},"billedUsd":{"type":"number"},"requests":{"type":"number"},"promptTokens":{"type":"number"},"completionTokens":{"type":"number"},"mostUsedModel":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"usagePct":{"type":"number"}},"required":["name","usagePct"],"additionalProperties":false},{"type":"null"}]}},"required":["spentUsd","billedUsd","requests","promptTokens","completionTokens","mostUsedModel"],"additionalProperties":false},"dailyBuckets":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"spentUsd":{"type":"number"},"billedUsd":{"type":"number"},"requests":{"type":"number"}},"required":["day","spentUsd","billedUsd","requests"],"additionalProperties":false}},"breakdownByModel":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"spentUsd":{"type":"number"},"billedUsd":{"type":"number"},"requests":{"type":"number"}},"required":["label","spentUsd","billedUsd","requests"],"additionalProperties":false}}},"required":["summary","dailyBuckets","breakdownByModel"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Personal AI usage for the current month (or an explicit window): spend, billed spend, request + token counts, per-day buckets, and per-model breakdown. Requires a personal-project API key.","tags":["Me"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]},"parameters":[{"in":"query","name":"windowStartMs","schema":{"type":"integer","minimum":-8640000000000000,"maximum":8640000000000000}},{"in":"query","name":"windowEndMs","schema":{"type":"integer","minimum":-8640000000000000,"maximum":8640000000000000}}]}},"/api/v1/instant-evals":{"post":{"operationId":"createInstantEvalRun","responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The run id."},"name":{"description":"What the run was called, if anything.","type":["string","null"]},"sql":{"type":"string","description":"The statement, exactly as submitted."},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":["string","number","boolean","null"]},{"type":"array","items":{"type":"string"}}]},"description":"The values the statement's parameters were filled with."},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The statement's own output column, which is the name this question is addressed by everywhere else."},"function":{"type":"string","description":"The eval function that asked it."},"kind":{"type":"string","enum":["boolean","score","category"],"description":"What kind of answer the question takes."},"reads":{"type":"string","description":"Which part of the verdict the statement's column carries."},"threshold":{"description":"Where a boolean question's probability becomes a pass. Null for a question that is not a boolean.","type":["number","null"]}},"required":["id","function","kind","reads","threshold"],"additionalProperties":false},"description":"One entry per eval function the statement projects, derived from it when the run was accepted."},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows this run may judge."},"status":{"type":"string","enum":["queued","planning","running","finished","failed","cancelled"],"description":"Where the run is in its life."},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Rows the run found, bounded by its limit. Null until it has looked."},"progress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows judged so far."},"matched":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Judgements that matched, across this run's boolean questions. Null when the run asked none: a score or a category question has no match to count."},"matchedByQuestion":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Per question: matches for a boolean question, judged rows for a score or a category one."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge could not answer."},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge declined to answer."},"tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Input tokens the judge billed for."},"priceUsd":{"type":"number","description":"What the judging costs you, in United States dollars."},"error":{"description":"The code of the failure that ended the run, when one did.","type":["string","null"]},"createdAt":{"type":"string","description":"When the run was accepted."},"updatedAt":{"type":"string","description":"When the run was last written to."},"startedAt":{"description":"When the run began reading rows.","type":["string","null"]},"finishedAt":{"description":"When the run ended.","type":["string","null"]}},"required":["id","name","sql","parameters","questions","limit","status","total","progress","matched","matchedByQuestion","failed","skipped","tokens","priceUsd","error","createdAt","updatedAt","startedAt","finishedAt"],"additionalProperties":false}}}}},"description":"Start a run. The statement is accepted, its questions are derived from the eval functions it projects, and the judging happens on the queue: the answer is the queued run, and its progress is read back from the run endpoint. A statement the query policy refuses, one that projects no TraceId, one that projects no eval function, and a row limit past what the plan allows are all refused before anything is judged. Instead of a statement you may send a target and your questions, and the statement is written for you and handed back on the run; sending both is refused.","tags":["Instant Evals"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"description":"The LangWatchQL statement to judge. It must project TraceId and at least one eval function column. Send this or target, never both.","type":"string","minLength":1,"maxLength":50000},"parameters":{"description":"Values for the parameters the statement declares.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"target":{"description":"What one judged row is, in place of a statement: a trace, a conversation, or one model call. The statement is written for you from this and the questions, and handed back on the run so you can edit it and resubmit.","type":"string","enum":["traces","threads","llm_spans"]},"filter":{"description":"With target: a trace filter, in the language the trace explorer's search bar speaks, narrowing which rows are judged.","type":"string","maxLength":4000},"start":{"description":"With target: the oldest instant to judge, as an ISO 8601 timestamp. Defaults to seven days ago.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"end":{"description":"With target: the newest instant to judge. Defaults to now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"questions":{"description":"With target: what to ask of each row. One classification asks them all per row, and the question text is part of what that classification is priced on; the estimate endpoint prices the exact set.","type":"array","items":{"type":"object","properties":{"id":{"description":"What to call this question. It becomes the statement's output column and the name every judgement is filed under. Defaults to q1, q2 and so on.","type":"string","minLength":1,"maxLength":64},"kind":{"default":"boolean","description":"What kind of answer you want: a yes or no, a rating on a scale, or one of a list of options.","type":"string","enum":["boolean","score","category"]},"instructions":{"type":"string","minLength":1,"maxLength":2000,"description":"The question, in your own words, as you would write it for a human reader."},"criteria":{"description":"For a yes or no question: what counts as yes, then what counts as no. Cannot be combined with a threshold.","minItems":2,"maxItems":2,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"threshold":{"description":"For a yes or no question: the probability at or above which the answer counts as yes. Without one the column carries the probability itself and a run draws the line at an even chance.","type":"number","minimum":0,"maximum":1},"range":{"description":"For a rating: the two ends of the scale.","type":"object","properties":{"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The lowest level of the scale."},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The highest level of the scale."}},"required":["min","max"]},"options":{"description":"For a choice: the options to pick between.","minItems":2,"maxItems":255,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"What the column holds when this option is the answer."},"description":{"type":"string","minLength":1,"maxLength":500,"description":"What this option means, in your own words."}},"required":["name","description"]}}},"required":["instructions"]}},"name":{"description":"What to call the run. Yours to choose.","type":"string","minLength":1,"maxLength":200},"limit":{"description":"Rows the run may judge. Ten thousand by default on every plan, up to one hundred thousand on a plan that lifts the cap.","type":"integer","exclusiveMinimum":0,"maximum":100000}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:manage"]}},"get":{"operationId":"listInstantEvalRuns","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The run id."},"name":{"description":"What the run was called, if anything.","type":["string","null"]},"sql":{"type":"string","description":"The statement, exactly as submitted."},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":["string","number","boolean","null"]},{"type":"array","items":{"type":"string"}}]},"description":"The values the statement's parameters were filled with."},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The statement's own output column, which is the name this question is addressed by everywhere else."},"function":{"type":"string","description":"The eval function that asked it."},"kind":{"type":"string","enum":["boolean","score","category"],"description":"What kind of answer the question takes."},"reads":{"type":"string","description":"Which part of the verdict the statement's column carries."},"threshold":{"description":"Where a boolean question's probability becomes a pass. Null for a question that is not a boolean.","type":["number","null"]}},"required":["id","function","kind","reads","threshold"],"additionalProperties":false},"description":"One entry per eval function the statement projects, derived from it when the run was accepted."},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows this run may judge."},"status":{"type":"string","enum":["queued","planning","running","finished","failed","cancelled"],"description":"Where the run is in its life."},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Rows the run found, bounded by its limit. Null until it has looked."},"progress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows judged so far."},"matched":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Judgements that matched, across this run's boolean questions. Null when the run asked none: a score or a category question has no match to count."},"matchedByQuestion":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Per question: matches for a boolean question, judged rows for a score or a category one."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge could not answer."},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge declined to answer."},"tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Input tokens the judge billed for."},"priceUsd":{"type":"number","description":"What the judging costs you, in United States dollars."},"error":{"description":"The code of the failure that ended the run, when one did.","type":["string","null"]},"createdAt":{"type":"string","description":"When the run was accepted."},"updatedAt":{"type":"string","description":"When the run was last written to."},"startedAt":{"description":"When the run began reading rows.","type":["string","null"]},"finishedAt":{"description":"When the run ended.","type":["string","null"]}},"required":["id","name","sql","parameters","questions","limit","status","total","progress","matched","matchedByQuestion","failed","skipped","tokens","priceUsd","error","createdAt","updatedAt","startedAt","finishedAt"],"additionalProperties":false},"description":"The project's runs, newest first."}},"required":["runs"],"additionalProperties":false}}}}},"description":"List the project's runs, newest first. The project comes from the credential, so a run of another project is never listed. Page through them with before, which takes the created time of the oldest run the previous page carried.","tags":["Instant Evals"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"description":"Runs to list, at most one hundred."},{"in":"query","name":"before","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"List runs accepted strictly before this instant, as an ISO 8601 timestamp. Half of the list's cursor: pass `beforeId` with it."},{"in":"query","name":"beforeId","schema":{"type":"string","minLength":1,"maxLength":200},"description":"The id of the last run of the previous page. Two runs can share an instant, so this is what keeps a page from skipping the others written in the same millisecond."}]}},"/api/v1/instant-evals/estimate":{"post":{"operationId":"estimateInstantEvalRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the statement matches, bounded by the run's limit."},"isRowsCapped":{"type":"boolean","description":"Whether the statement matches more rows than the run may judge."},"avgTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Input tokens one judged row sends, measured from a sample."},"totalTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Input tokens the whole run would send."},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Classifications the run would make, one per judged row."},"priceUsd":{"type":"number","description":"What the run would cost you, in United States dollars."},"freeBudgetRemainingUsd":{"description":"What is left of the free Instant Evals budget, in United States dollars. Only present for an organization without a paid plan.","type":"number"}},"required":["rows","isRowsCapped","avgTokens","totalTokens","requests","priceUsd"],"additionalProperties":false}}}}},"description":"Price a run without starting it. The rows are counted, a sample of their texts is measured, and the cost is worked out from that. Nothing is judged and nothing is charged. Takes the same body a run does, a statement or a target with questions.","summary":"Estimate a run","tags":["Instant Evals"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"description":"The LangWatchQL statement to judge. It must project TraceId and at least one eval function column. Send this or target, never both.","type":"string","minLength":1,"maxLength":50000},"parameters":{"description":"Values for the parameters the statement declares.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"target":{"description":"What one judged row is, in place of a statement: a trace, a conversation, or one model call. The statement is written for you from this and the questions, and handed back on the run so you can edit it and resubmit.","type":"string","enum":["traces","threads","llm_spans"]},"filter":{"description":"With target: a trace filter, in the language the trace explorer's search bar speaks, narrowing which rows are judged.","type":"string","maxLength":4000},"start":{"description":"With target: the oldest instant to judge, as an ISO 8601 timestamp. Defaults to seven days ago.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"end":{"description":"With target: the newest instant to judge. Defaults to now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"questions":{"description":"With target: what to ask of each row. One classification asks them all per row, and the question text is part of what that classification is priced on; the estimate endpoint prices the exact set.","type":"array","items":{"type":"object","properties":{"id":{"description":"What to call this question. It becomes the statement's output column and the name every judgement is filed under. Defaults to q1, q2 and so on.","type":"string","minLength":1,"maxLength":64},"kind":{"default":"boolean","description":"What kind of answer you want: a yes or no, a rating on a scale, or one of a list of options.","type":"string","enum":["boolean","score","category"]},"instructions":{"type":"string","minLength":1,"maxLength":2000,"description":"The question, in your own words, as you would write it for a human reader."},"criteria":{"description":"For a yes or no question: what counts as yes, then what counts as no. Cannot be combined with a threshold.","minItems":2,"maxItems":2,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"threshold":{"description":"For a yes or no question: the probability at or above which the answer counts as yes. Without one the column carries the probability itself and a run draws the line at an even chance.","type":"number","minimum":0,"maximum":1},"range":{"description":"For a rating: the two ends of the scale.","type":"object","properties":{"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The lowest level of the scale."},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The highest level of the scale."}},"required":["min","max"]},"options":{"description":"For a choice: the options to pick between.","minItems":2,"maxItems":255,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"What the column holds when this option is the answer."},"description":{"type":"string","minLength":1,"maxLength":500,"description":"What this option means, in your own words."}},"required":["name","description"]}}},"required":["instructions"]}},"name":{"description":"What to call the run. Yours to choose.","type":"string","minLength":1,"maxLength":200},"limit":{"description":"Rows the run may judge. Ten thousand by default on every plan, up to one hundred thousand on a plan that lifts the cap.","type":"integer","exclusiveMinimum":0,"maximum":100000}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:manage"]}}},"/api/v1/instant-evals/{id}":{"get":{"operationId":"getInstantEvalRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The run id."},"name":{"description":"What the run was called, if anything.","type":["string","null"]},"sql":{"type":"string","description":"The statement, exactly as submitted."},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":["string","number","boolean","null"]},{"type":"array","items":{"type":"string"}}]},"description":"The values the statement's parameters were filled with."},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The statement's own output column, which is the name this question is addressed by everywhere else."},"function":{"type":"string","description":"The eval function that asked it."},"kind":{"type":"string","enum":["boolean","score","category"],"description":"What kind of answer the question takes."},"reads":{"type":"string","description":"Which part of the verdict the statement's column carries."},"threshold":{"description":"Where a boolean question's probability becomes a pass. Null for a question that is not a boolean.","type":["number","null"]}},"required":["id","function","kind","reads","threshold"],"additionalProperties":false},"description":"One entry per eval function the statement projects, derived from it when the run was accepted."},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows this run may judge."},"status":{"type":"string","enum":["queued","planning","running","finished","failed","cancelled"],"description":"Where the run is in its life."},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Rows the run found, bounded by its limit. Null until it has looked."},"progress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows judged so far."},"matched":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Judgements that matched, across this run's boolean questions. Null when the run asked none: a score or a category question has no match to count."},"matchedByQuestion":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Per question: matches for a boolean question, judged rows for a score or a category one."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge could not answer."},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge declined to answer."},"tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Input tokens the judge billed for."},"priceUsd":{"type":"number","description":"What the judging costs you, in United States dollars."},"error":{"description":"The code of the failure that ended the run, when one did.","type":["string","null"]},"createdAt":{"type":"string","description":"When the run was accepted."},"updatedAt":{"type":"string","description":"When the run was last written to."},"startedAt":{"description":"When the run began reading rows.","type":["string","null"]},"finishedAt":{"description":"When the run ended.","type":["string","null"]}},"required":["id","name","sql","parameters","questions","limit","status","total","progress","matched","matchedByQuestion","failed","skipped","tokens","priceUsd","error","createdAt","updatedAt","startedAt","finishedAt"],"additionalProperties":false}}}},"404":{"description":"This project holds no run with that id (instant_eval_not_found)","content":{}}},"description":"Read one run: its status, how many rows it found and judged, how many matched in total and per question, what it could not answer, and the tokens, cost and price the judging came to. An id this project does not hold answers 404 instant_eval_not_found.","tags":["Instant Evals"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The run id."}]}},"/api/v1/instant-evals/{id}/cancel":{"post":{"operationId":"cancelInstantEvalRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The run id."},"name":{"description":"What the run was called, if anything.","type":["string","null"]},"sql":{"type":"string","description":"The statement, exactly as submitted."},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":["string","number","boolean","null"]},{"type":"array","items":{"type":"string"}}]},"description":"The values the statement's parameters were filled with."},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The statement's own output column, which is the name this question is addressed by everywhere else."},"function":{"type":"string","description":"The eval function that asked it."},"kind":{"type":"string","enum":["boolean","score","category"],"description":"What kind of answer the question takes."},"reads":{"type":"string","description":"Which part of the verdict the statement's column carries."},"threshold":{"description":"Where a boolean question's probability becomes a pass. Null for a question that is not a boolean.","type":["number","null"]}},"required":["id","function","kind","reads","threshold"],"additionalProperties":false},"description":"One entry per eval function the statement projects, derived from it when the run was accepted."},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows this run may judge."},"status":{"type":"string","enum":["queued","planning","running","finished","failed","cancelled"],"description":"Where the run is in its life."},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Rows the run found, bounded by its limit. Null until it has looked."},"progress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows judged so far."},"matched":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Judgements that matched, across this run's boolean questions. Null when the run asked none: a score or a category question has no match to count."},"matchedByQuestion":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Per question: matches for a boolean question, judged rows for a score or a category one."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge could not answer."},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the judge declined to answer."},"tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Input tokens the judge billed for."},"priceUsd":{"type":"number","description":"What the judging costs you, in United States dollars."},"error":{"description":"The code of the failure that ended the run, when one did.","type":["string","null"]},"createdAt":{"type":"string","description":"When the run was accepted."},"updatedAt":{"type":"string","description":"When the run was last written to."},"startedAt":{"description":"When the run began reading rows.","type":["string","null"]},"finishedAt":{"description":"When the run ended.","type":["string","null"]}},"required":["id","name","sql","parameters","questions","limit","status","total","progress","matched","matchedByQuestion","failed","skipped","tokens","priceUsd","error","createdAt","updatedAt","startedAt","finishedAt"],"additionalProperties":false}}}},"404":{"description":"This project holds no run with that id (instant_eval_not_found)","content":{}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Ask a run to stop. The run stops before its next page, so the pages it already judged keep their judgements and are still readable. A run that has already finished, failed or been cancelled answers 409 instant_eval_already_finished.","summary":"Cancel a run","tags":["Instant Evals"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The run id."}]}},"/api/v1/instant-evals/{id}/results":{"get":{"operationId":"listInstantEvalRunResults","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"judgments":{"type":"array","items":{"type":"object","properties":{"traceId":{"type":"string","description":"The trace the judgement is about."},"questionId":{"type":"string","description":"The question it answers, named by its output column."},"threadId":{"type":"string","description":"The conversation the trace belongs to."},"spanId":{"type":"string","description":"The span the judged text was read from."},"kind":{"type":"string","description":"What kind of question was asked."},"status":{"type":"string","enum":["judged","skipped","failed"],"description":"Whether the judge answered, declined, or could not answer."},"passed":{"description":"Whether a boolean question passed its threshold.","type":["boolean","null"]},"score":{"description":"A score question's answer.","type":["number","null"]},"label":{"description":"A category question's answer.","type":["string","null"]},"probability":{"description":"How likely the judge found a boolean question's answer to be true.","type":["number","null"]},"probabilities":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}],"description":"The full distribution behind a category answer."},"error":{"description":"Why the judge could not answer, when it could not.","type":["string","null"]},"occurredAt":{"type":"string","description":"When the judgement was made."}},"required":["traceId","questionId","threadId","spanId","kind","status","passed","score","label","probability","probabilities","error","occurredAt"],"additionalProperties":false},"description":"One page of the run's judgements."},"nextCursor":{"description":"Pass as cursor to read the page after this one. Absent on the last page.","type":"string"}},"required":["judgments"],"additionalProperties":false}}}},"404":{"description":"This project holds no run with that id (instant_eval_not_found)","content":{}}},"description":"Read the run's judgements, one page at a time. Pass the cursor a page answers with to read the page after it; the last page carries no cursor, and no judgement is ever carried by two pages. Narrow the page with questionId, matched and status.","summary":"Read a run's results","tags":["Instant Evals"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The run id."},{"in":"query","name":"questionId","schema":{"type":"string","minLength":1},"description":"Only this question's judgements."},{"in":"query","name":"matched","schema":{"type":"string","enum":["0","1","true","yes","false","no"]},"description":"Only judgements that matched, or only those that did not. Omit for both."},{"in":"query","name":"status","schema":{"type":"string","enum":["judged","skipped","failed"]},"description":"Only judgements in this state."},{"in":"query","name":"limit","schema":{"default":100,"type":"integer","minimum":1,"maximum":1000},"description":"Judgements per page, at most one thousand."},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1,"maxLength":500},"description":"The cursor the previous page answered with."}]}},"/api/v1/instant-evals/{id}/sample":{"get":{"operationId":"sampleInstantEvalRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The statement's own rows, with each judged column holding the text that was judged rather than the verdict."},"judgments":{"type":"array","items":{"type":"object","properties":{"traceId":{"type":"string","description":"The trace the judgement is about."},"questionId":{"type":"string","description":"The question it answers, named by its output column."},"threadId":{"type":"string","description":"The conversation the trace belongs to."},"spanId":{"type":"string","description":"The span the judged text was read from."},"kind":{"type":"string","description":"What kind of question was asked."},"status":{"type":"string","enum":["judged","skipped","failed"],"description":"Whether the judge answered, declined, or could not answer."},"passed":{"description":"Whether a boolean question passed its threshold.","type":["boolean","null"]},"score":{"description":"A score question's answer.","type":["number","null"]},"label":{"description":"A category question's answer.","type":["string","null"]},"probability":{"description":"How likely the judge found a boolean question's answer to be true.","type":["number","null"]},"probabilities":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}],"description":"The full distribution behind a category answer."},"error":{"description":"Why the judge could not answer, when it could not.","type":["string","null"]},"occurredAt":{"type":"string","description":"When the judgement was made."}},"required":["traceId","questionId","threadId","spanId","kind","status","passed","score","label","probability","probabilities","error","occurredAt"],"additionalProperties":false},"description":"The verdicts those rows received."}},"required":["rows","judgments"],"additionalProperties":false}}}},"404":{"description":"This project holds no run with that id (instant_eval_not_found)","content":{}}},"description":"Read a few of the run's rows with the text that was judged beside the verdict it received. The text is re-read through the statement's own extraction functions, so nothing is judged again and reading a sample is free.","summary":"Sample a run","tags":["Instant Evals"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["analytics:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The run id."},{"in":"query","name":"n","schema":{"default":5,"type":"integer","minimum":1,"maximum":25},"description":"Rows to re-read, at most twenty five."}]}},"/api/v1/langy/conversations":{"post":{"operationId":"startLangyConversationTurn","responses":{"200":{"description":"Success","content":{"application/json":{},"text/plain; charset=UTF-8":{}}}},"description":"Start a Langy conversation with one turn. The turn surface answers 202 with the accepted turn, 200 with the settled reply under Prefer: wait, and a plain 404 when the rollout is dark for the project.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["langy:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"minItems":1,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"parts":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}}},"content":{"type":"string"}},"required":["role"]}},"idempotencyKey":{"type":"string","minLength":1},"modelOverride":{"type":"string","minLength":1},"adoptConversationId":{"type":"boolean"}},"required":["messages","idempotencyKey"]}}}}}},"/api/v1/langy/conversations/{conversationId}/messages":{"post":{"operationId":"continueLangyConversationTurn","responses":{"200":{"description":"Success","content":{"application/json":{},"text/plain; charset=UTF-8":{}}}},"description":"Continue one Langy conversation with a turn. The turn surface answers 202 with the accepted turn, 200 with the settled reply under Prefer: wait, and a plain 404 when the rollout is dark for the project.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["langy:create"]},"parameters":[{"in":"path","name":"conversationId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"minItems":1,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"parts":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}}},"content":{"type":"string"}},"required":["role"]}},"idempotencyKey":{"type":"string","minLength":1},"modelOverride":{"type":"string","minLength":1},"adoptConversationId":{"type":"boolean"}},"required":["messages","idempotencyKey"]}}}}}},"/api/v1/langy/ui/actions":{"post":{"operationId":"langyUiActionsDispatch","responses":{"200":{"description":"Success","content":{"application/json":{},"text/plain; charset=UTF-8":{}}}},"description":"The dispatch answers the action service's own outcome, and a plain 404 when the rollout is dark for the project.","requestBody":{"required":true,"content":{"text/plain":{}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]}},"get":{"operationId":"langyUiActionsList","responses":{"200":{"description":"Success","content":{"application/json":{},"text/plain; charset=UTF-8":{}}}},"description":"The catalogue publishes each action's own draft-07 payload schema, which the CLI reads as it stands.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]}}},"/api/internal/langy/turn/{turnId}/result":{"post":{"operationId":"ingestTurnResult","responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"accepted"}},"required":["status"],"additionalProperties":false}}}}},"security":[{"internal_secret":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["internal_secret"],"permissions":[]},"parameters":[{"in":"path","name":"turnId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"conversationId":{"type":"string","minLength":1},"status":{"type":"string","enum":["completed","failed"]},"text":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"input":{},"output":{"type":"string"},"isError":{"type":"boolean"},"result":{}},"required":["id","name"]}},"errorCode":{"type":"string"}},"required":["projectId","conversationId","status"]}}}}}},"/api/internal/langy/credentials/revoke":{"post":{"operationId":"revokeWorkerSessionKey","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["revoked","already_revoked","not_found"]}},"required":["outcome"],"additionalProperties":false}}}}},"security":[{"internal_secret":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["internal_secret"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKeyId":{"type":"string","minLength":1,"maxLength":128},"projectId":{"type":"string","minLength":1,"maxLength":128}},"required":["apiKeyId","projectId"]}}}}}},"/api/internal/langy/relay/frames":{"post":{"operationId":"streamRelayFrames","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"applied":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":0,"maximum":9007199254740991},"terminal":{"type":"boolean"}},"required":["applied","duplicate","rejected","terminal"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/x-ndjson":{}}},"security":[{"internal_secret":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["internal_secret"],"permissions":[]}}},"/api/v1/langy/local/workspace":{"get":{"operationId":"langyLocalWorkspace","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"workspace":{"type":"object","properties":{"root":{"type":"string","minLength":1,"maxLength":4096},"name":{"type":"string","minLength":1,"maxLength":255},"gitRepository":{"type":"boolean"},"gitBranch":{"type":"string","maxLength":255},"gitRemote":{"type":"string","maxLength":2048},"gitDirty":{"type":"boolean"},"os":{"type":"string","maxLength":64},"nodeVersion":{"type":"string","maxLength":64},"pythonVersion":{"type":"string","maxLength":64},"ghAuthenticated":{"type":"boolean"},"packageManager":{"type":"string","maxLength":32}},"required":["root","name","os"],"additionalProperties":false},"codeAccessPreference":{"anyOf":[{"type":"string","enum":["github"]},{"type":"null"}]},"github":{"type":"object","properties":{"installed":{"type":"boolean"},"accountLogin":{"type":"string"}},"required":["installed"],"additionalProperties":false},"pendingRequest":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"conversationTitle":{"type":"string"},"conversationUrl":{"type":"string"},"projectId":{"type":"string"},"projectName":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","conversationId","conversationTitle","conversationUrl","projectId","projectName","createdAt","expiresAt"],"additionalProperties":false}},"required":["connected","codeAccessPreference","github"],"additionalProperties":false}}}}},"description":"The code access card's own status document, as the command line reads it.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"query","name":"conversationId","schema":{"type":"string"}}]}},"/api/v1/langy/local/requests":{"post":{"operationId":"langyLocalCreateRequest","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"conversationTitle":{"type":"string"},"conversationUrl":{"type":"string"},"projectId":{"type":"string"},"projectName":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","conversationId","conversationTitle","conversationUrl","projectId","projectName","createdAt","expiresAt"],"additionalProperties":false},"command":{"type":"string"}},"required":["request","command"],"additionalProperties":false}}}}},"description":"The recorded request and the command that approves it.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string","minLength":1}},"required":["conversationId"]}}}}}},"/api/v1/langy/local/calls":{"post":{"operationId":"langyLocalStartCall","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"callId":{"type":"string"}},"required":["callId"],"additionalProperties":false}}}}},"description":"The started call's own id.","requestBody":{"required":true,"content":{"text/plain":{}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]}}},"/api/v1/langy/local/calls/{callId}":{"get":{"operationId":"langyLocalReadCall","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"callId":{"type":"string"},"state":{"type":"string","enum":["pending","running","awaiting_permission","done"]},"ok":{"type":"boolean"},"text":{"type":"string"},"output":{"type":"object","properties":{"exitCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stdout":{"type":"string"},"stderr":{"type":"string"},"truncated":{"type":"boolean"},"logPath":{"type":"string"},"pid":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["exitCode","stdout","stderr","truncated","durationMs"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["path_refused","command_refused","permission_denied","permission_expired","cancelled","timeout","exec_failed","not_found","key_refused"]},"message":{"type":"string","maxLength":4000}},"required":["code","message"],"additionalProperties":false}},"required":["callId","state"],"additionalProperties":false}}}}},"description":"The call's answer, or not found while it is still running.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"callId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/langy/local/calls/{callId}/cancel":{"post":{"operationId":"langyLocalCancelCall","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"callId":{"type":"string"},"cancelled":{"type":"boolean","const":true}},"required":["callId","cancelled"],"additionalProperties":false}}}}},"description":"The cancelled call's own id.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"callId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/langy/waits":{"post":{"operationId":"langyLocalStartWait","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"waitId":{"type":"string"}},"required":["waitId"],"additionalProperties":false}}}}},"description":"The started wait's own id.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string","minLength":1},"turnId":{"type":"string","minLength":1},"toolCallId":{"type":"string","minLength":1},"kind":{"type":"string","const":"question"},"questions":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"header":{"type":"string","maxLength":60},"options":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":1000},"quiet":{"type":"boolean"}},"required":["label"]}},"multiple":{"type":"boolean"},"allowOther":{"type":"boolean"},"bare":{"type":"boolean"}},"required":["question","options"]}}},"required":["conversationId","turnId","kind","questions"]}}}}}},"/api/v1/langy/waits/{waitId}":{"get":{"operationId":"langyLocalReadWait","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"waitId":{"type":"string"},"state":{"type":"string","enum":["pending","answered","expired","cancelled"]},"answers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string"},"selected":{"type":"array","items":{"type":"string"}},"other":{"type":"string"}},"required":["question","selected"],"additionalProperties":false}}},"required":["waitId","state"],"additionalProperties":false}}}}},"description":"The answered question, or not found while it is still waiting.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"waitId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/langy/control/requests":{"get":{"operationId":"listLangyControlRequests","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"conversationTitle":{"type":"string"},"conversationUrl":{"type":"string"},"projectId":{"type":"string"},"projectName":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","conversationId","conversationTitle","conversationUrl","projectId","projectName","createdAt","expiresAt"],"additionalProperties":false}}},"required":["requests"],"additionalProperties":false}}}}},"description":"List the open requests Langy made for a folder of mine, on every project I can read. Only the person Langy asked ever sees a request, and each one expires fifteen minutes after it was made.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["langy:view"]}}},"/api/v1/langy/control/requests/{requestId}/approve":{"post":{"operationId":"approveLangyControlRequest","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"sessionKey":{"type":"string"},"endpoint":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"required":["id","title","url"],"additionalProperties":false}},"required":["sessionKey","endpoint","conversation"],"additionalProperties":false}}}}},"description":"Approve one request and share the current folder with the conversation that asked. Answers with a Langy session key scoped to that conversation, which is never shown again. A request is single use: a second approval is refused.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["langy:create"]},"parameters":[{"in":"path","name":"requestId","schema":{"type":"string","minLength":1},"required":true,"description":"The control request id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"root":{"type":"string","minLength":1,"maxLength":4096},"name":{"type":"string","minLength":1,"maxLength":255},"gitRepository":{"type":"boolean"},"gitBranch":{"type":"string","maxLength":255},"gitRemote":{"type":"string","maxLength":2048},"gitDirty":{"type":"boolean"},"os":{"type":"string","maxLength":64},"nodeVersion":{"type":"string","maxLength":64},"pythonVersion":{"type":"string","maxLength":64},"ghAuthenticated":{"type":"boolean"},"packageManager":{"type":"string","maxLength":32}},"required":["root","name","os"]}},"required":["workspace"]}}}}}},"/api/v1/langy/control/requests/{requestId}/cancel":{"post":{"operationId":"cancelLangyControlRequest","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The request that was cancelled."},"cancelled":{"type":"boolean","const":true,"description":"Always true once the request is gone."}},"required":["id","cancelled"],"additionalProperties":false}}}}},"description":"Refuse one request from the terminal. The card in the chat reads that sharing was cancelled, and Langy's next turn offers the choice again.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["langy:create"]},"parameters":[{"in":"path","name":"requestId","schema":{"type":"string","minLength":1},"required":true,"description":"The control request id."}]}},"/api/v1/langy/control/connect/register":{"post":{"operationId":"registerLangyControlSession","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"frame":{"anyOf":[{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"registered"},"instanceId":{"type":"string"},"heartbeatIntervalMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"conversation":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"required":["id","title","url"],"additionalProperties":false},"policy":{"type":"object","properties":{"skipPermissions":{"type":"boolean"}},"required":["skipPermissions"],"additionalProperties":false}},"required":["protocol","type","instanceId","heartbeatIntervalMs","conversation","policy"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"refused"},"code":{"type":"string","enum":["api_key_invalid","key_type_not_allowed","conversation_mismatch","workspace_already_connected","replica_count_unsupported","protocol_invalid"]},"message":{"type":"string"}},"required":["protocol","type","code","message"],"additionalProperties":false}],"description":"The registered frame, or the refused frame with its reason."},"instanceToken":{"description":"The token the poll and frames endpoints are addressed with, in the X-Agent-Instance-Token header. Present when the register was accepted.","type":"string"}},"required":["frame"],"additionalProperties":false}}}}},"description":"The registered frame with its instance token, or the refused frame with its reason.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"register"},"cli":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"version":{"type":"string","minLength":1,"maxLength":64}},"required":["name","version"]},"instance":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"hostname":{"type":"string","maxLength":255},"username":{"type":"string","maxLength":255},"pid":{"type":"integer","minimum":0,"maximum":9007199254740991},"startedAt":{"type":"string","maxLength":64},"inFlightCallIds":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","maxLength":128}}},"required":["id","hostname","username","pid","startedAt"]},"workspace":{"type":"object","properties":{"root":{"type":"string","minLength":1,"maxLength":4096},"name":{"type":"string","minLength":1,"maxLength":255},"gitRepository":{"type":"boolean"},"gitBranch":{"type":"string","maxLength":255},"gitRemote":{"type":"string","maxLength":2048},"gitDirty":{"type":"boolean"},"os":{"type":"string","maxLength":64},"nodeVersion":{"type":"string","maxLength":64},"pythonVersion":{"type":"string","maxLength":64},"ghAuthenticated":{"type":"boolean"},"packageManager":{"type":"string","maxLength":32}},"required":["root","name","os"]}},"required":["protocol","type","cli","instance","workspace"]}}}}}},"/api/v1/langy/control/connect/poll":{"get":{"operationId":"pollLangyControlSession","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"frames":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"registered"},"instanceId":{"type":"string"},"heartbeatIntervalMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"conversation":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"required":["id","title","url"],"additionalProperties":false},"policy":{"type":"object","properties":{"skipPermissions":{"type":"boolean"}},"required":["skipPermissions"],"additionalProperties":false}},"required":["protocol","type","instanceId","heartbeatIntervalMs","conversation","policy"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"refused"},"code":{"type":"string","enum":["api_key_invalid","key_type_not_allowed","conversation_mismatch","workspace_already_connected","replica_count_unsupported","protocol_invalid"]},"message":{"type":"string"}},"required":["protocol","type","code","message"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"call"},"call":{"oneOf":[{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_read"},"params":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":4096},"offset":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false},{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_write"},"params":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":4096},"content":{"type":"string"}},"required":["path","content"],"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false},{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_edit"},"params":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":4096},"edits":{"minItems":1,"maxItems":200,"type":"array","items":{"anyOf":[{"type":"object","properties":{"oldText":{"type":"string","minLength":1},"newText":{"type":"string"}},"required":["oldText","newText"],"additionalProperties":false},{"type":"object","properties":{"append":{"type":"string","minLength":1}},"required":["append"],"additionalProperties":false}]}}},"required":["path","edits"],"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false},{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_bash"},"params":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":20000},"timeout":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"background":{"type":"boolean"}},"required":["command"],"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false},{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_grep"},"params":{"type":"object","properties":{"pattern":{"type":"string","minLength":1,"maxLength":2000},"path":{"type":"string","maxLength":4096},"glob":{"type":"string","maxLength":500},"ignoreCase":{"type":"boolean"},"literal":{"type":"boolean"},"context":{"type":"integer","minimum":0,"maximum":50},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":5000}},"required":["pattern"],"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false},{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_find"},"params":{"type":"object","properties":{"pattern":{"type":"string","minLength":1,"maxLength":500},"path":{"type":"string","maxLength":4096},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":20000}},"required":["pattern"],"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false},{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_ls"},"params":{"type":"object","properties":{"path":{"type":"string","maxLength":4096},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":20000}},"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false},{"type":"object","properties":{"callId":{"type":"string"},"conversationId":{"type":"string"},"turnId":{"type":"string"},"deadlineAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool":{"type":"string","const":"local_langwatch_env"},"params":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":4096}},"additionalProperties":false}},"required":["callId","conversationId","turnId","deadlineAt","tool","params"],"additionalProperties":false}]}},"required":["protocol","type","call"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"cancel"},"callId":{"type":"string"}},"required":["protocol","type","callId"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"permission"},"callId":{"type":"string"},"decision":{"type":"string","enum":["allow_once","allow_pattern","deny","expired"]}},"required":["protocol","type","callId","decision"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"policy"},"skipPermissions":{"type":"boolean"}},"required":["protocol","type","skipPermissions"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"disconnect"},"reason":{"type":"string","maxLength":500}},"required":["protocol","type","reason"],"additionalProperties":false}]},"description":"The frames waiting for the folder; empty once the poll wait passes with none."}},"required":["frames"],"additionalProperties":false}}}}},"description":"The frames waiting for the folder, or 410 when the instance token is not known.","security":[],"x-access-policy":{"kind":"public","credential":["none"]},"parameters":[{"in":"query","name":"inFlight","schema":{"type":"string"},"description":"Comma-separated call ids this folder still holds."}]}},"/api/v1/langy/control/connect/frames":{"post":{"operationId":"postLangyControlFrames","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many frames were taken."}},"required":["accepted"],"additionalProperties":false}}}}},"description":"How many frames were taken, or 410 when the instance token is not known.","security":[],"x-access-policy":{"kind":"public","credential":["none"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"frames":{"minItems":1,"maxItems":100,"type":"array","items":{"oneOf":[{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"register"},"cli":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"version":{"type":"string","minLength":1,"maxLength":64}},"required":["name","version"]},"instance":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"hostname":{"type":"string","maxLength":255},"username":{"type":"string","maxLength":255},"pid":{"type":"integer","minimum":0,"maximum":9007199254740991},"startedAt":{"type":"string","maxLength":64},"inFlightCallIds":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","maxLength":128}}},"required":["id","hostname","username","pid","startedAt"]},"workspace":{"type":"object","properties":{"root":{"type":"string","minLength":1,"maxLength":4096},"name":{"type":"string","minLength":1,"maxLength":255},"gitRepository":{"type":"boolean"},"gitBranch":{"type":"string","maxLength":255},"gitRemote":{"type":"string","maxLength":2048},"gitDirty":{"type":"boolean"},"os":{"type":"string","maxLength":64},"nodeVersion":{"type":"string","maxLength":64},"pythonVersion":{"type":"string","maxLength":64},"ghAuthenticated":{"type":"boolean"},"packageManager":{"type":"string","maxLength":32}},"required":["root","name","os"]}},"required":["protocol","type","cli","instance","workspace"]},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"ack"},"callId":{"type":"string"}},"required":["protocol","type","callId"]},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"result"},"callId":{"type":"string"},"ok":{"type":"boolean"},"text":{"type":"string"},"output":{"type":"object","properties":{"exitCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stdout":{"type":"string"},"stderr":{"type":"string"},"truncated":{"type":"boolean"},"logPath":{"type":"string"},"pid":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["exitCode","stdout","stderr","truncated","durationMs"]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["path_refused","command_refused","permission_denied","permission_expired","cancelled","timeout","exec_failed","not_found","key_refused"]},"message":{"type":"string","maxLength":4000}},"required":["code","message"]}},"required":["protocol","type","callId","ok"]},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"permission_required"},"callId":{"type":"string"},"summary":{"type":"string","maxLength":4000},"pattern":{"type":"string","maxLength":500},"reason":{"type":"string","maxLength":500},"skipOffered":{"type":"boolean"},"segments":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"command":{"type":"string","maxLength":4000},"pattern":{"type":"string","maxLength":500},"readOnly":{"type":"boolean"}},"required":["command","pattern","readOnly"]}},"timeoutSeconds":{"type":"integer","exclusiveMinimum":0,"maximum":3600}},"required":["protocol","type","callId","summary","pattern","reason","skipOffered"]},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"permission_answered"},"callId":{"type":"string"},"decision":{"type":"string","enum":["allow_once","allow_pattern","deny"]},"patterns":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":500}}},"required":["protocol","type","callId","decision"]},{"type":"object","properties":{"protocol":{"type":"number","const":1},"type":{"type":"string","const":"deregister"}},"required":["protocol","type"]}]},"description":"Ack, result, permission_required and deregister frames, in order."}},"required":["frames"]}}}}}},"/api/v1/model-providers":{"get":{"operationId":"getApiModelProviders","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"enabled":{"type":"boolean"},"customKeys":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"deploymentMapping":{"anyOf":[{},{"type":"null"}]},"models":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"embeddingsModels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customModels":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"mode":{"type":"string","enum":["chat","embedding"]},"maxTokens":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"supportedParameters":{"type":"array","items":{"type":"string","enum":["temperature","max_tokens","top_p","frequency_penalty","presence_penalty","top_k","min_p","repetition_penalty","seed","reasoning","verbosity"]}},"multimodalInputs":{"type":"array","items":{"type":"string","enum":["image","file","audio"]}}},"required":["modelId","displayName","mode"],"additionalProperties":false}},{"type":"null"}]},"customEmbeddingsModels":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"mode":{"type":"string","enum":["chat","embedding"]},"maxTokens":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"supportedParameters":{"type":"array","items":{"type":"string","enum":["temperature","max_tokens","top_p","frequency_penalty","presence_penalty","top_k","min_p","repetition_penalty","seed","reasoning","verbosity"]}},"multimodalInputs":{"type":"array","items":{"type":"string","enum":["image","file","audio"]}}},"required":["modelId","displayName","mode"],"additionalProperties":false}},{"type":"null"}]},"disabledByDefault":{"type":"boolean"},"extraHeaders":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},{"type":"null"}]}},"required":["provider","enabled","customKeys","deploymentMapping"],"additionalProperties":false}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"List all model providers for a project with masked API keys","tags":["Model Providers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]}}},"/api/v1/model-providers/{provider}":{"put":{"operationId":"putApiModelProvidersByProvider","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"enabled":{"type":"boolean"},"customKeys":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"deploymentMapping":{"anyOf":[{},{"type":"null"}]},"models":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"embeddingsModels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customModels":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"mode":{"type":"string","enum":["chat","embedding"]},"maxTokens":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"supportedParameters":{"type":"array","items":{"type":"string","enum":["temperature","max_tokens","top_p","frequency_penalty","presence_penalty","top_k","min_p","repetition_penalty","seed","reasoning","verbosity"]}},"multimodalInputs":{"type":"array","items":{"type":"string","enum":["image","file","audio"]}}},"required":["modelId","displayName","mode"],"additionalProperties":false}},{"type":"null"}]},"customEmbeddingsModels":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"mode":{"type":"string","enum":["chat","embedding"]},"maxTokens":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"supportedParameters":{"type":"array","items":{"type":"string","enum":["temperature","max_tokens","top_p","frequency_penalty","presence_penalty","top_k","min_p","repetition_penalty","seed","reasoning","verbosity"]}},"multimodalInputs":{"type":"array","items":{"type":"string","enum":["image","file","audio"]}}},"required":["modelId","displayName","mode"],"additionalProperties":false}},{"type":"null"}]},"disabledByDefault":{"type":"boolean"},"extraHeaders":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},{"type":"null"}]}},"required":["provider","enabled","customKeys","deploymentMapping"],"additionalProperties":false}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Create or update a model provider","tags":["Model Providers"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:update"]},"parameters":[{"in":"path","name":"provider","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"customKeys":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"customModels":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"mode":{"type":"string","enum":["chat","embedding"]},"maxTokens":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"supportedParameters":{"type":"array","items":{"type":"string","enum":["temperature","max_tokens","top_p","frequency_penalty","presence_penalty","top_k","min_p","repetition_penalty","seed","reasoning","verbosity"]}},"multimodalInputs":{"type":"array","items":{"type":"string","enum":["image","file","audio"]}}},"required":["modelId","displayName","mode"],"additionalProperties":false}},{"type":"array","items":{"type":"string"}}]},"customEmbeddingsModels":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"mode":{"type":"string","enum":["chat","embedding"]},"maxTokens":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"supportedParameters":{"type":"array","items":{"type":"string","enum":["temperature","max_tokens","top_p","frequency_penalty","presence_penalty","top_k","min_p","repetition_penalty","seed","reasoning","verbosity"]}},"multimodalInputs":{"type":"array","items":{"type":"string","enum":["image","file","audio"]}}},"required":["modelId","displayName","mode"],"additionalProperties":false}},{"type":"array","items":{"type":"string"}}]},"extraHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"]}},"defaultModel":{"type":"string"}},"required":["enabled"]}}}}}},"/api/v1/model-defaults":{"get":{"operationId":"getApiModelDefaults","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"object","properties":{"projectId":{"type":"string"},"teamId":{"type":["string","null"]},"organizationId":{"type":["string","null"]},"organizationName":{"type":["string","null"]}},"required":["projectId","teamId","organizationId","organizationName"],"additionalProperties":false},"effective":{"type":"object","properties":{"DEFAULT":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"source":{"type":"string"},"scope":{"type":["string","null"]}},"required":["model","source","scope"],"additionalProperties":false},{"type":"null"}]},"FAST":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"source":{"type":"string"},"scope":{"type":["string","null"]}},"required":["model","source","scope"],"additionalProperties":false},{"type":"null"}]},"EMBEDDINGS":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"source":{"type":"string"},"scope":{"type":["string","null"]}},"required":["model","source","scope"],"additionalProperties":false},{"type":"null"}]}},"required":["DEFAULT","FAST","EMBEDDINGS"],"additionalProperties":false},"configs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","config","scopes","createdAt","updatedAt"],"additionalProperties":false}}},"required":["scope","effective","configs"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Snapshot of the default-model cascade for this project: effective resolution per role, plus the configs the caller can read.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]}},"post":{"operationId":"postApiModelDefaults","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Create a default-model config attached to one or more scopes. JSON keys may be roles (DEFAULT, FAST, LANGY, EMBEDDINGS) or registered feature keys; missing keys inherit from a higher scope.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"minItems":1,"type":"array","items":{"type":"object","properties":{"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["scopeType","scopeId"]}}},"required":["config","scopes"]}}}}}},"/api/v1/model-defaults/{id}":{"put":{"operationId":"putApiModelDefaultsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"204":{"description":"Updated","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Update a config's JSON payload and/or its scope attachments. Sending `scopes: []` deletes the config.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["scopeType","scopeId"]}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiModelDefaultsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"204":{"description":"Deleted","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Delete a default-model config. Scope attachments cascade.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/monitors":{"get":{"operationId":"getApiMonitors","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"checkType":{"type":"string"},"enabled":{"type":"boolean"},"executionMode":{"type":"string","enum":["ON_MESSAGE","AS_GUARDRAIL","MANUALLY"]},"sample":{"type":"number"},"level":{"type":"string"},"evaluatorId":{"type":["string","null"]},"preconditions":{},"parameters":{},"mappings":{"anyOf":[{},{"type":"null"}]},"threadIdleTimeout":{"type":["number","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","checkType","enabled","executionMode","sample","level","evaluatorId","preconditions","parameters","mappings","threadIdleTimeout","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}}},"description":"List all online evaluation monitors for the project","tags":["Monitors"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:view"]}},"post":{"operationId":"postApiMonitors","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"checkType":{"type":"string"},"enabled":{"type":"boolean"},"executionMode":{"type":"string","enum":["ON_MESSAGE","AS_GUARDRAIL","MANUALLY"]},"sample":{"type":"number"},"level":{"type":"string"},"evaluatorId":{"type":["string","null"]},"preconditions":{},"parameters":{},"mappings":{"anyOf":[{},{"type":"null"}]},"threadIdleTimeout":{"type":["number","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","checkType","enabled","executionMode","sample","level","evaluatorId","preconditions","parameters","mappings","threadIdleTimeout","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Create a new online evaluation monitor","tags":["Monitors"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"checkType":{"type":"string","minLength":1},"executionMode":{"default":"ON_MESSAGE","type":"string","enum":["ON_MESSAGE","AS_GUARDRAIL","MANUALLY"]},"preconditions":{"default":[],"type":"array","items":{}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"mappings":{"anyOf":[{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expansions":{"type":"array","items":{"type":"string"}}},"required":["mapping","expansions"]},{"type":"null"}]},"sample":{"default":1,"type":"number","minimum":0,"maximum":1},"evaluatorId":{"type":"string","minLength":1},"level":{"default":"trace","type":"string","enum":["trace","thread"]},"threadIdleTimeout":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["name","checkType"]}}}}}},"/api/v1/monitors/{id}":{"get":{"operationId":"getApiMonitorsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"checkType":{"type":"string"},"enabled":{"type":"boolean"},"executionMode":{"type":"string","enum":["ON_MESSAGE","AS_GUARDRAIL","MANUALLY"]},"sample":{"type":"number"},"level":{"type":"string"},"evaluatorId":{"type":["string","null"]},"preconditions":{},"parameters":{},"mappings":{"anyOf":[{},{"type":"null"}]},"threadIdleTimeout":{"type":["number","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","checkType","enabled","executionMode","sample","level","evaluatorId","preconditions","parameters","mappings","threadIdleTimeout","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Get a monitor by its ID","tags":["Monitors"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The monitor id."}]},"patch":{"operationId":"patchApiMonitorsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"checkType":{"type":"string"},"enabled":{"type":"boolean"},"executionMode":{"type":"string","enum":["ON_MESSAGE","AS_GUARDRAIL","MANUALLY"]},"sample":{"type":"number"},"level":{"type":"string"},"evaluatorId":{"type":["string","null"]},"preconditions":{},"parameters":{},"mappings":{"anyOf":[{},{"type":"null"}]},"threadIdleTimeout":{"type":["number","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","checkType","enabled","executionMode","sample","level","evaluatorId","preconditions","parameters","mappings","threadIdleTimeout","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Update a monitor (name, enabled state, settings, etc.)","tags":["Monitors"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"checkType":{"type":"string"},"executionMode":{"type":"string","enum":["ON_MESSAGE","AS_GUARDRAIL","MANUALLY"]},"preconditions":{"type":"array","items":{}},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"mappings":{"anyOf":[{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expansions":{"type":"array","items":{"type":"string"}}},"required":["mapping","expansions"]},{"type":"null"}]},"sample":{"type":"number","minimum":0,"maximum":1},"evaluatorId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"level":{"type":"string","enum":["trace","thread"]},"threadIdleTimeout":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The monitor id."}]},"delete":{"operationId":"deleteApiMonitorsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Delete a monitor","tags":["Monitors"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The monitor id."}]}},"/api/v1/monitors/{id}/toggle":{"post":{"operationId":"postApiMonitorsByIdToggle","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"}},"required":["id","enabled"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Enable or disable a monitor","tags":["Monitors"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["evaluations:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The monitor id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}}}},"/api/v1/admin/impersonate":{"post":{"operationId":"startAdminImpersonation","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Impersonation started"}},"required":["message"],"additionalProperties":false}}}}},"x-access-policy":{"kind":"handlerManaged","credential":["session"],"permissions":["ops:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIdToImpersonate":{"type":"string","minLength":1},"reason":{"type":"string","minLength":1}},"required":["userIdToImpersonate","reason"]}}}}},"delete":{"operationId":"stopAdminImpersonation","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Impersonation ended"}},"required":["message"],"additionalProperties":false}}}}},"x-access-policy":{"kind":"handlerManaged","credential":["session"],"permissions":["ops:view"]}}},"/api/v1/admin/{resource}":{"post":{"operationId":"runAdminOperation","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["data"],"additionalProperties":false}}}}},"x-access-policy":{"kind":"handlerManaged","credential":["session"],"permissions":["ops:view"]},"parameters":[{"in":"path","name":"resource","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["getList","getOne","getMany","getManyReference","create","update","updateMany","delete","deleteMany"]},"params":{"default":{},"type":"object","properties":{"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":200}}},"sort":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":100},"order":{"type":"string","enum":["ASC","DESC"]}}},"filter":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"id":{"type":["string","number"]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previousData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":{}}},"required":["method"]}}}}}},"/api/v1/bug-reports":{"post":{"operationId":"submitBugReport","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"description":"released CLI and MCP builds parse the intake's own bodies: { id } on 201, { error, details } on a rejected report, { error, code } on a named refusal","summary":"File an issue report from a coding agent","security":[{},{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["cli","mcp"]},"kind":{"type":"string","enum":["summary","full_session"]},"title":{"type":"string","minLength":1,"maxLength":300},"summary":{"type":"string","maxLength":200000},"sessionData":{"type":"string","maxLength":9000000},"sessionTruncated":{"type":"boolean"},"agent":{"type":"string","maxLength":100},"contactEmail":{"type":"string","maxLength":320},"cliVersion":{"type":"string","maxLength":50},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}}},"required":["source","kind","title"]}}}}}},"/api/v1/ops/clickhouse/explain":{"post":{"operationId":"explainClickHouseQuery","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"description":"the operator tool reads a status and a message: 401, 400, 502 and 503 and the EXPLAIN rows all keep the exact bodies the agent already parses","summary":"Explain a ClickHouse query as the read-only operator account","security":[{"internal_secret":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["internal_secret"],"permissions":[]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":50000},"type":{"type":"string","enum":["PLAN","SYNTAX","PIPELINE","AST","INDEXES"]}},"required":["query"]}}}}}},"/api/v1/checkup":{"get":{"operationId":"getApiCheckup","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ranAt":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["app","postgres","postgres_migrations","clickhouse","clickhouse_migrations","lwql","redis","gateway","license","connect","usage_report","reach_connect_host","reach_gateway_host","gateway_control_plane","storage","email","model_providers","storage_probe","smtp_verify","model_provider_test","canary_collector","canary_processor","canary_evaluations","canary_scenarios","canary_langy"]},"name":{"type":"string"},"group":{"type":"string","enum":["install","langwatch","integrations","pipelines"]},"cost":{"type":"string","enum":["free","egress","paid"]},"verdict":{"oneOf":[{"type":"object","properties":{"outcome":{"type":"string","const":"verified"},"detail":{"type":"string"}},"required":["outcome"],"additionalProperties":false},{"type":"object","properties":{"outcome":{"type":"string","const":"refused"},"code":{"type":"string"},"detail":{"type":"string"},"fix":{"type":"string"},"docsPath":{"type":"string"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["outcome"],"additionalProperties":false},{"type":"object","properties":{"outcome":{"type":"string","const":"unchecked"},"detail":{"type":"string"},"fix":{"type":"string"},"docsPath":{"type":"string"}},"required":["outcome"],"additionalProperties":false}]}},"required":["id","name","group","cost","verdict"],"additionalProperties":false}},"usageReport":{"type":"object","properties":{"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"switches":{"type":"object","properties":{"optional":{"type":"boolean"},"hostname":{"type":"boolean"}},"required":["optional","hostname"],"additionalProperties":false},"endpoint":{"type":"string"},"disabled":{"type":"boolean"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextReportAt":{"type":["string","null"]}},"required":["payload","schemaVersion"],"additionalProperties":false}},"required":["ranAt","rows","usageReport"],"additionalProperties":false}}}}},"description":"The checkup `langwatch doctor` and the Settings > Checkup page show: one row per check with a pass, fail or not checked verdict. A project API key reads the verdicts only; what each check found and how to fix it is shown to install administrators on the Settings > Checkup page. Checks that open a connection or spend money are reported as not checked here and run through `POST /api/checkup/run`. The response also carries the usage figures of the key's own organization. Answers 404 on LangWatch Cloud.","summary":"Run the free checks of a self-hosted install","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["organization:view"]}}},"/api/v1/checkup/run":{"post":{"operationId":"postApiCheckupRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ranAt":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["app","postgres","postgres_migrations","clickhouse","clickhouse_migrations","lwql","redis","gateway","license","connect","usage_report","reach_connect_host","reach_gateway_host","gateway_control_plane","storage","email","model_providers","storage_probe","smtp_verify","model_provider_test","canary_collector","canary_processor","canary_evaluations","canary_scenarios","canary_langy"]},"name":{"type":"string"},"group":{"type":"string","enum":["install","langwatch","integrations","pipelines"]},"cost":{"type":"string","enum":["free","egress","paid"]},"verdict":{"oneOf":[{"type":"object","properties":{"outcome":{"type":"string","const":"verified"},"detail":{"type":"string"}},"required":["outcome"],"additionalProperties":false},{"type":"object","properties":{"outcome":{"type":"string","const":"refused"},"code":{"type":"string"},"detail":{"type":"string"},"fix":{"type":"string"},"docsPath":{"type":"string"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["outcome"],"additionalProperties":false},{"type":"object","properties":{"outcome":{"type":"string","const":"unchecked"},"detail":{"type":"string"},"fix":{"type":"string"},"docsPath":{"type":"string"}},"required":["outcome"],"additionalProperties":false}]}},"required":["id","name","group","cost","verdict"],"additionalProperties":false}}},"required":["ranAt","rows"],"additionalProperties":false}}}}},"description":"Runs the egress and paid checks of a self-hosted install: reaching the connect and gateway hosts, the storage write, the SMTP connection, one model provider call and the pipeline canaries. Name the checks to run, or leave the list out to run them all. A project API key reads the verdicts only. The scenario canary launches a real run and needs a run plan id. Answers 404 on LangWatch Cloud.","summary":"Run the checks that open a connection or spend money","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"checks":{"type":"array","items":{"type":"string","enum":["app","postgres","postgres_migrations","clickhouse","clickhouse_migrations","lwql","redis","gateway","license","connect","usage_report","reach_connect_host","reach_gateway_host","gateway_control_plane","storage","email","model_providers","storage_probe","smtp_verify","model_provider_test","canary_collector","canary_processor","canary_evaluations","canary_scenarios","canary_langy"]}},"scenarioRunPlanId":{"type":"string","minLength":1,"maxLength":200}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["organization:manage"]}}},"/api/v1/organization":{"get":{"operationId":"getOrganization","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"supportContact":{"type":["string","null"]},"presenceEnabled":{"type":"boolean"},"traceSharingEnabled":{"type":"boolean"},"primaryIntent":{"anyOf":[{"type":"string","enum":["AGENT_GOVERNANCE","LLM_OPS"]},{"type":"null"}]},"s3Endpoint":{"type":["string","null"]},"s3AccessKeyId":{"type":["string","null"]},"s3Bucket":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","supportContact","presenceEnabled","traceSharingEnabled","primaryIntent","s3Endpoint","s3AccessKeyId","s3Bucket","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Read the organization profile: name, slug, support contact, presence and trace sharing settings, and the S3 storage shape. The single sign-on fields and the S3 secret are never returned.","tags":["Organization"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:view"]}},"patch":{"operationId":"updateOrganization","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"supportContact":{"type":["string","null"]},"presenceEnabled":{"type":"boolean"},"traceSharingEnabled":{"type":"boolean"},"primaryIntent":{"anyOf":[{"type":"string","enum":["AGENT_GOVERNANCE","LLM_OPS"]},{"type":"null"}]},"s3Endpoint":{"type":["string","null"]},"s3AccessKeyId":{"type":["string","null"]},"s3Bucket":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","supportContact","presenceEnabled","traceSharingEnabled","primaryIntent","s3Endpoint","s3AccessKeyId","s3Bucket","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Update the organization profile. Partial: only the fields present are written, and the response is exactly what a subsequent GET returns.","tags":["Organization"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"supportContact":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"presenceEnabled":{"type":"boolean"},"traceSharingEnabled":{"type":"boolean"},"primaryIntent":{"anyOf":[{"type":"string","enum":["AGENT_GOVERNANCE","LLM_OPS"]},{"type":"null"}]},"s3Endpoint":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"s3AccessKeyId":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"s3SecretAccessKey":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"s3Bucket":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]}}}}}},"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]}}},"/api/v1/organization/members":{"get":{"operationId":"listOrganizationMembers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"role":{"type":"string","enum":["ADMIN","MEMBER","EXTERNAL","DEVELOPER"]},"disabled":{"type":"boolean"},"disabledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","email"],"additionalProperties":false}},"required":["userId","role","disabled","disabledAt","createdAt","updatedAt","user"],"additionalProperties":false}},"totalCount":{"type":"number"}},"required":["members","totalCount"],"additionalProperties":false}}}}},"description":"List the organization's members with their organization role and disabled status. Disabled members are included only when includeDisabled=true.","tags":["Members"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:view"]},"parameters":[{"in":"query","name":"includeDisabled","schema":{"type":"string","enum":["true","false"]}},{"in":"query","name":"offset","schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":200}}]}},"/api/v1/organization/members/{userId}":{"get":{"operationId":"getOrganizationMember","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"role":{"type":"string","enum":["ADMIN","MEMBER","EXTERNAL","DEVELOPER"]},"disabled":{"type":"boolean"},"disabledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","email"],"additionalProperties":false},"teams":{"type":"array","items":{"type":"object","properties":{"teamId":{"type":"string"},"teamName":{"type":"string"},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":["string","null"]},"customRoleName":{"type":["string","null"]}},"required":["teamId","teamName","role","customRoleId","customRoleName"],"additionalProperties":false}}},"required":["userId","role","disabled","disabledAt","createdAt","updatedAt","user","teams"],"additionalProperties":false}}}}},"description":"Read one member, including the teams they reach through team-scoped role bindings. Personal workspaces are not listed: they are not access an administrator manages.","tags":["Members"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:view"]},"parameters":[{"in":"path","name":"userId","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"updateOrganizationMember","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"role":{"type":"string","enum":["ADMIN","MEMBER","EXTERNAL","DEVELOPER"]},"disabled":{"type":"boolean"},"disabledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","email"],"additionalProperties":false},"teamsLeftWithoutAdmin":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["userId","role","disabled","disabledAt","createdAt","updatedAt","user"],"additionalProperties":false}}}}},"description":"Change a member's organization role, or disable / re-enable their membership. Send exactly one of role or disabled. Re-enabling consumes a seat, so it is checked against the plan.","tags":["Members"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"userId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","EXTERNAL","DEVELOPER"]},"disabled":{"type":"boolean"}}}}}}},"delete":{"operationId":"removeOrganizationMember","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}}},"description":"Remove a member from the organization and every team in it. The member the credential acts as cannot remove themselves.","tags":["Members"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"userId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/organization/members/{userId}/access":{"get":{"operationId":"getOrganizationMemberAccess","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"orgRole":{"type":"string"},"orgRolePermissions":{"type":"array","items":{"type":"string"}}},"required":["id","name","email","orgRole","orgRolePermissions"],"additionalProperties":false},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"scimSource":{"type":["string","null"]},"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["PROJECT","TEAM","ORGANIZATION"]},"scopeId":{"type":"string"},"scopeName":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"cappedBySeat":{"type":"boolean"}},"required":["id","role","customRoleName","scopeType","scopeId","scopeName","permissions","cappedBySeat"],"additionalProperties":false}}},"required":["id","name","slug","scimSource","bindings"],"additionalProperties":false}},"directBindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["PROJECT","TEAM","ORGANIZATION"]},"scopeId":{"type":"string"},"scopeName":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"cappedBySeat":{"type":"boolean"}},"required":["id","role","customRoleName","scopeType","scopeId","scopeName","permissions","cappedBySeat"],"additionalProperties":false}}},"required":["user","groups","directBindings"],"additionalProperties":false}}}}},"description":"The member's full access breakdown: organization role, group memberships with their bindings, and direct bindings, each with the permissions it grants and the scope it grants them on.","tags":["Members"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"userId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/organization/invites":{"get":{"operationId":"listOrganizationInvites","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"invites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["ADMIN","MEMBER","EXTERNAL","DEVELOPER"]},"status":{"type":"string"},"expiration":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"inviteCode":{"type":"string"},"inviteUrl":{"type":"string"},"teams":{"type":"array","items":{"type":"object","properties":{"teamId":{"type":"string"},"role":{"type":"string"},"customRoleId":{"type":["string","null"]}},"required":["teamId","role","customRoleId"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","role","status","expiration","inviteCode","inviteUrl","teams","createdAt"],"additionalProperties":false}}},"required":["invites"],"additionalProperties":false}}}}},"description":"List pending invites. Each carries its invite code and acceptance link, because a provisioning run with no email provider still has to hand the person something to open.","tags":["Invites"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]}},"post":{"operationId":"createOrganizationInvites","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"invites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["ADMIN","MEMBER","EXTERNAL","DEVELOPER"]},"status":{"type":"string"},"expiration":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"inviteCode":{"type":"string"},"inviteUrl":{"type":"string"},"teams":{"type":"array","items":{"type":"object","properties":{"teamId":{"type":"string"},"role":{"type":"string"},"customRoleId":{"type":["string","null"]}},"required":["teamId","role","customRoleId"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"emailNotSent":{"type":"boolean"}},"required":["id","email","role","status","expiration","inviteCode","inviteUrl","teams","createdAt","emailNotSent"],"additionalProperties":false}}},"required":["invites"],"additionalProperties":false}}}}},"description":"Create up to 50 invites in one batch, each with team assignments that may carry a custom role. Validation is strict: a team or custom role that cannot be assigned refuses the batch rather than silently granting less than was asked. emailNotSent reports, per invite, whether the invite email could be delivered.","tags":["Invites"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invites":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","minLength":1,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["ADMIN","MEMBER","EXTERNAL","DEVELOPER"]},"teams":{"type":"array","items":{"type":"object","properties":{"teamId":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":"string","minLength":1}},"required":["teamId","role"]}}},"required":["email","role"]}}},"required":["invites"]}}}}}},"/api/v1/organization/invites/{inviteId}":{"delete":{"operationId":"revokeOrganizationInvite","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}}},"description":"Revoke a pending invite. An invite id from another organization, or one already revoked, answers 404.","tags":["Invites"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"inviteId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/organizations/{organizationId}":{"get":{"operationId":"getOrganizationById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","createdAt"],"additionalProperties":false}},"required":["organization"],"additionalProperties":false}}}}},"description":"Read one organization's provisioning summary, self-hosted instance administrators only.","tags":["Organizations (Self-Hosted)"],"security":[{"instance_admin_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["instance_admin_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/groups":{"get":{"operationId":"getApiGroups","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"externalId":{"type":["string","null"]},"scimSource":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"memberCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":["string","null"]},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["id","role","customRoleId","customRoleName","scopeType","scopeId"],"additionalProperties":false}}},"required":["id","name","slug","externalId","scimSource","createdAt","memberCount","bindings"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["page","limit","total"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}}},"description":"List all groups for the organization","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":1000}}]},"post":{"operationId":"postApiGroups","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","name","slug","createdAt"],"additionalProperties":false}}}}},"description":"Create a new group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"bindings":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":"string","minLength":1},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"],"additionalProperties":false}},"memberIds":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}}}},"/api/v1/groups/{groupId}":{"get":{"operationId":"getApiGroupsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"externalId":{"type":["string","null"]},"scimSource":{"type":["string","null"]},"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["userId","name","email"],"additionalProperties":false}},"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":["string","null"]},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["id","role","customRoleId","customRoleName","scopeType","scopeId"],"additionalProperties":false}}},"required":["id","name","slug","externalId","scimSource","members","bindings"],"additionalProperties":false}}}}},"description":"Get a group with members and bindings","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiGroupsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1}},"required":["id","name","slug"],"additionalProperties":false}}}}},"description":"Rename a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}}},"delete":{"operationId":"deleteApiGroupsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"description":"Delete a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/groups/{groupId}/members":{"get":{"operationId":"getApiGroupsByIdMembers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["userId","name","email"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}},"description":"List members of a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true}]},"post":{"operationId":"postApiGroupsByIdMembers","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"description":"Add a member to a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1}},"required":["userId"]}}}}}},"/api/v1/groups/{groupId}/members/{userId}":{"delete":{"operationId":"deleteApiGroupsByIdMembersByUserId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"description":"Remove a member from a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"userId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/groups/{groupId}/bindings":{"get":{"operationId":"getApiGroupsByIdBindings","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":["string","null"]},"customRoleName":{"type":["string","null"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["id","role","customRoleId","customRoleName","scopeType","scopeId"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}},"description":"List role bindings for a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true}]},"post":{"operationId":"postApiGroupsByIdBindings","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["id","role","scopeType","scopeId"],"additionalProperties":false}}}}},"description":"Add a role binding to a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]},"customRoleId":{"type":"string","minLength":1},"scopeType":{"type":"string","enum":["ORGANIZATION","TEAM","PROJECT"]},"scopeId":{"type":"string","minLength":1}},"required":["role","scopeType","scopeId"],"additionalProperties":false}}}}}},"/api/v1/groups/{groupId}/bindings/{bindingId}":{"delete":{"operationId":"deleteApiGroupsByIdBindingsByBindingId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"description":"Remove a role binding from a group","tags":["Groups"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"groupId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"bindingId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/teams":{"get":{"operationId":"getApiTeams","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","organizationId","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["page","limit","total"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}}},"description":"List all non-archived teams for the organization (paginated)","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:view"]},"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":1000}}]},"post":{"operationId":"postApiTeams","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","organizationId","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Create a new team that can group projects and members","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"]}}}}}},"/api/v1/teams/{teamId}":{"get":{"operationId":"getApiTeamsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","organizationId","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Get a team by its id","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:view"]},"parameters":[{"in":"path","name":"teamId","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiTeamsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","organizationId","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Update a team by its id","tags":["Teams"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}}}}}},"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:manage"]},"parameters":[{"in":"path","name":"teamId","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiTeamsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","archivedAt"],"additionalProperties":false}}}}},"description":"Archive a team (soft-delete)","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:manage"]},"parameters":[{"in":"path","name":"teamId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/teams/{teamId}/members":{"get":{"operationId":"getApiTeamsByIdMembers","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"role":{"type":"string","enum":["ADMIN","MEMBER","VIEWER","CUSTOM"]}},"required":["userId","name","email","role"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}},"description":"List members of a team","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:view"]},"parameters":[{"in":"path","name":"teamId","schema":{"type":"string","minLength":1},"required":true}]},"post":{"operationId":"postApiTeamsByIdMembers","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"description":"Add a member to a team","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:manage"]},"parameters":[{"in":"path","name":"teamId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"role":{"default":"MEMBER","type":"string","enum":["ADMIN","MEMBER","VIEWER"]}},"required":["userId"]}}}}}},"/api/v1/teams/{teamId}/members/{userId}":{"delete":{"operationId":"deleteApiTeamsByIdMembersByUserId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}}},"description":"Remove a member from a team","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:manage"]},"parameters":[{"in":"path","name":"teamId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"userId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/teams/{teamId}/projects":{"get":{"operationId":"getApiTeamsByIdProjects","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","createdAt","updatedAt"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}},"description":"List projects in a team","tags":["Teams"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["team:view"]},"parameters":[{"in":"path","name":"teamId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/platform-health":{"get":{"operationId":"getPlatformHealth","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","unhealthy"]},"checkedAt":{"type":"string"},"checks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["collector","evaluations","processor","triggers","workflows"]},"status":{"type":"string","enum":["healthy","unhealthy","not_configured"]},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"detail":{"type":"string"}},"required":["name","status","durationMs"],"additionalProperties":false}}},"required":["status","checkedAt","checks"],"additionalProperties":false}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","unhealthy"]},"checkedAt":{"type":"string"},"checks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["collector","evaluations","processor","triggers","workflows"]},"status":{"type":"string","enum":["healthy","unhealthy","not_configured"]},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"detail":{"type":"string"}},"required":["name","status","durationMs"],"additionalProperties":false}}},"required":["status","checkedAt","checks"],"additionalProperties":false}}}}},"description":"An external monitor reads a status and a report: 200 healthy or degraded, 503 unhealthy, 401 unauthorized and 404 for a subsystem this platform does not have.","summary":"Report whether the platform is working","security":[{"internal_secret":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["internal_secret"],"permissions":[]},"parameters":[{"in":"query","name":"triggerId","schema":{"type":"string"}},{"in":"query","name":"workflowId","schema":{"type":"string"}}]}},"/api/v1/platform-health/{check}":{"get":{"operationId":"getPlatformHealthSubsystem","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","unhealthy"]},"checkedAt":{"type":"string"},"checks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["collector","evaluations","processor","triggers","workflows"]},"status":{"type":"string","enum":["healthy","unhealthy","not_configured"]},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"detail":{"type":"string"}},"required":["name","status","durationMs"],"additionalProperties":false}}},"required":["status","checkedAt","checks"],"additionalProperties":false}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","unhealthy"]},"checkedAt":{"type":"string"},"checks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["collector","evaluations","processor","triggers","workflows"]},"status":{"type":"string","enum":["healthy","unhealthy","not_configured"]},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"detail":{"type":"string"}},"required":["name","status","durationMs"],"additionalProperties":false}}},"required":["status","checkedAt","checks"],"additionalProperties":false}}}}},"description":"An external monitor reads a status and a report: 200 healthy or degraded, 503 unhealthy, 401 unauthorized and 404 for a subsystem this platform does not have.","summary":"Report whether one subsystem is working","security":[{"internal_secret":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["internal_secret"],"permissions":[]},"parameters":[{"in":"path","name":"check","schema":{"type":"string"},"required":true},{"in":"query","name":"triggerId","schema":{"type":"string"}},{"in":"query","name":"workflowId","schema":{"type":"string"}}]}},"/api/v1/projects/{id}":{"get":{"operationId":"getProject","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"language":{"type":"string"},"framework":{"type":"string"},"teamId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"piiRedactionLevel":{"type":"string","enum":["STRICT","ESSENTIAL","DISABLED"]}},"required":["id","name","slug","language","framework","teamId","createdAt","updatedAt","piiRedactionLevel"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions for this operation","content":{}},"404":{"description":"Project not found","content":{}}},"description":"Get a project by ID. Requires project:view permission.","summary":"Get a project","security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["project:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"updateProject","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"slug":{"type":"string"},"language":{"type":"string"},"framework":{"type":"string"},"teamId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"piiRedactionLevel":{"type":"string","enum":["STRICT","ESSENTIAL","DISABLED"]}},"required":["id","name","slug","language","framework","teamId","createdAt","updatedAt","piiRedactionLevel"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions (requires project:update)","content":{}},"404":{"description":"Project not found","content":{}}},"description":"Update project fields. Only provided fields are changed. Requires project:update permission.","summary":"Update a project","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"language":{"type":"string"},"framework":{"type":"string"},"teamId":{"description":"Moves the project to this team","type":"string","minLength":1},"piiRedactionLevel":{"description":"The PII level the project's traces are redacted at","type":"string","enum":["STRICT","ESSENTIAL","DISABLED"]}}}}}},"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["project:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"archiveProject","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"archivedAt":{"type":"string","format":"date-time"}},"required":["id","name","archivedAt"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"Insufficient permissions (requires project:delete)","content":{}},"404":{"description":"Project not found","content":{}}},"description":"Soft-delete (archive) a project. Archived projects are excluded from list responses. Requires project:delete permission.","summary":"Archive a project","security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["project:delete"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/projects/{id}/api-key":{"get":{"operationId":"getProjectApiKey","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","minLength":1}},"required":["apiKey"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"A signed-in project administrator is required; API-key principals cannot reveal base keys","content":{}}},"description":"Deprecated. Project base keys can be revealed only by a signed-in project administrator in the browser or an approved device flow. Organization API keys are always refused with 403.","summary":"Get the project API key","security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/projects/{id}/regenerate-api-key":{"post":{"operationId":"regenerateProjectApiKey","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","minLength":1}},"required":["apiKey"],"additionalProperties":false}}}},"401":{"description":"Invalid or missing API key token","content":{}},"403":{"description":"A signed-in project administrator is required; API-key principals cannot rotate base keys","content":{}}},"description":"Deprecated. Project base keys can be rotated only by a signed-in project administrator in the browser. Organization API keys are always refused with 403.","summary":"Regenerate the project API key","security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/prompts":{"get":{"operationId":"getApiPrompts","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":["string","null"]},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"versionId":{"type":"string"},"authorId":{"type":["string","null"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"commitMessage":{"type":["string","null"]},"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"promptingTechnique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"responseFormat":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false},"tags":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versionId":{"type":"string"}},"required":["name","versionId"],"additionalProperties":false}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"platformUrl":{"type":"string"}},"required":["id","handle","scope","name","updatedAt","projectId","organizationId","versionId","version","createdAt","prompt","messages","inputs","outputs","model","tags","parameters","platformUrl"],"additionalProperties":false}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Get all prompts for a project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:view"]}},"post":{"operationId":"postApiPrompts","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":["string","null"]},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"versionId":{"type":"string"},"authorId":{"type":["string","null"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"commitMessage":{"type":["string","null"]},"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"promptingTechnique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"responseFormat":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false},"tags":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versionId":{"type":"string"}},"required":["name","versionId"],"additionalProperties":false}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"platformUrl":{"type":"string"}},"required":["id","handle","scope","name","updatedAt","projectId","organizationId","versionId","version","createdAt","prompt","messages","inputs","outputs","model","tags","parameters","platformUrl"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Create a new prompt with default initial version","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"handle":{"type":"string","pattern":"^[a-z0-9_-]+(?:\\/[a-z0-9_-]+)?$"},"scope":{"default":"PROJECT","type":"string","enum":["PROJECT","ORGANIZATION"]},"model":{"type":"string"},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"commitMessage":{"type":"string"},"authorId":{"type":"string"},"prompt":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"]}},"inputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"]}},"schemaVersion":{"type":"string","enum":["1.0"]},"tags":{"type":"array","items":{"type":"string","minLength":1}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}}},"required":["handle"],"additionalProperties":false,"examples":[{"handle":"support/tone-check","prompt":"You are a helpful assistant. Answer in one short paragraph."}]}}}}}},"/api/v1/prompts/{id}/tags/{tag}":{"put":{"operationId":"putApiPromptsByIdTagsByTag","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"configId":{"type":"string"},"versionId":{"type":"string"},"tag":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["configId","versionId","tag","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Prompt not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid tag or version","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Assign a tag (e.g. \"production\", \"staging\") to a specific prompt version","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"tag","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"versionId":{"type":"string"}},"required":["versionId"]}}}}}},"/api/v1/prompts/tags":{"get":{"operationId":"getApiPromptsTags","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","createdAt"],"additionalProperties":false}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"List all prompt tag definitions for the organization","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:view"]}},"post":{"operationId":"postApiPromptsTags","responses":{"201":{"description":"Tag created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","createdAt"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Create a custom prompt tag definition for the organization","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}}}},"/api/v1/prompts/tags/{tag}":{"put":{"operationId":"putApiPromptsTagsByTag","responses":{"200":{"description":"Tag renamed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","createdAt"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Rename a prompt tag definition","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:manage"]},"parameters":[{"in":"path","name":"tag","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}}},"delete":{"operationId":"deleteApiPromptsTagsByTag","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"204":{"description":"Tag deleted","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Delete a prompt tag definition and cascade to assignments","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:manage"]},"parameters":[{"in":"path","name":"tag","schema":{"type":"string"},"required":true}]}},"/api/v1/prompts/{id}/versions":{"get":{"operationId":"getApiPromptsByIdVersions","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":["string","null"]},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"versionId":{"type":"string"},"authorId":{"type":["string","null"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"commitMessage":{"type":["string","null"]},"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"promptingTechnique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"responseFormat":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false},"tags":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versionId":{"type":"string"}},"required":["name","versionId"],"additionalProperties":false}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"platformUrl":{"type":"string"}},"required":["id","handle","scope","name","updatedAt","projectId","organizationId","versionId","version","createdAt","prompt","messages","inputs","outputs","model","tags","parameters","platformUrl"],"additionalProperties":false}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Prompt not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Get all versions for a prompt. Does not include base prompt data, only versioned data.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}]}},"/api/v1/prompts/{id}/versions/{versionId}/restore":{"post":{"operationId":"postApiPromptsByIdVersionsByVersionIdRestore","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":["string","null"]},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"versionId":{"type":"string"},"authorId":{"type":["string","null"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"commitMessage":{"type":["string","null"]},"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"promptingTechnique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"responseFormat":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false},"tags":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versionId":{"type":"string"}},"required":["name","versionId"],"additionalProperties":false}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"platformUrl":{"type":"string"}},"required":["id","handle","scope","name","updatedAt","projectId","organizationId","versionId","version","createdAt","prompt","messages","inputs","outputs","model","tags","parameters","platformUrl"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Prompt or version not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Restore a prompt to a previous version. Creates a new version with the same config data as the specified version.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"versionId","schema":{"type":"string"},"required":true}]}},"/api/v1/prompts/{id}":{"get":{"operationId":"getApiPromptsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":["string","null"]},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"versionId":{"type":"string"},"authorId":{"type":["string","null"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"commitMessage":{"type":["string","null"]},"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"promptingTechnique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"responseFormat":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false},"tags":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versionId":{"type":"string"}},"required":["name","versionId"],"additionalProperties":false}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"platformUrl":{"type":"string"}},"required":["id","handle","scope","name","updatedAt","projectId","organizationId","versionId","version","createdAt","prompt","messages","inputs","outputs","model","tags","parameters","platformUrl"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Prompt not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Get a specific prompt by slug, with optional shorthand syntax for tags and versions. Pass a bare slug like \"pizza-prompt\" to get the latest version, \"pizza-prompt:production\" to resolve a tagged version, or \"pizza-prompt:2\" to fetch version 2. Alternatively, use the tag or version query parameters with a bare slug.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"version","schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"in":"query","name":"tag","schema":{"type":"string"}}]},"put":{"operationId":"putApiPromptsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":["string","null"]},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"versionId":{"type":"string"},"authorId":{"type":["string","null"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"commitMessage":{"type":["string","null"]},"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"promptingTechnique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"responseFormat":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false},"tags":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versionId":{"type":"string"}},"required":["name","versionId"],"additionalProperties":false}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"platformUrl":{"type":"string"}},"required":["id","handle","scope","name","updatedAt","projectId","organizationId","versionId","version","createdAt","prompt","messages","inputs","outputs","model","tags","parameters","platformUrl"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Prompt not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"]}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Update a prompt","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"commitMessage":{"type":"string"},"authorId":{"type":"string"},"prompt":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"]}},"inputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"]}},"schemaVersion":{"type":"string","enum":["1.0"]},"tags":{"type":"array","items":{"type":"string","minLength":1}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"handle":{"type":"string","pattern":"^[a-z0-9_-]+(?:\\/[a-z0-9_-]+)?$"}},"required":["commitMessage"],"additionalProperties":false}}}}},"delete":{"operationId":"deleteApiPromptsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Prompt not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Delete a prompt","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}]}},"/api/v1/prompts/{id}/sync":{"post":{"operationId":"postApiPromptsByIdSync","responses":{"200":{"description":"Sync result","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["created","updated","conflict","up_to_date"]},"prompt":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":["string","null"]},"scope":{"type":"string","enum":["PROJECT","ORGANIZATION"]},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"versionId":{"type":"string"},"authorId":{"type":["string","null"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"commitMessage":{"type":["string","null"]},"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"maxTokens":{"type":"number"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"promptingTechnique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"responseFormat":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false},"tags":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versionId":{"type":"string"}},"required":["name","versionId"],"additionalProperties":false}},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}}},"required":["id","handle","scope","name","updatedAt","projectId","organizationId","versionId","version","createdAt","prompt","messages","inputs","outputs","model","tags","parameters"],"additionalProperties":false},"conflictInfo":{"type":"object","properties":{"localVersion":{"type":"number"},"remoteVersion":{"type":"number"},"differences":{"type":"array","items":{"type":"string"}},"remoteConfigData":{"type":"object","properties":{"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"],"additionalProperties":false}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"],"additionalProperties":false}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"max_tokens":{"type":"number"},"top_p":{"type":"number"},"frequency_penalty":{"type":"number"},"presence_penalty":{"type":"number"},"seed":{"type":"number"},"top_k":{"type":"number"},"min_p":{"type":"number"},"repetition_penalty":{"type":"number"},"reasoning":{"type":"string"},"reasoning_effort":{"type":"string"},"thinkingLevel":{"type":"string"},"effort":{"type":"string"},"verbosity":{"type":"string"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false},"prompting_technique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"],"additionalProperties":false}}},"required":["records","columnTypes"],"additionalProperties":false}},"additionalProperties":false}},"required":["type"],"additionalProperties":false},"response_format":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"],"additionalProperties":false},{"type":"null"}]}},"required":["type","json_schema"],"additionalProperties":false}},"required":["prompt","messages","inputs","outputs","model"],"additionalProperties":false},"remoteParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["localVersion","remoteVersion","differences","remoteConfigData"],"additionalProperties":false}},"required":["action"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Sync/upsert a prompt with local content","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["prompts:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"configData":{"type":"object","properties":{"prompt":{"type":"string"},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"]}},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","image","file","list","list[str]","list[float]","list[int]","list[bool]","dict","chat_messages"]}},"required":["identifier","type"]}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"type":{"type":"string","enum":["str","float","bool","json_schema"]},"json_schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":{}}},"required":["identifier","type"]}},"model":{"type":"string","minLength":1},"temperature":{"type":"number"},"max_tokens":{"type":"number"},"top_p":{"type":"number"},"frequency_penalty":{"type":"number"},"presence_penalty":{"type":"number"},"seed":{"type":"number"},"top_k":{"type":"number"},"min_p":{"type":"number"},"repetition_penalty":{"type":"number"},"reasoning":{"type":"string"},"reasoning_effort":{"type":"string"},"thinkingLevel":{"type":"string"},"effort":{"type":"string"},"verbosity":{"type":"string"},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"]}}},"required":["records","columnTypes"]}}},"prompting_technique":{"type":"object","properties":{"type":{"type":"string","enum":["few_shot","in_context","chain_of_thought"]},"demonstrations":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"inline":{"type":"object","properties":{"records":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{}}},"columnTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","boolean","number","date","list","json","spans","rag_contexts","chat_messages","annotations","evaluations","image","file"]}},"required":["name","type"]}}},"required":["records","columnTypes"]}}}},"required":["type"]},"response_format":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","properties":{},"additionalProperties":{}}},"required":["name","schema"]},{"type":"null"}]}},"required":["type","json_schema"]}},"required":["prompt","outputs","model"]},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"localVersion":{"type":"number","minimum":0},"commitMessage":{"type":"string"}},"required":["configData"]}}}}}},"/api/v1/roles":{"get":{"operationId":"listRoles","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"builtIn":{"type":"boolean"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","description","permissions","builtIn","createdAt","updatedAt"],"additionalProperties":false}}},"required":["roles"],"additionalProperties":false}}}}},"description":"List the organization's custom roles with their permission sets. Omitted `builtIn`: custom roles only. `?builtIn=true` lists only the built-in roles `admin`, `member` and `viewer`, `?builtIn=false` only the custom ones.","tags":["Roles"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"query","name":"builtIn","schema":{"type":"string","enum":["true","false"]}}]},"post":{"operationId":"createRole","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"builtIn":{"type":"boolean"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","description","permissions","builtIn","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Create a custom role from resource:action permission keys. The name is unique within the organization; a taken name answers 409 custom_role_name_taken.","tags":["Roles"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"permissions":{"minItems":1,"type":"array","items":{"type":"string"}}},"required":["name","permissions"]}}}}}},"/api/v1/roles/permissions":{"get":{"operationId":"listRolePermissions","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"resources":{"type":"array","items":{"type":"object","properties":{"resource":{"type":"string"},"organizationExclusive":{"type":"boolean"},"actions":{"type":"array","items":{"type":"string"}},"permissions":{"type":"array","items":{"type":"string"}}},"required":["resource","organizationExclusive","actions","permissions"],"additionalProperties":false}},"actions":{"type":"array","items":{"type":"string"}}},"required":["resources","actions"],"additionalProperties":false}}}}},"description":"The permission catalog custom roles are built from: every resource with its actions, annotated with whether the resource only takes effect at organization scope (such a permission cannot be granted by a team- or project-scoped binding).","tags":["Roles"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]}}},"/api/v1/roles/{id}":{"get":{"operationId":"getRole","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"builtIn":{"type":"boolean"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","description","permissions","builtIn","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Read one role: `admin`, `member` or `viewer`, or a custom role's id. A custom id from another organization answers 404 custom_role_not_found.","tags":["Roles"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"updateRole","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"builtIn":{"type":"boolean"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","description","permissions","builtIn","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Update a custom role. Partial: only the fields present are written; a permissions list replaces the set outright. A built-in role answers 409 role_is_built_in; adding a permission the caller does not hold on the organization answers 403 role_exceeds_caller_permissions.","tags":["Roles"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"permissions":{"minItems":1,"type":"array","items":{"type":"string"}}}}}}},"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteRole","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}}},"description":"Delete a custom role. A role that anything still holds, a legacy team assignment or a role binding, answers 409 custom_role_in_use with the counts in meta. A built-in role answers 409 role_is_built_in.","tags":["Roles"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/rum/v1/traces":{"post":{"operationId":"ingestBrowserTraces","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"description":"The LangWatch app's browser tracing exports here. An OTLP exporter reads only the status: 202 once the report is accepted, whatever the collector later makes of it, since a server error would have every open tab retry.","summary":"Report the platform's own browser traces","tags":["Browser telemetry"],"requestBody":{"required":true,"content":{"text/plain":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/scenarios":{"get":{"operationId":"getApiScenarios","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"The model that plays the user, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"judgeModel":{"description":"The model that judges the run, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"maxTurns":{"description":"The most conversation turns a run of this scenario takes, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minTurns":{"description":"The fewest conversation turns before the judge may end a run, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"testSuiteId":{"description":"The test suite this scenario is filed in, or null when unfiled. Absent on servers that predate test suites.","type":["string","null"]},"fields":{"description":"The value this scenario carries for each field its test suite declares, keyed by field identifier. A field with no value has no key. Absent on servers that predate suite fields.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","situation","criteria","labels","parameters","platformUrl"],"additionalProperties":false}}}}}},"description":"Get all scenarios for a project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]}},"post":{"operationId":"postApiScenarios","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"The model that plays the user, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"judgeModel":{"description":"The model that judges the run, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"maxTurns":{"description":"The most conversation turns a run of this scenario takes, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minTurns":{"description":"The fewest conversation turns before the judge may end a run, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"testSuiteId":{"description":"The test suite this scenario is filed in, or null when unfiled. Absent on servers that predate test suites.","type":["string","null"]},"fields":{"description":"The value this scenario carries for each field its test suite declares, keyed by field identifier. A field with no value has no key. Absent on servers that predate suite fields.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","situation","criteria","labels","parameters","platformUrl"],"additionalProperties":false}}}}},"description":"Create a new scenario","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"situation":{"type":"string"},"criteria":{"default":[],"type":"array","items":{"type":"string"}},"labels":{"default":[],"type":"array","items":{"type":"string"}},"parameters":{"description":"The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. A parameter marked secret carries no default: its value is supplied per run, encrypted, delivered to the target as secrets.NAME, and never readable from the scenario's own text.","maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"Model for the simulated user, e.g. openai/gpt-5-mini. Null uses the project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"judgeModel":{"description":"Model for the judge, e.g. openai/gpt-5-mini. Null uses the project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"maxTurns":{"description":"Maximum conversation turns for a run of this scenario. Null uses the default.","anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"minTurns":{"description":"Minimum conversation turns before the judge may end the run. Null uses the default.","anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"testSuiteId":{"description":"The test suite to file this scenario in. It must name a non-archived test suite of the same project. null files the scenario into the project's Default test suite.","type":["string","null"]},"fields":{"description":"The value for each field the test suite declares, keyed by field identifier: text, a number or a boolean, in the field's own type. A field the suite does not declare answers 422 scenario_field_unknown; a value of the wrong type answers 422 scenario_field_type_invalid. An empty value clears the field.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}}},"required":["name","situation"]}}}}}},"/api/v1/scenarios/{id}":{"get":{"operationId":"getApiScenariosById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"The model that plays the user, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"judgeModel":{"description":"The model that judges the run, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"maxTurns":{"description":"The most conversation turns a run of this scenario takes, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minTurns":{"description":"The fewest conversation turns before the judge may end a run, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"testSuiteId":{"description":"The test suite this scenario is filed in, or null when unfiled. Absent on servers that predate test suites.","type":["string","null"]},"fields":{"description":"The value this scenario carries for each field its test suite declares, keyed by field identifier. A field with no value has no key. Absent on servers that predate suite fields.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","situation","criteria","labels","parameters","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Scenario not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"Get a specific scenario by ID","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"put":{"operationId":"putApiScenariosById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"The model that plays the user, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"judgeModel":{"description":"The model that judges the run, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"maxTurns":{"description":"The most conversation turns a run of this scenario takes, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minTurns":{"description":"The fewest conversation turns before the judge may end a run, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"testSuiteId":{"description":"The test suite this scenario is filed in, or null when unfiled. Absent on servers that predate test suites.","type":["string","null"]},"fields":{"description":"The value this scenario carries for each field its test suite declares, keyed by field identifier. A field with no value has no key. Absent on servers that predate suite fields.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","situation","criteria","labels","parameters","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Scenario not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"Update an existing scenario","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"description":"The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. A parameter marked secret carries no default: its value is supplied per run, encrypted, delivered to the target as secrets.NAME, and never readable from the scenario's own text.","maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"Model for the simulated user, e.g. openai/gpt-5-mini. Null uses the project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"judgeModel":{"description":"Model for the judge, e.g. openai/gpt-5-mini. Null uses the project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"maxTurns":{"description":"Maximum conversation turns for a run of this scenario. Null uses the default.","anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"minTurns":{"description":"Minimum conversation turns before the judge may end the run. Null uses the default.","anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"testSuiteId":{"description":"The test suite to file this scenario in. It must name a non-archived test suite of the same project. null files the scenario into the project's Default test suite.","type":["string","null"]},"fields":{"description":"The value for each field the test suite declares, keyed by field identifier: text, a number or a boolean, in the field's own type. A field the suite does not declare answers 422 scenario_field_unknown; a value of the wrong type answers 422 scenario_field_type_invalid. An empty value clears the field. Send the full record; an empty record clears every value.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}}},"additionalProperties":false}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiScenariosById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"The model that plays the user, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"judgeModel":{"description":"The model that judges the run, or null for the project default. Absent on servers that predate model overrides on this family.","type":["string","null"]},"maxTurns":{"description":"The most conversation turns a run of this scenario takes, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minTurns":{"description":"The fewest conversation turns before the judge may end a run, or null for the default. Absent on servers that predate turn limits on this family.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"testSuiteId":{"description":"The test suite this scenario is filed in, or null when unfiled. Absent on servers that predate test suites.","type":["string","null"]},"fields":{"description":"The value this scenario carries for each field its test suite declares, keyed by field identifier. A field with no value has no key. Absent on servers that predate suite fields.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","situation","criteria","labels","parameters","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Scenario not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"Update an existing scenario","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"description":"The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. A parameter marked secret carries no default: its value is supplied per run, encrypted, delivered to the target as secrets.NAME, and never readable from the scenario's own text.","maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"description":"Model for the simulated user, e.g. openai/gpt-5-mini. Null uses the project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"judgeModel":{"description":"Model for the judge, e.g. openai/gpt-5-mini. Null uses the project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"maxTurns":{"description":"Maximum conversation turns for a run of this scenario. Null uses the default.","anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"minTurns":{"description":"Minimum conversation turns before the judge may end the run. Null uses the default.","anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"testSuiteId":{"description":"The test suite to file this scenario in. It must name a non-archived test suite of the same project. null files the scenario into the project's Default test suite.","type":["string","null"]},"fields":{"description":"The value for each field the test suite declares, keyed by field identifier: text, a number or a boolean, in the field's own type. A field the suite does not declare answers 422 scenario_field_unknown; a value of the wrong type answers 422 scenario_field_type_invalid. An empty value clears the field. Send the full record; an empty record clears every value.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}}},"additionalProperties":false}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiScenariosById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","archived"],"additionalProperties":false}}}},"404":{"description":"Scenario not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"Archive (soft-delete) a scenario","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/scenarios/{id}/versions":{"get":{"operationId":"getApiScenariosByIdVersions","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The version number, counting from 1."},"authorLabel":{"description":"Which surface wrote the version: user, api, cli or langy. Null on the synthesized Created entry of a scenario saved before versions were recorded.","type":["string","null"]},"authorId":{"description":"The user who saved the version. Null when the save came from an API key.","type":["string","null"]},"changeDescription":{"type":["string","null"]},"changedFields":{"type":"array","items":{"type":"string"},"description":"The fields whose value this save changed."},"createdAt":{"type":"string","description":"When the version was written, in ISO 8601."},"isSynthesized":{"type":"boolean","description":"True on the Created entry a scenario saved before versions were recorded shows. It has no stored snapshot, so it cannot be read back."}},"required":["version","authorLabel","authorId","changeDescription","changedFields","createdAt","isSynthesized"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Pass as cursor to read the page below this one. Null on the last page."}},"required":["versions","nextCursor"],"additionalProperties":false}}}},"404":{"description":"Scenario not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"List the saved versions of a scenario, newest first. A scenario saved before versions were recorded closes its history with a synthesized Created entry.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"integer","minimum":1,"maximum":9007199254740991},"description":"Read the page below this version number."}]}},"/api/v1/scenarios/{id}/versions/{version}":{"get":{"operationId":"getApiScenariosByIdVersionsByVersion","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The version number, counting from 1."},"authorLabel":{"description":"Which surface wrote the version: user, api, cli or langy. Null on the synthesized Created entry of a scenario saved before versions were recorded.","type":["string","null"]},"authorId":{"description":"The user who saved the version. Null when the save came from an API key.","type":["string","null"]},"changeDescription":{"type":["string","null"]},"changedFields":{"type":"array","items":{"type":"string"},"description":"The fields whose value this save changed."},"createdAt":{"type":"string","description":"When the version was written, in ISO 8601."},"isSynthesized":{"type":"boolean","description":"True on the Created entry a scenario saved before versions were recorded shows. It has no stored snapshot, so it cannot be read back."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shape the snapshot was written in."},"snapshot":{"type":"object","properties":{"name":{"type":"string"},"situation":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string","maxLength":500},"defaultValue":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]},"secret":{"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean"]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"required":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"simulatorModel":{"type":["string","null"]},"judgeModel":{"type":["string","null"]},"maxTurns":{"type":["number","null"]},"minTurns":{"type":["number","null"]},"fields":{"description":"The field values as this version saved them. Absent on servers that predate suite fields.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"number"},{"type":"boolean"}]}}},"required":["name","situation","criteria","labels","parameters","simulatorModel","judgeModel","maxTurns","minTurns"],"additionalProperties":false,"description":"The editable content of the case as this version saved it."}},"required":["version","authorLabel","authorId","changeDescription","changedFields","createdAt","isSynthesized","schemaVersion","snapshot"],"additionalProperties":false}}}},"404":{"description":"Scenario or version not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"Get one saved version of a scenario, with the name, situation, criteria, labels and parameters as that version saved them.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"version","schema":{"type":"integer","minimum":1,"maximum":9007199254740991},"required":true}]}},"/api/v1/simulation-runs":{"get":{"operationId":"getApiSimulationRuns","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"scenarioId":{"type":"string"},"batchRunId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"type":"string"},"name":{"type":["string","null"]},"description":{"type":["string","null"]},"status":{"type":"string"},"results":{"anyOf":[{"type":"object","properties":{"verdict":{"type":["string","null"]},"reasoning":{"type":["string","null"]},"metCriteria":{"type":"array","items":{"type":"string"}},"unmetCriteria":{"type":"array","items":{"type":"string"}},"inconclusiveCriteria":{"description":"Criteria the judge could not check because the evidence was missing. Each is also in `unmetCriteria`.","type":"array","items":{"type":"string"}},"criteria":{"description":"Each criterion with its status (`passed`, `failed` or `inconclusive`) and the judge's reasoning for it, in the order the scenario declares them. Runs from SDKs before per-criterion verdicts carry an empty reasoning.","type":"array","items":{"type":"object","properties":{"criterion":{"type":"string"},"requirement":{"type":"string"},"status":{"type":"string","enum":["passed","failed","inconclusive"]},"reasoning":{"default":"","type":"string"}},"required":["criterion","status","reasoning"],"additionalProperties":false}},"error":{"type":["string","null"]},"evaluations":{"description":"One result per evaluator that ran on the scenario. Absent on a run with no evaluators, and on servers that predate evaluators.","type":"array","items":{"type":"object","properties":{"evaluatorId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["passed","failed","scored","skipped","error"]},"required":{"type":"boolean"},"passed":{"type":"boolean"},"score":{"type":"number"},"label":{"type":"string"},"details":{"type":"string"},"cost":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"],"additionalProperties":false},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["evaluatorId","name","status","required"],"additionalProperties":false}}},"additionalProperties":false},{"type":"null"}]},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"messagesTruncated":{"description":"True when `messages` holds only the first few messages of a longer conversation. Pass `include=messages` to read them all.","type":"boolean"},"timestamp":{"type":"number"},"updatedAt":{"type":"number"},"durationInMs":{"type":"number"},"totalCost":{"type":"number"},"roleCosts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"number"}}},"roleLatencies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"number"}}},"note":{"description":"One short line saying why the run was started, as given when it was queued. Null on a run started without one.","type":["string","null"]},"scenarioVersion":{"description":"The version of the scenario at the moment the run was queued. Null on runs recorded before versions existed.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"platformUrl":{"type":"string","format":"uri"}},"required":["scenarioId","batchRunId","scenarioRunId","name","description","status","results","messages","timestamp","updatedAt","durationInMs","platformUrl"],"additionalProperties":false}},"hasMore":{"type":"boolean"},"nextCursor":{"type":"string"}},"required":["runs"],"additionalProperties":false}}}}},"description":"List simulation runs, optionally filtered by scenarioSetId or batchRunId. Set-level and unfiltered listings trim each run to its first few messages and report the trim as `messagesTruncated`; pass `include=messages` to read whole conversations, which caps the page at 20 runs, ending on a batch boundary. A batch-scoped listing always carries whole conversations.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"query","name":"scenarioSetId","schema":{"type":"string"}},{"in":"query","name":"batchRunId","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","exclusiveMinimum":0,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"include","schema":{"type":"string","const":"messages"},"description":"Pass `messages` to read whole conversations instead of the first few messages of each run. The page size is capped at 20 runs when set, and ends on a batch boundary."}]}},"/api/v1/simulation-runs/{scenarioRunId}":{"get":{"operationId":"getApiSimulationRunsByScenarioRunId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"scenarioId":{"type":"string"},"batchRunId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"type":"string"},"name":{"type":["string","null"]},"description":{"type":["string","null"]},"status":{"type":"string"},"results":{"anyOf":[{"type":"object","properties":{"verdict":{"type":["string","null"]},"reasoning":{"type":["string","null"]},"metCriteria":{"type":"array","items":{"type":"string"}},"unmetCriteria":{"type":"array","items":{"type":"string"}},"inconclusiveCriteria":{"description":"Criteria the judge could not check because the evidence was missing. Each is also in `unmetCriteria`.","type":"array","items":{"type":"string"}},"criteria":{"description":"Each criterion with its status (`passed`, `failed` or `inconclusive`) and the judge's reasoning for it, in the order the scenario declares them. Runs from SDKs before per-criterion verdicts carry an empty reasoning.","type":"array","items":{"type":"object","properties":{"criterion":{"type":"string"},"requirement":{"type":"string"},"status":{"type":"string","enum":["passed","failed","inconclusive"]},"reasoning":{"default":"","type":"string"}},"required":["criterion","status","reasoning"],"additionalProperties":false}},"error":{"type":["string","null"]},"evaluations":{"description":"One result per evaluator that ran on the scenario. Absent on a run with no evaluators, and on servers that predate evaluators.","type":"array","items":{"type":"object","properties":{"evaluatorId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["passed","failed","scored","skipped","error"]},"required":{"type":"boolean"},"passed":{"type":"boolean"},"score":{"type":"number"},"label":{"type":"string"},"details":{"type":"string"},"cost":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"],"additionalProperties":false},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["evaluatorId","name","status","required"],"additionalProperties":false}}},"additionalProperties":false},{"type":"null"}]},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"messagesTruncated":{"description":"True when `messages` holds only the first few messages of a longer conversation. Pass `include=messages` to read them all.","type":"boolean"},"timestamp":{"type":"number"},"updatedAt":{"type":"number"},"durationInMs":{"type":"number"},"totalCost":{"type":"number"},"roleCosts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"number"}}},"roleLatencies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"number"}}},"note":{"description":"One short line saying why the run was started, as given when it was queued. Null on a run started without one.","type":["string","null"]},"scenarioVersion":{"description":"The version of the scenario at the moment the run was queued. Null on runs recorded before versions existed.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"platformUrl":{"type":"string","format":"uri"}},"required":["scenarioId","batchRunId","scenarioRunId","name","description","status","results","messages","timestamp","updatedAt","durationInMs","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"Get a single simulation run by its ID","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"path","name":"scenarioRunId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/simulation-runs/batches/list":{"get":{"operationId":"getApiSimulationRunsBatchesList","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"batches":{"type":"array","items":{"type":"object","properties":{"batchRunId":{"type":"string"},"totalCount":{"type":"number"},"passCount":{"type":"number"},"failCount":{"type":"number"},"runningCount":{"type":"number"},"settledCount":{"type":"number"},"stalledCount":{"type":"number"},"lastRunAt":{"type":"number"},"lastUpdatedAt":{"type":"number"},"firstCompletedAt":{"type":["number","null"]},"allCompletedAt":{"description":"Deprecated: read settledCount and isComplete instead. It carries the last update time of a batch where no run is running.","deprecated":true,"type":["number","null"]},"isComplete":{"type":"boolean","description":"True when every run of the batch reached a terminal status."},"note":{"description":"One short line saying why the batch was run, as given when it was queued. Null on a batch run without one.","type":["string","null"]}},"required":["batchRunId","totalCount","passCount","failCount","runningCount","settledCount","stalledCount","lastRunAt","lastUpdatedAt","firstCompletedAt","allCompletedAt","isComplete"],"additionalProperties":false}},"hasMore":{"type":"boolean"},"nextCursor":{"type":"string"}},"required":["batches"],"additionalProperties":false}}}}},"description":"List batch summaries for a scenario set (pass/fail counts per batch)","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"query","name":"scenarioSetId","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":10,"type":"integer","exclusiveMinimum":0,"maximum":50}},{"in":"query","name":"cursor","schema":{"type":"string"}}]}},"/api/v1/simulation-runs/batches/{batchRunId}":{"get":{"operationId":"getApiSimulationRunsBatchesByBatchRunId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"batchRunId":{"type":"string"},"totalCount":{"type":"number"},"passCount":{"type":"number"},"failCount":{"type":"number"},"runningCount":{"type":"number"},"settledCount":{"type":"number"},"stalledCount":{"type":"number"},"lastRunAt":{"type":"number"},"lastUpdatedAt":{"type":"number"},"firstCompletedAt":{"type":["number","null"]},"allCompletedAt":{"description":"Deprecated: read settledCount and isComplete instead. It carries the last update time of a batch where no run is running.","deprecated":true,"type":["number","null"]},"isComplete":{"type":"boolean","description":"True when every run of the batch reached a terminal status."},"note":{"description":"One short line saying why the batch was run, as given when it was queued. Null on a batch run without one.","type":["string","null"]}},"required":["batchRunId","totalCount","passCount","failCount","runningCount","settledCount","stalledCount","lastRunAt","lastUpdatedAt","firstCompletedAt","allCompletedAt","isComplete"],"additionalProperties":false}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"description":"Get the summary of a single batch run, including its completion flag","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"path","name":"batchRunId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/agents/{id}/test":{"post":{"operationId":"testAgent","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"scenarioRunId":{"type":"string","description":"The run to follow; open it in the simulations run drawer."},"batchRunId":{"type":"string","description":"The batch the run belongs to."},"setId":{"type":"string","description":"The internal set that holds agent test runs."}},"required":["scenarioRunId","batchRunId","setId"],"additionalProperties":false}}}}},"summary":"Schedule a scripted test run and return its run identifiers","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The agent id."}]}},"/api/v1/scenario-events":{"post":{"operationId":"postApiScenarioEvents","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"url":{"type":["string","null"]}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid event data","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Create a new scenario event","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_RUN_STARTED"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"metadata":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"note":{"type":"string"},"agents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["agent","user","judge"]}},"required":["name","role"]}},"langwatch":{"type":"object","properties":{"targetReferenceId":{"type":"string"},"targetType":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"targetKey":{"type":"string"},"targetParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"simulationSuiteId":{"type":"string"},"scenarioVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"simulatorModel":{"type":"string"},"judgeModel":{"type":"string"},"resolvedSimulatorModel":{"type":"string"},"resolvedJudgeModel":{"type":"string"},"actorId":{"type":"string"},"actorLabel":{"type":"string","enum":["user","api","cli"]},"agentInstance":{"type":"object","properties":{"hostname":{"type":"string"},"label":{"type":["string","null"]}},"required":["hostname","label"]},"callerKind":{"type":"string","enum":["simulated","human"]},"caller":{"type":"object","properties":{"voice":{"type":"string"},"interruptProbability":{"type":"number"},"effects":{"type":"string"}},"required":["voice","interruptProbability","effects"]},"isCutAtLimit":{"type":"boolean"}},"required":["targetReferenceId","targetType"]}},"additionalProperties":{}}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","metadata"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_RUN_FINISHED"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"status":{"type":"string","enum":["SUCCESS","ERROR","CANCELLED","IN_PROGRESS","PENDING","FAILED","STALLED","QUEUED","RUNNING","PENDING_EVALUATION"]},"results":{"anyOf":[{"type":"object","properties":{"verdict":{"type":"string","enum":["success","failure","inconclusive"]},"reasoning":{"type":"string"},"metCriteria":{"type":"array","items":{"type":"string"}},"unmetCriteria":{"type":"array","items":{"type":"string"}},"inconclusiveCriteria":{"type":"array","items":{"type":"string"}},"criteria":{"type":"array","items":{"type":"object","properties":{"criterion":{"type":"string"},"requirement":{"type":"string"},"status":{"type":"string","enum":["passed","failed","inconclusive"]},"reasoning":{"default":"","type":"string"}},"required":["criterion","status"]}},"error":{"type":"string"},"evaluations":{"type":"array","items":{"type":"object","properties":{"evaluatorId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["passed","failed","scored","skipped","error"]},"required":{"type":"boolean"},"passed":{"type":"boolean"},"score":{"type":"number"},"label":{"type":"string"},"details":{"type":"string"},"cost":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["evaluatorId","name","status","required"]}}},"required":["verdict","metCriteria","unmetCriteria"]},{"type":"null"}]}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","status"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_MESSAGE_SNAPSHOT"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"messages":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"trace_id":{"type":"string"},"role":{"type":"string","enum":["developer","system","assistant","user","tool","activity","reasoning"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"metadata":{}},"additionalProperties":{}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"name":{"type":"string"},"encryptedValue":{"type":"string"},"toolCallId":{"type":"string"},"error":{"type":"string"},"activityType":{"type":"string"},"toolCalls":{"type":"array","items":{"$ref":"#/components/schemas/AgUiToolCall"}},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/AgUiToolCall"}}},"required":["id","role"]},{"type":"object","properties":{"id":{"type":"string"},"trace_id":{"type":"string"},"role":{"type":"string"},"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"citations":{"anyOf":[{"type":"array","items":{}},{"type":"null"}]}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_use"},"id":{"type":"string"},"name":{"type":"string"},"input":{}},"required":["type","id","name","input"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_result"},"tool_use_id":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{}}]},"is_error":{"type":"boolean"}},"required":["type","tool_use_id"]},{"type":"object","properties":{"type":{"type":"string","const":"thinking"},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"]},{"type":"object","properties":{"type":{"type":"string","const":"redacted_thinking"},"data":{"type":"string"}},"required":["type","data"]}]}}},"required":["content"]},{"type":"object","properties":{"id":{"type":"string"},"trace_id":{"type":"string"},"role":{"anyOf":[{"type":"string","const":"system"},{"type":"string","const":"developer"},{"type":"string","const":"user"},{"type":"string","const":"assistant"},{"type":"string","const":"function"},{"type":"string","const":"tool"},{"type":"string","const":"unknown"}]},"content":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"content":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"anyOf":[{"type":"string","const":"auto"},{"type":"string","const":"low"},{"type":"string","const":"high"}]}},"required":["url"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_call"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"args":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_result"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"result":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"binary"},"mimeType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"id":{"type":"string"},"filename":{"type":"string"}},"required":["type","mimeType"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"id":{"type":"string"}}}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","const":"audio"},"source":{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"url"},{"type":"string","const":"data"}]},"value":{"type":"string"},"mimeType":{"type":"string"}},"required":["type","value"]}},"required":["type","source"]},{"type":"object","properties":{"type":{"type":"string","const":"image"},"image":{"type":"string"},"mediaType":{"type":"string"}},"required":["type","image"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"mediaType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"filename":{"type":"string"}},"required":["type","mediaType"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file":{"type":"object","properties":{"file_data":{"type":"string"},"file_id":{"type":"string"},"filename":{"type":"string"}}}},"required":["type","file"]}]}}]},{"type":"null"}]},"parts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"content":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"anyOf":[{"type":"string","const":"auto"},{"type":"string","const":"low"},{"type":"string","const":"high"}]}},"required":["url"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_call"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"args":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tool_result"},"toolName":{"type":"string"},"toolCallId":{"type":"string"},"result":{}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"binary"},"mimeType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"id":{"type":"string"},"filename":{"type":"string"}},"required":["type","mimeType"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"id":{"type":"string"}}}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","const":"audio"},"source":{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"url"},{"type":"string","const":"data"}]},"value":{"type":"string"},"mimeType":{"type":"string"}},"required":["type","value"]}},"required":["type","source"]},{"type":"object","properties":{"type":{"type":"string","const":"image"},"image":{"type":"string"},"mediaType":{"type":"string"}},"required":["type","image"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"mediaType":{"type":"string"},"data":{"type":"string"},"url":{"type":"string"},"filename":{"type":"string"}},"required":["type","mediaType"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file":{"type":"object","properties":{"file_data":{"type":"string"},"file_id":{"type":"string"},"filename":{"type":"string"}}}},"required":["type","file"]}]}},"function_call":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}}},{"type":"null"}]},"tool_calls":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}}}},"required":["id","type","function"]}},{"type":"null"}]},"tool_call_id":{"type":["string","null"]},"name":{"type":["string","null"]},"reasoning_content":{"type":["string","null"]}}},{"type":"object","properties":{"id":{"type":"string"},"trace_id":{"type":"string"},"role":{"type":"string"},"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string"},"mimeType":{"type":"string"},"url":{"type":"string"},"id":{"type":"string"}}}},"required":["type","input_audio"]}]}}},"required":["content"]}]}}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","messages"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_TEXT_MESSAGE_START"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"messageId":{"type":"string"},"role":{"type":"string"},"messageIndex":{"type":"number"}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","messageId","role"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_TEXT_MESSAGE_END"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"messageId":{"type":"string"},"role":{"type":"string"},"content":{"type":"string"},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"traceId":{"type":"string"},"messageIndex":{"type":"number"}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","messageId","role"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_TEXT_MESSAGE_CONTENT"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"messageId":{"type":"string"},"delta":{"type":"string"}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","messageId","delta"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_TOOL_CALL_START"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"toolCallId":{"type":"string"},"toolCallName":{"type":"string"},"parentMessageId":{"type":"string"}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","toolCallId","toolCallName"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_TOOL_CALL_ARGS"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"toolCallId":{"type":"string"},"delta":{"type":"string"}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","toolCallId","delta"]},{"type":"object","properties":{"type":{"type":"string","const":"SCENARIO_TOOL_CALL_END"},"timestamp":{"type":"number"},"rawEvent":{},"batchRunId":{"type":"string"},"scenarioId":{"type":"string"},"scenarioRunId":{"type":"string"},"scenarioSetId":{"default":"default","type":"string"},"toolCallId":{"type":"string"}},"required":["type","timestamp","batchRunId","scenarioId","scenarioRunId","toolCallId"]}]}}}}},"delete":{"operationId":"deleteApiScenarioEvents","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"scenarioSetId":{"type":"string"},"hasMore":{"type":"boolean"},"scenarioRunId":{"type":"string"}},"required":["archived","failed"],"additionalProperties":false}}}},"400":{"description":"Missing or invalid scope parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Scenario run not found in this project","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Archive simulation runs. Pass exactly one of scenarioSetId (archives every run in the set; scenarioSetId=default targets the implicit default set) or scenarioRunId (archives that one run).","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"parameters":[{"in":"query","name":"scenarioSetId","schema":{"type":"string","minLength":1}},{"in":"query","name":"scenarioRunId","schema":{"type":"string","minLength":1}}]}},"/api/v1/scenario-events/browser-tab":{"post":{"operationId":"postApiScenarioEventsBrowserTab","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"url":{"type":"string"}},"required":["delivered","url"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Offer a batch run to an already-open simulations tab on the caller's machine. Returns whether a live tab took it.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tabKey":{"type":"string","minLength":1,"maxLength":200},"batchRunId":{"type":"string","minLength":1,"maxLength":200},"scenarioSetId":{"type":"string","minLength":1,"maxLength":200}},"required":["tabKey","batchRunId"]}}}}}},"/api/v1/scim-tokens":{"get":{"operationId":"listScimTokens","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":["string","null"]},"connectionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","description","connectionId","createdAt","lastUsedAt"],"additionalProperties":false}}},"required":["tokens"],"additionalProperties":false}}}}},"description":"List the organization's SCIM bearer tokens: id, description, creation time and last use. Token values and hashes are never returned; the value exists only in the create response, once.","tags":["SCIM Tokens"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]}},"post":{"operationId":"createScimToken","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"connectionId":{"type":"string"},"description":{"type":["string","null"]}},"required":["id","token","connectionId","description"],"additionalProperties":false}}}}},"description":"Mint a SCIM bearer token for this organization's /api/scim/v2 endpoints. The token value is returned once, here, and never again; store it in the identity provider immediately.","tags":["SCIM Tokens"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":255},"connectionId":{"type":"string","minLength":1}}}}}},"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]}}},"/api/v1/scim-tokens/{id}":{"delete":{"operationId":"revokeScimToken","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false}}}}},"description":"Revoke a SCIM token so it stops verifying immediately. An unknown or already-revoked id answers 404 scim_token_not_found.","tags":["SCIM Tokens"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["organization:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/scim/v2/ServiceProviderConfig":{"get":{"operationId":"scimGetServiceProviderConfig","responses":{"200":{"description":"The supported capabilities.","content":{"application/json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"}},"documentationUri":{"type":"string"},"patch":{"type":"object","properties":{"supported":{"type":"boolean"}},"required":["supported"],"additionalProperties":false},"bulk":{"type":"object","properties":{"supported":{"type":"boolean"},"maxOperations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxPayloadSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["supported","maxOperations","maxPayloadSize"],"additionalProperties":false},"filter":{"type":"object","properties":{"supported":{"type":"boolean"},"maxResults":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["supported","maxResults"],"additionalProperties":false},"changePassword":{"type":"object","properties":{"supported":{"type":"boolean"}},"required":["supported"],"additionalProperties":false},"sort":{"type":"object","properties":{"supported":{"type":"boolean"}},"required":["supported"],"additionalProperties":false},"etag":{"type":"object","properties":{"supported":{"type":"boolean"}},"required":["supported"],"additionalProperties":false},"authenticationSchemes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["type","name","description"],"additionalProperties":false}}},"required":["schemas","documentationUri","patch","bulk","filter","changePassword","sort","etag","authenticationSchemes"],"additionalProperties":false}}}}},"description":"What this SCIM implementation supports (RFC 7643 section 5), which is how an identity provider decides what it may call: PATCH and filtering are supported, bulk operations, sorting, ETags and password change are not. Unauthenticated, because a provider reads it while being configured, before a token exists.","summary":"Get the SCIM service provider configuration","tags":["SCIM"],"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/scim/v2/ResourceTypes":{"get":{"operationId":"scimListResourceTypes","responses":{"200":{"description":"The User and Group resource types.","content":{"application/json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:ListResponse"}},"totalResults":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"startIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"itemsPerPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"Resources":{"type":"array","items":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:ResourceType"}},"id":{"type":"string"},"name":{"type":"string"},"endpoint":{"type":"string"},"schema":{"type":"string"},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"ResourceType"},"location":{"type":"string"}},"required":["resourceType","location"],"additionalProperties":false}},"required":["schemas","id","name","endpoint","schema","meta"],"additionalProperties":false}}},"required":["schemas","totalResults","startIndex","itemsPerPage","Resources"],"additionalProperties":false}}}}},"description":"The resources this service provisions, User and Group, each naming the endpoint and the schema URN that serves it (RFC 7643 section 6). Unauthenticated, like the rest of SCIM discovery.","summary":"List the SCIM resource types","tags":["SCIM"],"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/scim/v2/Schemas":{"get":{"operationId":"scimListSchemas","responses":{"200":{"description":"The User and Group schema definitions.","content":{"application/json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:ListResponse"}},"totalResults":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"startIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"itemsPerPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"Resources":{"type":"array","items":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:Schema"}},"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"multiValued":{"type":"boolean"},"required":{"type":"boolean"},"mutability":{"type":"string"},"returned":{"type":"string"},"caseExact":{"type":"boolean"},"uniqueness":{"type":"string"},"description":{"type":"string"},"subAttributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"multiValued":{"type":"boolean"},"required":{"type":"boolean"},"mutability":{"type":"string"},"returned":{"type":"string"},"description":{"type":"string"}},"required":["name","type","multiValued","required","mutability","returned"],"additionalProperties":false}}},"required":["name","type","multiValued","required","mutability","returned"],"additionalProperties":false}},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"Schema"},"location":{"type":"string"}},"required":["resourceType","location"],"additionalProperties":false}},"required":["schemas","id","name","description","attributes","meta"],"additionalProperties":false}}},"required":["schemas","totalResults","startIndex","itemsPerPage","Resources"],"additionalProperties":false}}}}},"description":"The attribute definitions for the User and Group resources (RFC 7643 section 7), which an identity provider reads to build its attribute mapping. A LangWatch group is an access group: its membership drives role bindings, and it is not a team. Unauthenticated, like the rest of SCIM discovery.","summary":"List the SCIM resource schemas","tags":["SCIM"],"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/scim/v2/Users":{"get":{"operationId":"scimListUsers","responses":{"200":{"description":"A page of provisioned users.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:ListResponse"}},"totalResults":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"startIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"itemsPerPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"Resources":{"type":"array","items":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:User"}},"id":{"type":"string"},"externalId":{"type":"string"},"userName":{"type":"string"},"name":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"}},"required":["givenName","familyName"],"additionalProperties":false},"emails":{"type":"array","items":{"type":"object","properties":{"primary":{"type":"boolean"},"value":{"type":"string"},"type":{"type":"string"}},"required":["primary","value","type"],"additionalProperties":false}},"active":{"type":"boolean"},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"User"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","userName","name","emails","active","meta"],"additionalProperties":false}}},"required":["schemas","totalResults","startIndex","itemsPerPage","Resources"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"The members of the organization the token belongs to, as SCIM users. Two filter expressions are understood: `userName eq \"someone@example.com\"`, matched against the member's email without regard to case, and `externalId eq \"...\"`, matched against the identifier the presented token's own directory connection pushed. Any other filter is refused.","summary":"List provisioned users","tags":["SCIM"],"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"query","name":"filter","schema":{"type":"string"},"description":"A SCIM filter. Only `attribute eq \"...\"` is understood; any other expression is refused."},{"in":"query","name":"startIndex","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"1-based index of the first resource to return. Anything that does not parse as a positive integer is read as 1."},{"in":"query","name":"count","schema":{"type":"integer","minimum":-9007199254740991,"maximum":100},"description":"How many resources to return, capped at 100 (the `filter.maxResults` ServiceProviderConfig publishes). Anything that does not parse as a positive integer is read as 100, and anything above 100 is served as 100."}]},"post":{"operationId":"scimCreateUser","responses":{"201":{"description":"The provisioned user.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:User"}},"id":{"type":"string"},"externalId":{"type":"string"},"userName":{"type":"string"},"name":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"}},"required":["givenName","familyName"],"additionalProperties":false},"emails":{"type":"array","items":{"type":"object","properties":{"primary":{"type":"boolean"},"value":{"type":"string"},"type":{"type":"string"}},"required":["primary","value","type"],"additionalProperties":false}},"active":{"type":"boolean"},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"User"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","userName","name","emails","active","meta"],"additionalProperties":false}}}},"400":{"description":"The request body is not JSON, or does not match the SCIM schema for this operation.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"409":{"description":"A member with this userName already exists in the organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Adds a member to the organization, creating the LangWatch account when the email is new. Someone who already has an account is added and reactivated rather than refused, which is what lets a directory sync be re-run without special-casing the people it already knows. New members join with the MEMBER role at organization scope. `costCenter` on the enterprise user extension assigns their department, creating that department on first use.","summary":"Provision a user","tags":["SCIM"],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","minLength":1},"userName":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"}}},"emails":{"type":"array","items":{"type":"object","properties":{"primary":{"type":"boolean"},"value":{"type":"string"},"type":{"type":"string"}},"required":["value"]}},"active":{"type":"boolean"},"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"type":"object","properties":{"costCenter":{"type":["string","null"]}},"additionalProperties":{}}},"required":["schemas","userName"],"additionalProperties":{}}}}},"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]}}},"/api/scim/v2/Users/{id}":{"get":{"operationId":"scimGetUser","responses":{"200":{"description":"The user.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:User"}},"id":{"type":"string"},"externalId":{"type":"string"},"userName":{"type":"string"},"name":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"}},"required":["givenName","familyName"],"additionalProperties":false},"emails":{"type":"array","items":{"type":"object","properties":{"primary":{"type":"boolean"},"value":{"type":"string"},"type":{"type":"string"}},"required":["primary","value","type"],"additionalProperties":false}},"active":{"type":"boolean"},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"User"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","userName","name","emails","active","meta"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such member in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Reads one member of the organization the token belongs to. An id that is not a member answers 404, whether or not it names a LangWatch account elsewhere.","summary":"Get a provisioned user","tags":["SCIM"],"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"put":{"operationId":"scimReplaceUser","responses":{"200":{"description":"The updated user.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:User"}},"id":{"type":"string"},"externalId":{"type":"string"},"userName":{"type":"string"},"name":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"}},"required":["givenName","familyName"],"additionalProperties":false},"emails":{"type":"array","items":{"type":"object","properties":{"primary":{"type":"boolean"},"value":{"type":"string"},"type":{"type":"string"}},"required":["primary","value","type"],"additionalProperties":false}},"active":{"type":"boolean"},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"User"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","userName","name","emails","active","meta"],"additionalProperties":false}}}},"400":{"description":"The request body is not JSON, or does not match the SCIM schema for this operation.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such member in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Replaces the member's attributes with the body. It is a whole-resource write, so an attribute the identity provider leaves out is reset rather than kept: omitting `active` reactivates the member. Send PATCH instead to change one attribute.","summary":"Replace a provisioned user","tags":["SCIM"],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","minLength":1},"userName":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"}}},"emails":{"type":"array","items":{"type":"object","properties":{"primary":{"type":"boolean"},"value":{"type":"string"},"type":{"type":"string"}},"required":["value"]}},"active":{"type":"boolean"},"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"type":"object","properties":{"costCenter":{"type":["string","null"]}},"additionalProperties":{}}},"required":["schemas","userName"],"additionalProperties":{}}}}},"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"scimPatchUser","responses":{"200":{"description":"The updated user.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:User"}},"id":{"type":"string"},"externalId":{"type":"string"},"userName":{"type":"string"},"name":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"}},"required":["givenName","familyName"],"additionalProperties":false},"emails":{"type":"array","items":{"type":"object","properties":{"primary":{"type":"boolean"},"value":{"type":"string"},"type":{"type":"string"}},"required":["primary","value","type"],"additionalProperties":false}},"active":{"type":"boolean"},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"User"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","userName","name","emails","active","meta"],"additionalProperties":false}}}},"400":{"description":"The request body is not JSON, or does not match the SCIM schema for this operation.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such member in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Applies RFC 7644 section 3.5.2 patch operations. What is implemented: `replace` of `active` (deactivating or reactivating the account), of `userName`, and of `name.givenName` / `name.familyName`, written either as an operation path or as keys inside a value object; and `add`, `replace` or `remove` of the enterprise `costCenter`, which reassigns the member's department. `replace`, `add` and `remove` are the only operation names understood, read without regard to case, so the capitalized `Replace` that Entra ID writes is accepted; any other name, or a missing or non-string one, is rejected with a 400. An understood operation aimed at anything not listed above is accepted and changes nothing.","summary":"Update a provisioned user","tags":["SCIM"],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"Operations":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["replace","add","remove"]},"path":{"type":"string"},"value":{}},"required":["op"]}}},"required":["schemas","Operations"]}}}},"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"scimDeleteUser","responses":{"200":{"description":"Success","content":{"application/scim+json":{}}},"204":{"description":"Deprovisioned. No body.","content":{}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such member in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Removes the member from the organization, drops the role bindings they held there, and deactivates their account. The LangWatch user record itself is kept, so past traces, evaluations and audit entries stay attributable.","summary":"Deprovision a user","tags":["SCIM"],"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/scim/v2/Groups":{"get":{"operationId":"scimListGroups","responses":{"200":{"description":"A page of provisioned groups.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:ListResponse"}},"totalResults":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"startIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"itemsPerPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"Resources":{"type":"array","items":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:Group"}},"id":{"type":"string"},"externalId":{"type":"string"},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"display":{"type":"string"}},"required":["value"],"additionalProperties":false}},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"Group"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","displayName","meta"],"additionalProperties":false}}},"required":["schemas","totalResults","startIndex","itemsPerPage","Resources"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"The organization's SCIM-provisioned access groups. Groups created in LangWatch itself are not listed: the directory sees what it provisioned, and nothing else. One filter expression is understood, `displayName eq \"Engineering\"`, matched without regard to case.","summary":"List provisioned groups","tags":["SCIM"],"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"query","name":"filter","schema":{"type":"string"},"description":"A SCIM filter. Only `attribute eq \"...\"` is understood; any other expression is refused."},{"in":"query","name":"startIndex","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"1-based index of the first resource to return. Anything that does not parse as a positive integer is read as 1."},{"in":"query","name":"count","schema":{"type":"integer","minimum":-9007199254740991,"maximum":100},"description":"How many resources to return, capped at 100 (the `filter.maxResults` ServiceProviderConfig publishes). Anything that does not parse as a positive integer is read as 100, and anything above 100 is served as 100."},{"in":"query","name":"excludedAttributes","schema":{"type":"string"},"description":"Comma-separated attribute names to leave out of the response. Only `members` is honoured, and it is what lets a directory page through groups without pulling every membership."}]},"post":{"operationId":"scimCreateGroup","responses":{"201":{"description":"The provisioned group.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:Group"}},"id":{"type":"string"},"externalId":{"type":"string"},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"display":{"type":"string"}},"required":["value"],"additionalProperties":false}},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"Group"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","displayName","meta"],"additionalProperties":false}}}},"400":{"description":"The request body is not JSON, or does not match the SCIM schema for this operation.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"409":{"description":"A provisioned group with this displayName already exists in the organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Creates an access group. Members are given as LangWatch user ids, the same ids the Users endpoints return; an id that is not a member of the organization is skipped rather than failing the call, so a group can be provisioned before everyone in it is. Granting the group access is a separate step: a group carries no permissions until a role binding is created for it.","summary":"Provision a group","tags":["SCIM"],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","minLength":1},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"display":{"type":"string"}},"required":["value"]}}},"required":["schemas","displayName"]}}}},"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]}}},"/api/scim/v2/Groups/{id}":{"get":{"operationId":"scimGetGroup","responses":{"200":{"description":"The group.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:Group"}},"id":{"type":"string"},"externalId":{"type":"string"},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"display":{"type":"string"}},"required":["value"],"additionalProperties":false}},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"Group"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","displayName","meta"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such group in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Reads one provisioned group and its members. A group that exists but was created in LangWatch rather than provisioned is not readable here.","summary":"Get a provisioned group","tags":["SCIM"],"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"excludedAttributes","schema":{"type":"string"},"description":"Comma-separated attribute names to leave out of the response. Only `members` is honoured, and it is what lets a directory page through groups without pulling every membership."}]},"put":{"operationId":"scimReplaceGroup","responses":{"200":{"description":"The updated group.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:Group"}},"id":{"type":"string"},"externalId":{"type":"string"},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"display":{"type":"string"}},"required":["value"],"additionalProperties":false}},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"Group"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","displayName","meta"],"additionalProperties":false}}}},"400":{"description":"The request body is not JSON, or does not match the SCIM schema for this operation.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such group in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Replaces the group's display name and its membership with the body. Membership is a whole-resource write: a member absent from `members` is removed from the group, and omitting `members` empties it. Role bindings granted to the group are untouched.","summary":"Replace a provisioned group","tags":["SCIM"],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","minLength":1},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"display":{"type":"string"}},"required":["value"]}}},"required":["schemas","displayName"]}}}},"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"scimPatchGroup","responses":{"200":{"description":"The updated group.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:schemas:core:2.0:Group"}},"id":{"type":"string"},"externalId":{"type":"string"},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"display":{"type":"string"}},"required":["value"],"additionalProperties":false}},"meta":{"type":"object","properties":{"resourceType":{"type":"string","const":"Group"},"created":{"type":"string"},"lastModified":{"type":"string"}},"required":["resourceType","created","lastModified"],"additionalProperties":false}},"required":["schemas","id","displayName","meta"],"additionalProperties":false}}}},"400":{"description":"The request body is not JSON, or does not match the SCIM schema for this operation.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such group in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Applies RFC 7644 section 3.5.2 patch operations. What is implemented: `add` of members, `remove` of members (named by a value filter on the path, as Entra ID writes it, or in the operation value), `replace` of `displayName`, and `replace` of the whole member list. `replace`, `add` and `remove` are the only operation names understood, read without regard to case, so the capitalized `Add` / `Remove` that Entra ID writes are accepted; any other name, or a missing or non-string one, is rejected with a 400. An `add` or a `remove` aimed at anything other than members is accepted and changes nothing. A `replace` that is not a `displayName` rename is treated as a replacement of the whole member list, so one that carries no members empties the group.","summary":"Update a provisioned group","tags":["SCIM"],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"Operations":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["replace","add","remove"]},"path":{"type":"string"},"value":{}},"required":["op"]}}},"required":["schemas","Operations"]}}}},"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"scimDeleteGroup","responses":{"200":{"description":"Success","content":{"application/scim+json":{}}},"204":{"description":"Deprovisioned. No body.","content":{}},"401":{"description":"The Authorization header is missing, is not a bearer token, or names a token this deployment does not know.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"403":{"description":"The token is valid but the organization's plan no longer includes SCIM provisioning. Entitlement is checked on every call, so a directory connection stops the moment the Enterprise plan lapses.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}},"404":{"description":"No such group in this organization.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string","const":"urn:ietf:params:scim:api:messages:2.0:Error"}},"status":{"type":"string"},"detail":{"type":"string"},"scimType":{"type":"string"}},"required":["schemas","status","detail"],"additionalProperties":false}}}}},"description":"Deletes the group along with its memberships and every role binding granted through it, so the access it carried is revoked with it. The members themselves keep their organization membership and any access they hold directly.","summary":"Deprovision a group","tags":["SCIM"],"security":[{"scim_bearer":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["scim_token"],"permissions":[]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/webhooks/auth0-scim":{"post":{"operationId":"receiveAuth0ScimWebhook","responses":{"200":{"description":"Success","content":{"application/json":{}}}},"description":"Auth0's SCIM log stream, signed with the deployment's shared secret and tenanted by the SCIM token the delivery presents. A deployment that configured no secret answers 404, so a probe cannot learn whether the path is served here.","summary":"Receive an Auth0 SCIM log-stream delivery","tags":["SCIM"],"requestBody":{"required":true,"content":{"application/json":{}}},"security":[],"x-access-policy":{"kind":"public","credential":["none"]}}},"/api/v1/secrets":{"get":{"operationId":"getApiSecrets","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","createdAt","updatedAt"],"additionalProperties":false}}}}}},"description":"Lists metadata only. Secret values are never returned. Requests have 16 KiB inputs; the service enforces the 50-secret cap. Responses are not cached.","summary":"List project secrets","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["secrets:view"]},"parameters":[{"in":"query","name":"projectId","schema":{"type":"string","minLength":1}}]},"post":{"operationId":"postApiSecrets","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Encrypts the value at rest and never returns it. Requests have 16 KiB inputs.","summary":"Create a project secret","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["secrets:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"pattern":"^[A-Z][A-Z0-9_]*$"},"value":{"type":"string","minLength":1,"maxLength":10000}},"required":["name","value"],"additionalProperties":false}}}}}},"/api/v1/secrets/{id}":{"get":{"operationId":"getApiSecretsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","createdAt","updatedAt"],"additionalProperties":false}}}}},"summary":"Get project-secret metadata","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["secrets:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"projectId","schema":{"type":"string","minLength":1}}]},"put":{"operationId":"putApiSecretsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","createdAt","updatedAt"],"additionalProperties":false}}}}},"description":"Requests have 16 KiB inputs.","summary":"Replace a project secret value","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["secrets:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"value":{"type":"string","minLength":1,"maxLength":10000}},"required":["value"],"additionalProperties":false}}}}},"delete":{"operationId":"deleteApiSecretsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false}}}}},"summary":"Delete a project secret","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["secrets:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/slack-connections":{"get":{"operationId":"getApiSlackConnections","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"What an automation's `slackIntegrationId` names to post through this connection."},"name":{"type":"string"},"kind":{"type":"string","enum":["bot","webhook"],"description":"`bot` posts as the LangWatch Slack app and needs a `slackChannelId` on the automation; `webhook` posts to its incoming webhook's channel."},"scopeType":{"type":"string","enum":["ORGANIZATION","PROJECT"]},"scopeId":{"type":"string"},"scopeName":{"type":"string"},"slackTeamName":{"description":"The Slack workspace a bot connection posts into.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","kind","scopeType","scopeId","scopeName","slackTeamName","createdAt"],"additionalProperties":false}}}}}},"description":"List the Slack connections this project can deliver through: its own and its organization's, by name. Never returns a token or webhook URL.","tags":["Slack connections"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]}}},"/api/v1/stored-objects/uploads":{"post":{"operationId":"createStoredObjectUpload","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"objectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"uploadUrl":{"type":"string","format":"uri"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["objectId","uploadUrl","method","expiresAt"],"additionalProperties":false}}}}},"summary":"Create a stored-object upload","tags":["Stored Objects"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:update"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"purpose":{"type":"string","minLength":1,"maxLength":127},"filename":{"type":"string","minLength":1},"mediaType":{"type":"string","minLength":1,"maxLength":127,"pattern":"^[\\u0020-\\u007e]+$"},"byteLength":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["projectId","purpose","filename","mediaType","byteLength"],"additionalProperties":false}}}}}},"/api/v1/stored-objects/uploads/{storedObjectId}/confirmation":{"post":{"operationId":"confirmStoredObjectUpload","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"id":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"byteLength":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{},"mediaType":{"type":"string","minLength":1,"maxLength":127,"pattern":"^[\\u0020-\\u007e]+$"},"audience":{"type":"string","enum":["organization:view","project:view","team:view","analytics:view","cost:view","traces:view","scenarios:view","annotations:view","evaluations:view","datasets:view","triggers:view","workflows:view","experiments:view","prompts:view","secrets:view","playground:view","ops:view","auditLog:view","virtualKeys:view","gatewayBudgets:view","gatewayProviders:view","routingPolicies:view","gatewayGuardrails:view","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","governance:view","ingestionSources:view","anomalyRules:view","complianceExport:view","activityMonitor:view","aiTools:view","webhookEndpoints:view","gatewaySpend:view","langy:view","agentCache:view","governanceCost:view","sso:view"]}},"required":["projectId","id","sha256","byteLength","filename","mediaType","audience"],"additionalProperties":false}}}}},"summary":"Confirm a stored-object upload","tags":["Stored Objects"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:update"]},"parameters":[{"in":"path","name":"storedObjectId","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}},"required":["projectId"],"additionalProperties":false}}}}}},"/api/v1/stored-objects/{storedObjectId}":{"get":{"operationId":"getStoredObject","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"object","properties":{"projectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"id":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"byteLength":{"type":"integer","minimum":0,"maximum":9007199254740991},"mediaType":{"type":"string","minLength":1,"maxLength":127,"pattern":"^[\\u0020-\\u007e]+$"},"filename":{},"mediaTypeVerified":{"type":"boolean"},"status":{"type":"string","enum":["pending","available","deleted","failed"]},"audiences":{"type":"array","items":{"type":"string","enum":["organization:view","project:view","team:view","analytics:view","cost:view","traces:view","scenarios:view","annotations:view","evaluations:view","datasets:view","triggers:view","workflows:view","experiments:view","prompts:view","secrets:view","playground:view","ops:view","auditLog:view","virtualKeys:view","gatewayBudgets:view","gatewayProviders:view","routingPolicies:view","gatewayGuardrails:view","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","governance:view","ingestionSources:view","anomalyRules:view","complianceExport:view","activityMonitor:view","aiTools:view","webhookEndpoints:view","gatewaySpend:view","langy:view","agentCache:view","governanceCost:view","sso:view"]}},"generation":{"type":"integer","minimum":0,"maximum":9007199254740991},"provenance":{"type":"object","properties":{"purpose":{"type":"string","minLength":1,"maxLength":127},"ownerKind":{"type":"string","minLength":1,"maxLength":127},"ownerId":{"type":"string","minLength":1,"maxLength":255}},"required":["purpose","ownerKind","ownerId"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"availableAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["projectId","id","sha256","byteLength","mediaType","filename","mediaTypeVerified","status","audiences","generation","provenance","createdAt"],"additionalProperties":false},"capability":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"methods":{"minItems":1,"type":"array","items":{"type":"string","enum":["GET","HEAD"]}},"audience":{"type":"string","enum":["organization:view","project:view","team:view","analytics:view","cost:view","traces:view","scenarios:view","annotations:view","evaluations:view","datasets:view","triggers:view","workflows:view","experiments:view","prompts:view","secrets:view","playground:view","ops:view","auditLog:view","virtualKeys:view","gatewayBudgets:view","gatewayProviders:view","routingPolicies:view","gatewayGuardrails:view","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","governance:view","ingestionSources:view","anomalyRules:view","complianceExport:view","activityMonitor:view","aiTools:view","webhookEndpoints:view","gatewaySpend:view","langy:view","agentCache:view","governanceCost:view","sso:view"]},"generation":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["url","expiresAt","methods","audience","generation"],"additionalProperties":false}},"required":["metadata","capability"],"additionalProperties":false}}}}},"summary":"Resolve a fresh stored-object capability","tags":["Stored Objects"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]},"parameters":[{"in":"path","name":"storedObjectId","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"required":true},{"in":"query","name":"projectId","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"required":true},{"in":"query","name":"audience","schema":{"type":"string","enum":["organization:view","project:view","team:view","analytics:view","cost:view","traces:view","scenarios:view","annotations:view","evaluations:view","datasets:view","triggers:view","workflows:view","experiments:view","prompts:view","secrets:view","playground:view","ops:view","auditLog:view","virtualKeys:view","gatewayBudgets:view","gatewayProviders:view","routingPolicies:view","gatewayGuardrails:view","gatewayLogs:view","gatewayUsage:view","gatewayCacheRules:view","governance:view","ingestionSources:view","anomalyRules:view","complianceExport:view","activityMonitor:view","aiTools:view","webhookEndpoints:view","gatewaySpend:view","langy:view","agentCache:view","governanceCost:view","sso:view"]},"required":true}]},"delete":{"operationId":"deleteStoredObject","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"generation":{"type":"integer","minimum":0,"maximum":9007199254740991},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","generation","deletedAt"],"additionalProperties":false}}}}},"summary":"Delete a stored object","tags":["Stored Objects"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:manage"]},"parameters":[{"in":"path","name":"storedObjectId","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":255}},"required":["projectId","idempotencyKey"],"additionalProperties":false}}}}}},"/api/v1/files/{projectId}/{storedObjectId}/{filename}":{"get":{"operationId":"readNamedProjectStoredObjectBytes","responses":{"200":{"description":"Success","content":{"*/*":{}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"storedObjectId","schema":{"type":"string"},"required":true},{"in":"path","name":"filename","schema":{"type":"string"},"required":true}]}},"/api/v1/files/{projectId}/{storedObjectId}":{"get":{"operationId":"readProjectStoredObjectBytes","responses":{"200":{"description":"Success","content":{"*/*":{}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"storedObjectId","schema":{"type":"string"},"required":true},{"in":"query","name":"filename","schema":{"type":"string"}}]}},"/api/v1/files/{storedObjectId}":{"get":{"operationId":"readStoredObjectBytes","responses":{"200":{"description":"Success","content":{"*/*":{}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"storedObjectId","schema":{"type":"string"},"required":true},{"in":"query","name":"filename","schema":{"type":"string"}}]}},"/api/v1/run-plans":{"get":{"operationId":"listRunPlans","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The run plan id."},"name":{"type":"string","description":"The run plan name. This is the plan's identity: a run started under this name joins this plan."},"slug":{"type":"string","description":"The plan's address in the platform. It is kept when the plan is renamed, so run history never moves."},"scope":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"test_suites"},"testSuiteIds":{"type":"array","items":{"type":"string"}}},"required":["mode","testSuiteIds"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"scenarios"}},"required":["mode"],"additionalProperties":false}],"description":"What the run plan covers: all (every active scenario), test_suites (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or scenarios (the scenarioIds sent with the configuration). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},"scenarioIds":{"type":"array","items":{"type":"string"},"description":"The scenarios the last run of this plan covered."},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false},"description":"What the plan runs against, in the order the results show. A target carrying runParameters runs with those values."},"repeatCount":{"type":"number","description":"How many times each scenario and target pairing runs."},"simulatorModel":{"description":"The model that plays the user, or null for the scenario or project default.","type":["string","null"]},"judgeModel":{"description":"The model that judges the run, or null for the scenario or project default.","type":["string","null"]},"labels":{"type":"array","items":{"type":"string"},"description":"The labels the plan carries."},"evaluators":{"description":"The plan's own evaluators. Absent on servers that predate evaluators on this family.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"],"additionalProperties":false}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"additionalProperties":false,"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}},"archivedAt":{"description":"When the plan was archived, or null while it is active.","type":["string","null"]},"createdAt":{"type":"string","description":"When the plan was created."},"updatedAt":{"type":"string","description":"When the plan was last written."},"platformUrl":{"type":"string","format":"uri","description":"Where to open this run plan in the LangWatch platform."}},"required":["id","name","slug","scope","scenarioIds","targets","repeatCount","simulatorModel","judgeModel","labels","archivedAt","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}}},"description":"List the project's run plans. Archived plans are left out unless includeArchived is set. Test suites are not run plans and are listed by the test suites family.","tags":["Run Plans"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"query","name":"includeArchived","schema":{"default":"false","type":"string"},"description":"Include archived run plans in the list. true, 1, yes for yes; false, 0, no or omitted for no."}]}},"/api/v1/run-plans/run":{"post":{"operationId":"runRunPlan","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"boolean","description":"True once the runs are queued."},"batchRunId":{"type":"string","description":"The id of this batch. Every run started here carries it."},"setId":{"type":"string","description":"The result set the batch is filed under in the platform."},"jobCount":{"type":"number","description":"How many runs were queued."},"skippedArchived":{"type":"object","properties":{"scenarios":{"type":"array","items":{"type":"string"},"description":"Scenarios left out because they are archived."},"targets":{"type":"array","items":{"type":"string"},"description":"Targets left out because they are archived."}},"required":["scenarios","targets"],"additionalProperties":false,"description":"What the run left out, and why."},"items":{"type":"array","items":{"type":"object","properties":{"scenarioRunId":{"type":"string","description":"The id of this single run."},"scenarioId":{"type":"string","description":"The scenario that was run."},"target":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false,"description":"What it was run against."},"name":{"description":"The scenario name, when known.","type":["string","null"]}},"required":["scenarioRunId","scenarioId","target","name"],"additionalProperties":false},"description":"Every run this call queued."},"runPlanId":{"type":"string","description":"The run plan this run was filed under."},"planName":{"type":"string","description":"The name that plan answers to."},"created":{"type":"boolean","description":"True when this run created the plan, false when it joined a plan already there."},"platformUrl":{"type":"string","format":"uri","description":"Where to watch this run in the LangWatch platform."}},"required":["scheduled","batchRunId","setId","jobCount","skippedArchived","items","runPlanId","planName","created","platformUrl"],"additionalProperties":false}}}}},"description":"Run a configuration under a name. The name identifies the run plan: send a name already in use and that plan's configuration is replaced with this one, send a new name and the plan is created, send no name and one is derived from what the run covers and what it runs against.","tags":["Run Plans"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"The run plan this run joins or creates. A run plan is identified by its name, so sending the same name again replaces that plan's configuration with this one. Leave it out and the name is derived from what the run covers and what it runs against. Up to 200 characters.","type":"string","minLength":1,"maxLength":200},"config":{"type":"object","properties":{"scope":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","const":"test_suites"},"testSuiteIds":{"type":"array","items":{"type":"string"}}},"required":["mode","testSuiteIds"]},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"]},{"type":"object","properties":{"mode":{"type":"string","const":"scenarios"}},"required":["mode"]}],"description":"What the run plan covers: all (every active scenario), test_suites (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or scenarios (the scenarioIds sent with the configuration). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false},"description":"The prompts, agents or workflows every scenario runs against. Every target runs every scenario, so naming more than one compares them in the same run."},"repeatCount":{"description":"How many times each scenario and target pairing runs. Between 1 and 5; defaults to 1.","type":"integer","minimum":1,"maximum":5},"simulatorModel":{"description":"The model that plays the user for every scenario in the run. Overrides each scenario's own choice. Leave it out for the scenario or project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"judgeModel":{"description":"The model that judges every scenario in the run. Overrides each scenario's own choice. Leave it out for the scenario or project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"scenarioIds":{"description":"The scenarios a test_suites or scenarios scope covers. Read by a scenarios scope alone; a scope that states a rule resolves its own list at run time.","type":"array","items":{"type":"string"}},"evaluators":{"description":"The plan's own evaluators, run beside the ones attached to the test suites its scenarios belong to. A plan evaluator reads the conversation and the trace, never a scenario field. Leave it out to keep what the plan already holds.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"]},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"]}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}}},"required":["scope","targets"],"description":"What this run covers and what it runs against. Written onto the run plan the name resolves."},"idempotencyKey":{"description":"Repeat the same key to make a retry join the batch the first call started instead of running everything again. Send the same request with it: the same key over a different configuration starts its own batch. Defaults to a new key per call.","type":"string"},"parameters":{"description":"Constant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name, and a target that names the same parameter in its runParameters overrides it for that target.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"note":{"description":"One short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.","type":"string","maxLength":200}},"required":["config"]}}}}}},"/api/v1/run-plans/{id}":{"get":{"operationId":"getRunPlan","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The run plan id."},"name":{"type":"string","description":"The run plan name. This is the plan's identity: a run started under this name joins this plan."},"slug":{"type":"string","description":"The plan's address in the platform. It is kept when the plan is renamed, so run history never moves."},"scope":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"test_suites"},"testSuiteIds":{"type":"array","items":{"type":"string"}}},"required":["mode","testSuiteIds"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"scenarios"}},"required":["mode"],"additionalProperties":false}],"description":"What the run plan covers: all (every active scenario), test_suites (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or scenarios (the scenarioIds sent with the configuration). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},"scenarioIds":{"type":"array","items":{"type":"string"},"description":"The scenarios the last run of this plan covered."},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false},"description":"What the plan runs against, in the order the results show. A target carrying runParameters runs with those values."},"repeatCount":{"type":"number","description":"How many times each scenario and target pairing runs."},"simulatorModel":{"description":"The model that plays the user, or null for the scenario or project default.","type":["string","null"]},"judgeModel":{"description":"The model that judges the run, or null for the scenario or project default.","type":["string","null"]},"labels":{"type":"array","items":{"type":"string"},"description":"The labels the plan carries."},"evaluators":{"description":"The plan's own evaluators. Absent on servers that predate evaluators on this family.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"],"additionalProperties":false}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"additionalProperties":false,"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}},"archivedAt":{"description":"When the plan was archived, or null while it is active.","type":["string","null"]},"createdAt":{"type":"string","description":"When the plan was created."},"updatedAt":{"type":"string","description":"When the plan was last written."},"platformUrl":{"type":"string","format":"uri","description":"Where to open this run plan in the LangWatch platform."}},"required":["id","name","slug","scope","scenarioIds","targets","repeatCount","simulatorModel","judgeModel","labels","archivedAt","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Read one run plan. An id the project does not hold, and a test suite id, both answer 404 suite_not_found.","tags":["Run Plans"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The run plan id."}]},"delete":{"operationId":"archiveRunPlan","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The run plan that was archived."},"archived":{"type":"boolean","const":true,"description":"Always true once the plan is archived."}},"required":["id","archived"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Archive a run plan. The plan stops being listed and its run history is kept. The scenarios it referenced are left where they are.","tags":["Run Plans"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The run plan id."}]}},"/api/v1/run-plans/{id}/run":{"post":{"operationId":"rerunRunPlan","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"boolean","description":"True once the runs are queued."},"batchRunId":{"type":"string","description":"The id of this batch. Every run started here carries it."},"setId":{"type":"string","description":"The result set the batch is filed under in the platform."},"jobCount":{"type":"number","description":"How many runs were queued."},"skippedArchived":{"type":"object","properties":{"scenarios":{"type":"array","items":{"type":"string"},"description":"Scenarios left out because they are archived."},"targets":{"type":"array","items":{"type":"string"},"description":"Targets left out because they are archived."}},"required":["scenarios","targets"],"additionalProperties":false,"description":"What the run left out, and why."},"items":{"type":"array","items":{"type":"object","properties":{"scenarioRunId":{"type":"string","description":"The id of this single run."},"scenarioId":{"type":"string","description":"The scenario that was run."},"target":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false,"description":"What it was run against."},"name":{"description":"The scenario name, when known.","type":["string","null"]}},"required":["scenarioRunId","scenarioId","target","name"],"additionalProperties":false},"description":"Every run this call queued."},"runPlanId":{"type":"string","description":"The run plan this run was filed under."},"planName":{"type":"string","description":"The name that plan answers to."},"created":{"type":"boolean","description":"True when this run created the plan, false when it joined a plan already there."},"platformUrl":{"type":"string","format":"uri","description":"Where to watch this run in the LangWatch platform."}},"required":["scheduled","batchRunId","setId","jobCount","skippedArchived","items","runPlanId","planName","created","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Run a run plan again, with the configuration it already holds. To run a different configuration, post it to /run under the plan's name.","summary":"Run a plan again","tags":["Run Plans"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotencyKey":{"description":"Repeat the same key to make a retry join the batch the first call started instead of running everything again. Send the same request with it: the same key over a different configuration starts its own batch. Defaults to a new key per call.","type":"string"},"parameters":{"description":"Constant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name, and a target that names the same parameter in its runParameters overrides it for that target.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"note":{"description":"One short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.","type":"string","maxLength":200}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The run plan id."}]}},"/api/v1/test-suites":{"get":{"operationId":"listTestSuites","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The test suite id."},"name":{"type":"string","description":"The test suite name."},"slug":{"type":"string","description":"The suite's address in the platform. It is kept when the suite is renamed."},"scenarioIds":{"type":"array","items":{"type":"string"},"description":"The scenarios filed in this suite, in the order it shows them."},"scenarioCount":{"type":"number","description":"How many scenarios are filed in it."},"fields":{"description":"The fields the test suite declares. Absent on servers that predate fields on this family.","maxItems":30,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter."},"type":{"type":"string","enum":["text","number","boolean"],"description":"The value type every scenario carries for this field."}},"required":["identifier","type"],"additionalProperties":false,"description":"One field the test suite declares beyond situation and criteria. Every scenario filed in the suite carries a value for it."}},"evaluators":{"description":"The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"],"additionalProperties":false}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"additionalProperties":false,"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}},"archivedAt":{"description":"When the suite was archived, or null while it is active.","type":["string","null"]},"createdAt":{"type":"string","description":"When the suite was created."},"updatedAt":{"type":"string","description":"When the suite was last written."},"platformUrl":{"type":"string","format":"uri","description":"Where to open this test suite in the LangWatch platform."}},"required":["id","name","slug","scenarioIds","scenarioCount","archivedAt","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}}},"description":"List the project's test suites. Archived suites are left out unless includeArchived is set. Run plans are not test suites and are listed by the run plans family.","tags":["Test Suites"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"query","name":"includeArchived","schema":{"default":"false","type":"string"},"description":"Include archived test suites in the list. true, 1, yes for yes; false, 0, no or omitted for no."}]},"post":{"operationId":"createTestSuite","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The test suite id."},"name":{"type":"string","description":"The test suite name."},"slug":{"type":"string","description":"The suite's address in the platform. It is kept when the suite is renamed."},"scenarioIds":{"type":"array","items":{"type":"string"},"description":"The scenarios filed in this suite, in the order it shows them."},"scenarioCount":{"type":"number","description":"How many scenarios are filed in it."},"fields":{"description":"The fields the test suite declares. Absent on servers that predate fields on this family.","maxItems":30,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter."},"type":{"type":"string","enum":["text","number","boolean"],"description":"The value type every scenario carries for this field."}},"required":["identifier","type"],"additionalProperties":false,"description":"One field the test suite declares beyond situation and criteria. Every scenario filed in the suite carries a value for it."}},"evaluators":{"description":"The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"],"additionalProperties":false}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"additionalProperties":false,"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}},"archivedAt":{"description":"When the suite was archived, or null while it is active.","type":["string","null"]},"createdAt":{"type":"string","description":"When the suite was created."},"updatedAt":{"type":"string","description":"When the suite was last written."},"platformUrl":{"type":"string","format":"uri","description":"Where to open this test suite in the LangWatch platform."}},"required":["id","name","slug","scenarioIds","scenarioCount","archivedAt","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Create a test suite. It starts empty: scenarios join it by being filed into it, and the targets a run goes against are sent with the run. It may declare fields and attach evaluators from the start.","tags":["Test Suites"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The test suite name, as it reads in the platform."},"fields":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter."},"type":{"type":"string","enum":["text","number","boolean"],"description":"The value type every scenario carries for this field."}},"required":["identifier","type"],"description":"One field the test suite declares beyond situation and criteria. Every scenario filed in the suite carries a value for it."},"description":"The fields the test suite declares, in the order the platform shows them. Up to 30. An identifier is lowercase letters, digits and underscores, starting with a letter; the type is text, number or boolean."},"evaluators":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"]},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"]}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."},"description":"The evaluators that run after every scenario run. Up to 20. A required evaluator that fails fails the scenario; a score-only evaluator reports and never gates."}},"required":["name"]}}}}}},"/api/v1/test-suites/{id}":{"get":{"operationId":"getTestSuite","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The test suite id."},"name":{"type":"string","description":"The test suite name."},"slug":{"type":"string","description":"The suite's address in the platform. It is kept when the suite is renamed."},"scenarioIds":{"type":"array","items":{"type":"string"},"description":"The scenarios filed in this suite, in the order it shows them."},"scenarioCount":{"type":"number","description":"How many scenarios are filed in it."},"fields":{"description":"The fields the test suite declares. Absent on servers that predate fields on this family.","maxItems":30,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter."},"type":{"type":"string","enum":["text","number","boolean"],"description":"The value type every scenario carries for this field."}},"required":["identifier","type"],"additionalProperties":false,"description":"One field the test suite declares beyond situation and criteria. Every scenario filed in the suite carries a value for it."}},"evaluators":{"description":"The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"],"additionalProperties":false}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"additionalProperties":false,"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}},"archivedAt":{"description":"When the suite was archived, or null while it is active.","type":["string","null"]},"createdAt":{"type":"string","description":"When the suite was created."},"updatedAt":{"type":"string","description":"When the suite was last written."},"platformUrl":{"type":"string","format":"uri","description":"Where to open this test suite in the LangWatch platform."},"scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The scenario id."},"name":{"type":"string","description":"The scenario name."}},"required":["id","name"],"additionalProperties":false},"description":"The active scenarios filed in this suite. An archived scenario is left out."}},"required":["id","name","slug","scenarioIds","scenarioCount","archivedAt","createdAt","updatedAt","platformUrl","scenarios"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Read one test suite with the scenarios filed in it, named. An id the project does not hold, and a run plan id, both answer 404 suite_not_found.","summary":"Read one test suite","tags":["Test Suites"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The test suite id."}]},"patch":{"operationId":"updateTestSuite","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The test suite id."},"name":{"type":"string","description":"The test suite name."},"slug":{"type":"string","description":"The suite's address in the platform. It is kept when the suite is renamed."},"scenarioIds":{"type":"array","items":{"type":"string"},"description":"The scenarios filed in this suite, in the order it shows them."},"scenarioCount":{"type":"number","description":"How many scenarios are filed in it."},"fields":{"description":"The fields the test suite declares. Absent on servers that predate fields on this family.","maxItems":30,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter."},"type":{"type":"string","enum":["text","number","boolean"],"description":"The value type every scenario carries for this field."}},"required":["identifier","type"],"additionalProperties":false,"description":"One field the test suite declares beyond situation and criteria. Every scenario filed in the suite carries a value for it."}},"evaluators":{"description":"The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"],"additionalProperties":false}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"additionalProperties":false,"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}},"archivedAt":{"description":"When the suite was archived, or null while it is active.","type":["string","null"]},"createdAt":{"type":"string","description":"When the suite was created."},"updatedAt":{"type":"string","description":"When the suite was last written."},"platformUrl":{"type":"string","format":"uri","description":"Where to open this test suite in the LangWatch platform."}},"required":["id","name","slug","scenarioIds","scenarioCount","archivedAt","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Edit a test suite: its name, the fields it declares, the evaluators attached to it. Send only what changes. The slug is kept on a rename, so links and run history stay where they are.","tags":["Test Suites"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"The new name. The slug is kept.","type":"string","minLength":1,"maxLength":200},"fields":{"description":"The full list of fields the suite declares. A field an attached evaluator still reads cannot be removed: answers 422 suite_field_in_use.","maxItems":30,"type":"array","items":{"type":"object","properties":{"identifier":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter."},"type":{"type":"string","enum":["text","number","boolean"],"description":"The value type every scenario carries for this field."}},"required":["identifier","type"],"description":"One field the test suite declares beyond situation and criteria. Every scenario filed in the suite carries a value for it."}},"evaluators":{"description":"The full list of evaluators attached to the suite. An evaluator the project does not hold answers 422 suite_evaluator_not_found; a mapping the run cannot read answers 422 suite_evaluator_mapping_invalid.","maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"description":"The attachment id. Stable across edits of the attachment."},"evaluatorId":{"type":"string","minLength":1,"description":"The id of the saved evaluator this attachment runs."},"required":{"type":"boolean","description":"Whether a failing result fails the scenario. A score-only evaluator reports and never gates."},"mappings":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","enum":["conversation","scenario","trace"]},"path":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["type","sourceId","path"]},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string","maxLength":65536}},"required":["type","value"]}],"description":"Where one evaluator input reads its value. A source mapping names conversation (first_user_message, last_agent_message, transcript, messages), scenario (situation, criteria, or fields followed by a field identifier) or trace (contexts, spans, or tool_calls followed by a tool name and input or output). A value mapping is a literal."},"description":"Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run."}},"required":["id","evaluatorId","required","mappings"],"description":"One evaluator that runs after every scenario run, with where each of its inputs reads from."}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The test suite id."}]},"delete":{"operationId":"archiveTestSuite","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The test suite that was archived."},"archived":{"type":"boolean","const":true,"description":"Always true once the suite is archived."}},"required":["id","archived"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Archive a test suite. The scenarios filed in it are archived with it, in one step, because the suite is where they live.","tags":["Test Suites"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The test suite id."}]}},"/api/v1/test-suites/{id}/run":{"post":{"operationId":"runTestSuite","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"boolean","description":"True once the runs are queued."},"batchRunId":{"type":"string","description":"The id of this batch. Every run started here carries it."},"setId":{"type":"string","description":"The result set the batch is filed under in the platform."},"jobCount":{"type":"number","description":"How many runs were queued."},"skippedArchived":{"type":"object","properties":{"scenarios":{"type":"array","items":{"type":"string"},"description":"Scenarios left out because they are archived."},"targets":{"type":"array","items":{"type":"string"},"description":"Targets left out because they are archived."}},"required":["scenarios","targets"],"additionalProperties":false,"description":"What the run left out, and why."},"items":{"type":"array","items":{"type":"object","properties":{"scenarioRunId":{"type":"string","description":"The id of this single run."},"scenarioId":{"type":"string","description":"The scenario that was run."},"target":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false,"description":"What it was run against."},"name":{"description":"The scenario name, when known.","type":["string","null"]}},"required":["scenarioRunId","scenarioId","target","name"],"additionalProperties":false},"description":"Every run this call queued."},"runPlanId":{"type":"string","description":"The run plan this run was filed under."},"planName":{"type":"string","description":"The name that plan answers to."},"created":{"type":"boolean","description":"True when this run created the plan, false when it joined a plan already there."},"platformUrl":{"type":"string","format":"uri","description":"Where to watch this run in the LangWatch platform."}},"required":["scheduled","batchRunId","setId","jobCount","skippedArchived","items","runPlanId","planName","created","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Run every scenario filed in the test suite against the targets sent with the request. The run is filed under a run plan named after the suite and its targets unless a name is sent. A request that names no target answers 422 suite_targets_required.","summary":"Run a test suite","tags":["Test Suites"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The test suite id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false},"description":"The prompts, agents or workflows the suite runs against. A test suite stores none of its own, so a run states them. Every target runs every scenario, so naming more than one compares them in the same run."},"name":{"description":"The run plan this run joins or creates. Leave it out and the name is derived from the suite name and the targets.","type":"string","minLength":1,"maxLength":200},"repeatCount":{"description":"How many times each scenario and target pairing runs. Between 1 and 5; defaults to 1.","type":"integer","minimum":1,"maximum":5},"simulatorModel":{"description":"The model that plays the user for every scenario in this run. Leave it out for the scenario or project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"judgeModel":{"description":"The model that judges every scenario in this run. Leave it out for the scenario or project default.","anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-zA-Z0-9_-]+(?:\\/[^\\s/]+)+$"},{"type":"null"}]},"idempotencyKey":{"description":"Repeat the same key to make a retry join the batch the first call started instead of running everything again. Send the same request with it: the same key over a different configuration starts its own batch. Defaults to a new key per call.","type":"string"},"parameters":{"description":"Constant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name, and a target that names the same parameter in its runParameters overrides it for that target.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"note":{"description":"One short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.","type":"string","maxLength":200}},"required":["targets"]}}}}}},"/api/v1/suites":{"get":{"operationId":"getApiSuites","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"description":"custom is a hand-assembled run plan; folder is a test suite that groups scenarios filed into it. Absent on servers that predate test suites.","type":"string","enum":["custom","folder"]},"description":{"type":["string","null"]},"scenarioIds":{"type":"array","items":{"type":"string"}},"scope":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"folders"},"folderIds":{"type":"array","items":{"type":"string"}}},"required":["mode","folderIds"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"cases"}},"required":["mode"],"additionalProperties":false}],"description":"What the run plan covers: all (every active scenario), folders (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or cases (the scenarioIds below). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},{"type":"null"}]},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"type":"number"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","description","scenarioIds","targets","repeatCount","labels","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}}},"description":"List all non-archived suites for the project. By default only custom run plans are returned; pass kind=folder for test suites. Deprecated: use /api/v1/run-plans and /api/v1/test-suites.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"deprecated":true,"parameters":[{"in":"query","name":"kind","schema":{"default":"custom","type":"string","enum":["custom","folder"]},"description":"Which kind of suite to list. Defaults to custom, so callers that predate test suites keep seeing exactly the run plans they always did."}]},"post":{"operationId":"postApiSuites","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"description":"custom is a hand-assembled run plan; folder is a test suite that groups scenarios filed into it. Absent on servers that predate test suites.","type":"string","enum":["custom","folder"]},"description":{"type":["string","null"]},"scenarioIds":{"type":"array","items":{"type":"string"}},"scope":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"folders"},"folderIds":{"type":"array","items":{"type":"string"}}},"required":["mode","folderIds"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"cases"}},"required":["mode"],"additionalProperties":false}],"description":"What the run plan covers: all (every active scenario), folders (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or cases (the scenarioIds below). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},{"type":"null"}]},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"type":"number"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","description","scenarioIds","targets","repeatCount","labels","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}},"description":"Create a new suite (run plan). Deprecated: use /api/v1/run-plans and /api/v1/test-suites.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"deprecated":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"kind":{"default":"custom","description":"custom (the default) is a run plan and needs scenarioIds and targets; folder is a test suite that starts empty and gets scenarios by filing them into it.","type":"string","enum":["custom","folder"]},"description":{"type":"string"},"scenarioIds":{"default":[],"type":"array","items":{"type":"string"}},"scope":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","const":"folders"},"folderIds":{"type":"array","items":{"type":"string"}}},"required":["mode","folderIds"]},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"]},{"type":"object","properties":{"mode":{"type":"string","const":"cases"}},"required":["mode"]}],"description":"What the run plan covers: all (every active scenario), folders (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or cases (the scenarioIds below). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"default":1,"type":"integer","minimum":1,"maximum":100},"labels":{"default":[],"type":"array","items":{"type":"string"}}},"required":["name"],"additionalProperties":false}}}}}},"/api/v1/suites/{id}":{"get":{"operationId":"getApiSuitesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"description":"custom is a hand-assembled run plan; folder is a test suite that groups scenarios filed into it. Absent on servers that predate test suites.","type":"string","enum":["custom","folder"]},"description":{"type":["string","null"]},"scenarioIds":{"type":"array","items":{"type":"string"}},"scope":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"folders"},"folderIds":{"type":"array","items":{"type":"string"}}},"required":["mode","folderIds"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"cases"}},"required":["mode"],"additionalProperties":false}],"description":"What the run plan covers: all (every active scenario), folders (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or cases (the scenarioIds below). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},{"type":"null"}]},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"type":"number"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","description","scenarioIds","targets","repeatCount","labels","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Get a suite (run plan) by its ID. Deprecated: use /api/v1/run-plans and /api/v1/test-suites.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:view"]},"deprecated":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiSuitesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"description":"custom is a hand-assembled run plan; folder is a test suite that groups scenarios filed into it. Absent on servers that predate test suites.","type":"string","enum":["custom","folder"]},"description":{"type":["string","null"]},"scenarioIds":{"type":"array","items":{"type":"string"}},"scope":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"folders"},"folderIds":{"type":"array","items":{"type":"string"}}},"required":["mode","folderIds"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"cases"}},"required":["mode"],"additionalProperties":false}],"description":"What the run plan covers: all (every active scenario), folders (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or cases (the scenarioIds below). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},{"type":"null"}]},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"type":"number"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","description","scenarioIds","targets","repeatCount","labels","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Update a suite (run plan). Deprecated: use /api/v1/run-plans and /api/v1/test-suites.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"scope":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","const":"folders"},"folderIds":{"type":"array","items":{"type":"string"}}},"required":["mode","folderIds"]},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"]},{"type":"object","properties":{"mode":{"type":"string","const":"cases"}},"required":["mode"]}],"description":"What the run plan covers: all (every active scenario), folders (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or cases (the scenarioIds below). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},"scenarioIds":{"minItems":1,"type":"array","items":{"type":"string"}},"targets":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"type":"integer","minimum":1,"maximum":100},"labels":{"type":"array","items":{"type":"string"}}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:update"]},"deprecated":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiSuitesById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","archived"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Archive (soft-delete) a suite. Archiving a test suite also archives every scenario filed in it, in one transaction. Deprecated: use /api/v1/run-plans and /api/v1/test-suites.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:manage"]},"deprecated":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/suites/{id}/duplicate":{"post":{"operationId":"postApiSuitesByIdDuplicate","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"description":"custom is a hand-assembled run plan; folder is a test suite that groups scenarios filed into it. Absent on servers that predate test suites.","type":"string","enum":["custom","folder"]},"description":{"type":["string","null"]},"scenarioIds":{"type":"array","items":{"type":"string"}},"scope":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"all"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"folders"},"folderIds":{"type":"array","items":{"type":"string"}}},"required":["mode","folderIds"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"labels"},"labels":{"type":"array","items":{"type":"string"}}},"required":["mode","labels"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"cases"}},"required":["mode"],"additionalProperties":false}],"description":"What the run plan covers: all (every active scenario), folders (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or cases (the scenarioIds below). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan."},{"type":"null"}]},"targets":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"type":"number"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","slug","description","scenarioIds","targets","repeatCount","labels","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Duplicate a suite (run plan). Deprecated: use /api/v1/run-plans and /api/v1/test-suites.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"deprecated":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/suites/{id}/run":{"post":{"operationId":"postApiSuitesByIdRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"boolean"},"batchRunId":{"type":"string"},"setId":{"type":"string"},"jobCount":{"type":"number"},"skippedArchived":{"type":"object","properties":{"scenarios":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"type":"string"}}},"required":["scenarios","targets"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"scenarioRunId":{"type":"string"},"scenarioId":{"type":"string"},"target":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false},"name":{"type":["string","null"]}},"required":["scenarioRunId","scenarioId","target","name"],"additionalProperties":false}},"planName":{"type":"string"},"created":{"type":"boolean"},"planSlug":{"type":"string"}},"required":["scheduled","batchRunId","setId","jobCount","skippedArchived","items","planSlug"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Trigger a suite run. Schedules scenario executions for all active scenarios x targets x repeatCount. When the id names a test suite, the targets, the repeat count and the models are read from the body. Deprecated: use /api/v1/run-plans and /api/v1/test-suites.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotencyKey":{"type":"string"},"name":{"description":"The run plan this run joins or creates. Used only when the id names a test suite; derived from the suite name and the targets when absent.","type":"string","minLength":1,"maxLength":200},"targets":{"description":"The prompts, agents or workflows the run goes against. Read only when the id names a test suite, which stores no target of its own; a run plan already holds its own and refuses these.","type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["prompt","http","code","workflow","connected","voice"]},"referenceId":{"type":"string","minLength":1},"scenarioMappings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"source"},"sourceId":{"type":"string","minLength":1},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"value"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]}},"runParameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"runSecretParameterNames":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["type","referenceId"],"additionalProperties":false}},"repeatCount":{"description":"How many times each scenario and target pairing runs, between 1 and 5. Used only when the id names a test suite.","type":"integer","minimum":1,"maximum":5},"simulatorModel":{"description":"The model that plays the user for every scenario in the run. Used only when the id names a test suite.","type":["string","null"]},"judgeModel":{"description":"The model that judges every scenario in the run. Used only when the id names a test suite.","type":["string","null"]},"parameters":{"description":"Constant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"}]}},"note":{"description":"One short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.","type":"string","maxLength":200}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["scenarios:create"]},"deprecated":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/trace/{id}":{"get":{"operationId":"getApiTraceId","responses":{"200":{"description":"Trace details with spans and evaluations","content":{"application/json":{"schema":{"type":"object","properties":{"trace_id":{"type":"string"},"project_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"privacy":{"type":"object","properties":{"droppedCategories":{"type":"array","items":{"type":"string"}}}},"timestamps":{"$ref":"#/components/schemas/Timestamps"},"input":{"$ref":"#/components/schemas/Input"},"output":{"$ref":"#/components/schemas/Output"},"contexts":{"type":"array","items":{"type":"object","properties":{"document_id":{"type":["string","null"]},"chunk_id":{"type":["string","null"]},"content":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]}},"required":["content"]}},"expected_output":{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]},"metrics":{"$ref":"#/components/schemas/Metrics"},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"indexing_md5s":{"type":"array","items":{"type":"string"}},"events":{"type":"array","items":{"type":"object","properties":{"event_id":{"type":"string"},"event_type":{"type":"string"},"project_id":{"type":"string"},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"event_details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"trace_id":{"type":"string"},"timestamps":{"type":"object","properties":{"started_at":{"type":"number"},"inserted_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["started_at","inserted_at","updated_at"]}},"required":["event_id","event_type","project_id","metrics","event_details","trace_id","timestamps"]}},"evaluations":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}},"spans":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"span_id":{"type":"string"},"parent_id":{"type":["string","null"]},"trace_id":{"type":"string"},"type":{"type":"string","const":"llm"},"name":{"type":["string","null"]},"input":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"output":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"timestamps":{"type":"object","properties":{"ignore_timestamps_on_write":{"type":["boolean","null"]},"started_at":{"type":"number"},"first_token_at":{"type":["number","null"]},"finished_at":{"type":"number"}},"required":["started_at","finished_at"]},"metrics":{"anyOf":[{"type":"object","properties":{"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"reasoning_tokens":{"type":["number","null"]},"cache_read_input_tokens":{"type":["number","null"]},"cache_creation_input_tokens":{"type":["number","null"]},"tokens_estimated":{"type":["boolean","null"]},"cost":{"type":["number","null"]}}},{"type":"null"}]},"params":{"anyOf":[{"allOf":[{"type":"object","properties":{"frequency_penalty":{"type":["number","null"]},"logit_bias":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"type":["number","null"]},"max_tokens":{"type":["number","null"]},"n":{"type":["number","null"]},"presence_penalty":{"type":["number","null"]},"seed":{"type":["number","null"]},"stop":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},{"type":"null"}]},"stream":{"type":["boolean","null"]},"temperature":{"type":["number","null"]},"top_p":{"type":["number","null"]},"tools":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"tool_choice":{"anyOf":[{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"string"}]},{"type":"null"}]},"parallel_tool_calls":{"type":["boolean","null"]},"functions":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"user":{"type":["string","null"]},"reasoning_effort":{"type":["string","null"]}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},{"type":"null"}]},"vendor":{"type":["string","null"]},"model":{"type":["string","null"]}},"required":["span_id","trace_id","type","timestamps"]},{"type":"object","properties":{"span_id":{"type":"string"},"parent_id":{"type":["string","null"]},"trace_id":{"type":"string"},"type":{"type":"string","const":"rag"},"name":{"type":["string","null"]},"input":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"output":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"timestamps":{"type":"object","properties":{"ignore_timestamps_on_write":{"type":["boolean","null"]},"started_at":{"type":"number"},"first_token_at":{"type":["number","null"]},"finished_at":{"type":"number"}},"required":["started_at","finished_at"]},"metrics":{"anyOf":[{"type":"object","properties":{"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"reasoning_tokens":{"type":["number","null"]},"cache_read_input_tokens":{"type":["number","null"]},"cache_creation_input_tokens":{"type":["number","null"]},"tokens_estimated":{"type":["boolean","null"]},"cost":{"type":["number","null"]}}},{"type":"null"}]},"params":{"anyOf":[{"allOf":[{"type":"object","properties":{"frequency_penalty":{"type":["number","null"]},"logit_bias":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"type":["number","null"]},"max_tokens":{"type":["number","null"]},"n":{"type":["number","null"]},"presence_penalty":{"type":["number","null"]},"seed":{"type":["number","null"]},"stop":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},{"type":"null"}]},"stream":{"type":["boolean","null"]},"temperature":{"type":["number","null"]},"top_p":{"type":["number","null"]},"tools":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"tool_choice":{"anyOf":[{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"string"}]},{"type":"null"}]},"parallel_tool_calls":{"type":["boolean","null"]},"functions":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"user":{"type":["string","null"]},"reasoning_effort":{"type":["string","null"]}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},{"type":"null"}]},"contexts":{"type":"array","items":{"type":"object","properties":{"document_id":{"type":["string","null"]},"chunk_id":{"type":["string","null"]},"content":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]}},"required":["content"]}}},"required":["span_id","trace_id","type","timestamps","contexts"]},{"type":"object","properties":{"span_id":{"type":"string"},"parent_id":{"type":["string","null"]},"trace_id":{"type":"string"},"type":{"anyOf":[{"type":"string","const":"span"},{"type":"string","const":"llm"},{"type":"string","const":"chain"},{"type":"string","const":"tool"},{"type":"string","const":"agent"},{"type":"string","const":"rag"},{"type":"string","const":"guardrail"},{"type":"string","const":"evaluation"},{"type":"string","const":"workflow"},{"type":"string","const":"component"},{"type":"string","const":"module"},{"type":"string","const":"server"},{"type":"string","const":"client"},{"type":"string","const":"producer"},{"type":"string","const":"consumer"},{"type":"string","const":"task"},{"type":"string","const":"unknown"}]},"name":{"type":["string","null"]},"input":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"output":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/SpanInputOutput"},{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"evaluation_result"},{"type":"string","const":"guardrail_result"}]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]}},"required":["type","value"]}]},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"has_error":{"type":"boolean","const":true},"message":{"type":"string"},"stacktrace":{"type":"array","items":{"type":"string"}}},"required":["has_error","message","stacktrace"]},{"type":"null"}]},"timestamps":{"type":"object","properties":{"ignore_timestamps_on_write":{"type":["boolean","null"]},"started_at":{"type":"number"},"first_token_at":{"type":["number","null"]},"finished_at":{"type":"number"}},"required":["started_at","finished_at"]},"metrics":{"anyOf":[{"type":"object","properties":{"prompt_tokens":{"type":["number","null"]},"completion_tokens":{"type":["number","null"]},"reasoning_tokens":{"type":["number","null"]},"cache_read_input_tokens":{"type":["number","null"]},"cache_creation_input_tokens":{"type":["number","null"]},"tokens_estimated":{"type":["boolean","null"]},"cost":{"type":["number","null"]}}},{"type":"null"}]},"params":{"anyOf":[{"allOf":[{"type":"object","properties":{"frequency_penalty":{"type":["number","null"]},"logit_bias":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"type":["number","null"]},"max_tokens":{"type":["number","null"]},"n":{"type":["number","null"]},"presence_penalty":{"type":["number","null"]},"seed":{"type":["number","null"]},"stop":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},{"type":"null"}]},"stream":{"type":["boolean","null"]},"temperature":{"type":["number","null"]},"top_p":{"type":["number","null"]},"tools":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"tool_choice":{"anyOf":[{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"string"}]},{"type":"null"}]},"parallel_tool_calls":{"type":["boolean","null"]},"functions":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"user":{"type":["string","null"]},"reasoning_effort":{"type":["string","null"]}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},{"type":"null"}]}},"required":["span_id","trace_id","type","timestamps"]}]}},"redacted_by_visibility_window":{"type":"boolean"},"ascii_tree":{"type":"string"}},"required":["trace_id","project_id","metadata","timestamps","spans","ascii_tree"]}}}}},"description":"Returns single trace details based on the ID supplied","tags":["Traces"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The trace ID."},{"in":"query","name":"format","schema":{"type":"string"},"description":"Output format: 'digest' (AI-readable) or 'json' (full raw data, default)"},{"in":"query","name":"llmMode","schema":{"type":"string"},"description":"Deprecated: use format=digest instead"}]}},"/api/trace/{id}/share":{"post":{"operationId":"postApiTraceIdShare","responses":{"200":{"description":"Public path created","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"path":{"type":"string"}},"required":["status","path"]}}}}},"description":"Returns a public path for a trace","tags":["Traces"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:share"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The trace ID."}]}},"/api/trace/{id}/unshare":{"post":{"operationId":"postApiTraceIdUnshare","responses":{"200":{"description":"Public path deleted","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"}},"required":["status"]}}}}},"description":"Deletes a public path for a trace","tags":["Traces"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:share"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true,"description":"The trace ID."}]}},"/api/trace/search":{"post":{"operationId":"postApiTraceSearch","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}}},"description":"Search for traces based on given criteria","summary":"Search traces","tags":["Traces"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]}}},"/api/v1/traces/search":{"post":{"operationId":"postApiTracesSearch","responses":{"200":{"description":"Matching traces with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"traces":{"type":"array","items":{}},"pagination":{"type":"object","properties":{"totalHits":{"type":"number"},"scrollId":{"type":"string"},"skipped":{"description":"Number of traces dropped from this page because they failed to serialize. Present only when non-zero, so a caller can tell that traces.length is below the page size for a reason other than reaching the end of the result set.","type":"number"},"updatedThrough":{"description":"Only when dateField is 'updated'. Epoch milliseconds: the upper bound this scroll actually covered, which is at or before the endDate you asked for. The scroll reads every trace as of the moment it started, so anything written after that instant belongs to the next pull. Start your next incremental pull from this value — resuming from the endDate you requested would step over the difference and lose those traces. The bound is inclusive on both sides, so a trace last written at exactly this millisecond arrives in this pull and again in the next one: pulls are at-least-once, and applying them idempotently is what keeps that from becoming a duplicate.","type":"number"}},"required":["totalHits"]},"schema":{"description":"Present only when 'select' is provided. Describes the resolved columns — the dotted path, its value type, and whether it belongs to a nested child collection — so callers can pre-allocate a typed reader.","type":"object","properties":{"from":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"type":{"type":"string"},"collection":{"type":"boolean"}},"required":["path","type","collection"]}}},"required":["from","columns"]}},"required":["traces","pagination"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Search traces for a project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"filters":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["topics.topics","topics.subtopics","metadata.user_id","metadata.thread_id","metadata.customer_id","metadata.labels","metadata.key","metadata.value","metadata.prompt_ids","traces.origin","traces.error","traces.name","spans.type","spans.model","evaluations.evaluator_id","evaluations.evaluator_id.guardrails_only","evaluations.evaluator_id.has_passed","evaluations.evaluator_id.has_score","evaluations.evaluator_id.has_label","evaluations.passed","evaluations.score","evaluations.state","evaluations.label","events.event_type","events.metrics.key","events.metrics.value","events.event_details.key","annotations.hasAnnotation"]},"additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"properties":{"topics.topics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"topics.subtopics":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.user_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.thread_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.customer_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"metadata.prompt_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.origin":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.error":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"traces.name":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"spans.model":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.guardrails_only":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.evaluator_id.has_label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.passed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.score":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.state":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"evaluations.label":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_type":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.metrics.value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"events.event_details.key":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]},"annotations.hasAnnotation":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}}]}}},"traceIds":{"type":"array","items":{"type":"string"}},"negateFilters":{"type":"boolean"},"excludeOrigins":{"type":"array","items":{"type":"string"}},"pageOffset":{"description":"Removed. Offset pagination is no longer supported and any value other than 0 is rejected. Page with the scrollId returned by the previous response instead. The field remains on the schema so that sending it produces an explanatory error rather than being silently discarded.","type":"number"},"pageSize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"groupBy":{"type":"string"},"sortBy":{"type":"string"},"sortDirection":{"type":"string"},"updatedAt":{"type":"number"},"scrollId":{"type":["string","null"]},"startDate":{"type":["number","string"]},"endDate":{"type":["number","string"]},"filter":{"description":"A trace filter string in the same language the Trace Explorer's search bar speaks — `status:error AND model:gpt-*`, `trace.attribute.langwatch.user_id:alice`, a quoted phrase for free text. Combined with `filters`/`query`/`traceIds` rather than replacing them, so every condition sent must hold. A malformed filter, or one naming a field the language does not have, is a 422 that names the `filter` field.","type":"string","maxLength":4000},"format":{"description":"Output format: 'digest' (AI-readable trace digest) or 'json' (full raw data)","type":"string","enum":["digest","json"]},"includeSpans":{"description":"When true, fetches full span data for each trace. Useful for bulk export. Default false.","type":"boolean"},"llmMode":{"type":"boolean"},"dateField":{"default":"occurred","description":"Which timestamp the startDate/endDate window filters on. 'occurred' (default) selects traces by when they happened. 'updated' selects traces by when they were last modified — use this for incremental ETL ('give me everything changed since my last pull'), since a trace can occur long before it gains a later evaluation or annotation.","type":"string","enum":["occurred","updated"]},"from":{"default":"traces","description":"Entity root to read from. Only 'traces' is supported today; defaults to 'traces' when omitted.","type":"string","enum":["traces"]},"select":{"description":"Flat list of dotted-path columns to project, e.g. ['trace_id','metadata.user_id','events.type','evaluations.score']. Paths group by root in the response: scalar fields stay top-level, 'metadata.*' nests under a metadata object, and 'events.*'/'annotations.*'/'evaluations.*' return as nested arrays (one row per trace). When present, the response gains a top-level 'schema' field describing the resolved columns. When omitted, the response is unchanged from the legacy shape.","minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["startDate","endDate"]}}}}}},"/api/v1/traces/facets":{"get":{"operationId":"getApiTracesFacets","responses":{"200":{"description":"Without `field`, every facet the project has with its top values and whether the payload is still being computed. With `field`, that field's values and counts plus the distinct total and whether more remain.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"facets":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"kind":{"type":"string","const":"categorical"},"label":{"type":"string"},"group":{"type":"string","enum":["trace","evaluation","span","metadata","prompt"]},"topValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"aggregates":{"type":"object","properties":{"passedCount":{"type":"number"},"failedCount":{"type":"number"},"erroredCount":{"type":"number"},"scoreMin":{"type":["number","null"]},"scoreMax":{"type":["number","null"]},"hasScore":{"type":"boolean"},"distinctScores":{"type":"number"},"hasLabel":{"type":"boolean"},"labelValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]}}},"required":["passedCount","failedCount","erroredCount","scoreMin","scoreMax","hasScore","distinctScores","hasLabel"]},"eventMetrics":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"values":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]}}},"required":["key","values"]}}},"required":["value","count"]}},"totalDistinct":{"type":"number"}},"required":["key","kind","label","group","topValues","totalDistinct"]},{"type":"object","properties":{"key":{"type":"string"},"kind":{"type":"string","const":"range"},"label":{"type":"string"},"group":{"type":"string","enum":["trace","evaluation","span","metadata","prompt"]},"min":{"type":"number"},"max":{"type":"number"},"discrete":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"value":{"type":"number"},"count":{"type":"number"}},"required":["value","count"]}},"distinctCount":{"type":"number"}},"required":["values","distinctCount"]}},"required":["key","kind","label","group","min","max"]},{"type":"object","properties":{"key":{"type":"string"},"kind":{"type":"string","const":"dynamic_keys"},"label":{"type":"string"},"group":{"type":"string","enum":["trace","evaluation","span","metadata","prompt"]},"topKeys":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]}},"totalDistinct":{"type":"number"}},"required":["key","kind","label","group","topKeys","totalDistinct"]}]}},"pending":{"type":"boolean","description":"True when the payload is still being computed and what you have is the last committed one, possibly empty. Call again shortly."}},"required":["facets","pending"]},{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]}},"total":{"type":"number","description":"Distinct values the field holds in the window, before paging."},"hasMore":{"type":"boolean"}},"required":["values","total","hasMore"]}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Discover what the trace filter fields hold in this project. Without `field`, every facet with its top values. With `field`, that field's values, paged.","summary":"Discover what the trace filter fields hold","tags":["Traces"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]},"parameters":[{"in":"query","name":"field","schema":{"type":"string","minLength":1,"maxLength":512}},{"in":"query","name":"prefix","schema":{"type":"string","maxLength":512}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"in":"query","name":"offset","schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}}]}},"/api/v1/traces/{traceId}/transcript":{"get":{"operationId":"getApiTracesByTraceIdTranscript","responses":{"200":{"description":"The transcript: ordered entries plus per-session totals and sub-agent tool counts","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"string"},"sessionId":{"type":["string","null"]},"entries":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}},"totals":{"type":"object","properties":{"modelCalls":{"type":"number"},"toolCalls":{"type":"number"},"tokens":{"type":"number"},"costUsd":{"type":"number"}},"required":["modelCalls","toolCalls","tokens","costUsd"]},"subAgents":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}},"required":["agent","sessionId","entries","totals","subAgents"],"additionalProperties":{}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Trace not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"409":{"description":"Ambiguous trace ID prefix — the prefix matches more than one trace","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"candidateTraceIds":{"type":"array","items":{"type":"string"}}},"required":["message","candidateTraceIds"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Derived coding-agent transcript for a trace: what the agent did, in order, with per-call token and cost economics. Empty entries for traces without coding-agent content.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]},"parameters":[{"in":"path","name":"traceId","schema":{"type":"string","minLength":1},"required":true,"description":"The trace ID — either the full 32-char ID or a unique prefix (≥ 8 chars). Prefix lookup is scoped to the authenticated project."}]}},"/api/v1/traces/{traceId}/metadata":{"patch":{"operationId":"patchApiTracesByTraceIdMetadata","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"traceId":{"type":"string"}},"required":["traceId"],"additionalProperties":false}}}}},"description":"Update metadata on a trace after creation. Inserts a synthetic span carrying the new attributes through the standard ingestion pipeline. New keys are added, existing keys are updated, missing keys are preserved. Labels replace entirely.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:update"]},"parameters":[{"in":"path","name":"traceId","schema":{"type":"string","minLength":1},"required":true,"description":"The trace ID — either the full 32-char ID or a unique prefix (≥ 8 chars). Prefix lookup is scoped to the authenticated project."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}},"required":["metadata"]}}}}}},"/api/v1/traces/{traceId}":{"get":{"operationId":"getApiTracesByTraceId","responses":{"200":{"description":"Trace detail with spans, evaluations, and ASCII tree","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Trace not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"409":{"description":"Ambiguous trace ID prefix — the prefix matches more than one trace","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"candidateTraceIds":{"type":"array","items":{"type":"string"}}},"required":["message","candidateTraceIds"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"description":"Get a single trace by ID.","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:view"]},"parameters":[{"in":"path","name":"traceId","schema":{"type":"string","minLength":1},"required":true,"description":"The trace ID — either the full 32-char ID or a unique prefix (≥ 8 chars). Prefix lookup is scoped to the authenticated project."},{"in":"query","name":"format","schema":{"type":"string"},"description":"Output format: 'digest' (AI-readable) or 'json' (full raw data, default)"},{"in":"query","name":"llmMode","schema":{"type":"string"},"description":"Deprecated: use format=digest instead"}]}},"/api/v1/events/track":{"post":{"operationId":"postApiEventsTrack","responses":{"200":{"description":"Event tracked","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Event tracked"}},"required":["message"]}}}},"400":{"description":"Invalid event payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Record a user event (e.g. thumbs up/down, selected text) attached to a trace. Predefined event types validate against their schemas; custom event types pass through `trackEventRESTParamsValidatorSchema`.","summary":"Record a user event","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event_type":{"type":"string"},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"trace_id":{"type":"string"},"event_id":{"type":"string"},"event_details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]}},"timestamp":{"type":"number"}},"required":["event_type","metrics","trace_id"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:create"]}}},"/api/track_event":{"post":{"operationId":"postApiTrackEvent","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Event tracked"}},"required":["message"],"additionalProperties":false}}}}},"description":"Record a customer event against a trace or thread. Identical to `POST /api/events/track`, which is the path to use in new integrations; this one stays for callers written against it. Supply `event_id` yourself to make the call idempotent.","summary":"Track an event (legacy path)","tags":["Events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event_type":{"type":"string"},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"trace_id":{"type":"string"},"event_id":{"type":"string"},"event_details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]}},"timestamp":{"type":"number"}},"required":["event_type","metrics","trace_id"]}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["traces:create"]}}},"/api/v1/me/project":{"get":{"operationId":"getApiMeProject","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"isPersonal":{"type":"boolean"}},"required":["id","name","slug","isPersonal"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}},"description":"Identity of the project the calling API key belongs to: id, name, slug and whether it is a personal workspace project. Lets a client (the CLI's identity notice, a widget) say which project a key targets without any further access.","tags":["Me"],"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["project:view"]}}},"/api/v1/user-avatar/{projectId}/{userAvatarId}":{"get":{"operationId":"readUserAvatarBytes","responses":{"200":{"description":"Success","content":{"image/*":{}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":[]},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"userAvatarId","schema":{"type":"string"},"required":true}]}},"/api/webhooks/v1/endpoints":{"post":{"operationId":"postApiWebhooksV1Endpoints","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"destination_kind":{"type":"string","const":"http"},"url":{"type":"string"},"sqs":{"type":"null"},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at","secret"],"additionalProperties":false},{"type":"object","properties":{"destination_kind":{"type":"string","const":"sqs"},"url":{"type":"null"},"sqs":{"type":"object","properties":{"queue_url":{"type":"string"},"region":{"type":"string"},"account_id":{"type":"string"},"queue_name":{"type":"string"},"credential_mode":{"type":"string","enum":["assume_role","static","ambient"]},"role_arn":{"type":["string","null"]},"external_id":{"type":["string","null"]},"access_key_id":{"type":["string","null"]}},"required":["queue_url","region","account_id","queue_name","credential_mode","role_arn","external_id","access_key_id"],"additionalProperties":false},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at","secret"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false}}}}},"description":"Create a webhook endpoint. Name one destination: `url` for `destination_kind: http`, `sqs` for `destination_kind: sqs`. Naming the other kind's field is a 400 that says which field does not belong, rather than a 201 that saved half the body. `destination_kind` may be omitted and then means `http`. The signing secret is returned ONCE in this response and never again; roll it to get a new one. Send `Idempotency-Key` to make a retry safe: a replay returns the original response including its `secret`, which is the only way to recover a secret whose response was lost in transit.","summary":"Create a webhook endpoint","tags":["Webhooks"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, 8 to 255 characters, that makes this create safe to retry. The first request to use a key runs normally and its response is stored for 24 hours. A later request with the same key and the same body is not executed again: it returns the stored response, marked with `X-Idempotent-Replay: true`. The same key with a different body is refused 409 `idempotency_error`, as is a retry sent while the original is still running. Only successful responses are stored, so a create that failed can simply be retried with the same key.","schema":{"type":"string","minLength":8,"maxLength":255}}],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destination_kind":{"type":"string","enum":["http","sqs"]},"url":{"type":"string","minLength":1,"maxLength":2000},"sqs":{"type":"object","properties":{"queue_url":{"type":"string","minLength":1,"maxLength":2000},"role_arn":{"type":"string","minLength":1,"maxLength":2048},"external_id":{"type":"string","minLength":1,"maxLength":1224},"access_key_id":{"type":"string","minLength":1,"maxLength":128},"secret_access_key":{"type":"string","minLength":1,"maxLength":256}},"required":["queue_url"]},"enabled_events":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled_events"]}}}}},"get":{"operationId":"getApiWebhooksV1Endpoints","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"destination_kind":{"type":"string","const":"http"},"url":{"type":"string"},"sqs":{"type":"null"},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at"],"additionalProperties":false},{"type":"object","properties":{"destination_kind":{"type":"string","const":"sqs"},"url":{"type":"null"},"sqs":{"type":"object","properties":{"queue_url":{"type":"string"},"region":{"type":"string"},"account_id":{"type":"string"},"queue_name":{"type":"string"},"credential_mode":{"type":"string","enum":["assume_role","static","ambient"]},"role_arn":{"type":["string","null"]},"external_id":{"type":["string","null"]},"access_key_id":{"type":["string","null"]}},"required":["queue_url","region","account_id","queue_name","credential_mode","role_arn","external_id","access_key_id"],"additionalProperties":false},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at"],"additionalProperties":false}]}}},"required":["data"],"additionalProperties":false}}}}},"description":"List the organization's webhook endpoints","summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:view"]}}},"/api/webhooks/v1/endpoints/{id}":{"get":{"operationId":"getApiWebhooksV1EndpointsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"destination_kind":{"type":"string","const":"http"},"url":{"type":"string"},"sqs":{"type":"null"},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at"],"additionalProperties":false},{"type":"object","properties":{"destination_kind":{"type":"string","const":"sqs"},"url":{"type":"null"},"sqs":{"type":"object","properties":{"queue_url":{"type":"string"},"region":{"type":"string"},"account_id":{"type":"string"},"queue_name":{"type":"string"},"credential_mode":{"type":"string","enum":["assume_role","static","ambient"]},"role_arn":{"type":["string","null"]},"external_id":{"type":["string","null"]},"access_key_id":{"type":["string","null"]}},"required":["queue_url","region","account_id","queue_name","credential_mode","role_arn","external_id","access_key_id"],"additionalProperties":false},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false}}}}},"description":"Get one webhook endpoint","summary":"Get a webhook endpoint","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiWebhooksV1EndpointsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"destination_kind":{"type":"string","const":"http"},"url":{"type":"string"},"sqs":{"type":"null"},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at"],"additionalProperties":false},{"type":"object","properties":{"destination_kind":{"type":"string","const":"sqs"},"url":{"type":"null"},"sqs":{"type":"object","properties":{"queue_url":{"type":"string"},"region":{"type":"string"},"account_id":{"type":"string"},"queue_name":{"type":"string"},"credential_mode":{"type":"string","enum":["assume_role","static","ambient"]},"role_arn":{"type":["string","null"]},"external_id":{"type":["string","null"]},"access_key_id":{"type":["string","null"]}},"required":["queue_url","region","account_id","queue_name","credential_mode","role_arn","external_id","access_key_id"],"additionalProperties":false},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false}}}}},"description":"Update a webhook endpoint's address, event subscriptions, or status (`active` re-enables, `disabled` pauses; re-enabling does not re-send the gap, replay covers it). `destination_kind` cannot change: batches already planned against the old transport are in flight, so a move means a new endpoint alongside this one until it has drained.","summary":"Update a webhook endpoint","tags":["Webhooks"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"destination_kind":{"type":"string","enum":["http","sqs"]},"url":{"type":"string","minLength":1,"maxLength":2000},"sqs":{"type":"object","properties":{"queue_url":{"type":"string","minLength":1,"maxLength":2000},"role_arn":{"type":"string","minLength":1,"maxLength":2048},"external_id":{"type":"string","minLength":1,"maxLength":1224},"access_key_id":{"type":"string","minLength":1,"maxLength":128},"secret_access_key":{"type":"string","minLength":1,"maxLength":256}}},"enabled_events":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"status":{"type":"string","enum":["active","disabled"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}}}},"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiWebhooksV1EndpointsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"archived":{"type":"boolean","const":true}},"required":["archived"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}}},"description":"Archive a webhook endpoint","summary":"Archive a webhook endpoint","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/webhooks/v1/endpoints/{id}/roll-secret":{"post":{"operationId":"postApiWebhooksV1EndpointsByIdRollSecret","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"destination_kind":{"type":"string","const":"http"},"url":{"type":"string"},"sqs":{"type":"null"},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at","secret"],"additionalProperties":false},{"type":"object","properties":{"destination_kind":{"type":"string","const":"sqs"},"url":{"type":"null"},"sqs":{"type":"object","properties":{"queue_url":{"type":"string"},"region":{"type":"string"},"account_id":{"type":"string"},"queue_name":{"type":"string"},"credential_mode":{"type":"string","enum":["assume_role","static","ambient"]},"role_arn":{"type":["string","null"]},"external_id":{"type":["string","null"]},"access_key_id":{"type":["string","null"]}},"required":["queue_url","region","account_id","queue_name","credential_mode","role_arn","external_id","access_key_id"],"additionalProperties":false},"id":{"type":"string"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"max_batch_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_batch_delay_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string"}},"required":["destination_kind","url","sqs","id","enabled_events","status","disabled_reason","disabled_at","failing_since","last_success_at","last_failure_at","max_batch_size","max_batch_delay_ms","max_in_flight","created_at","updated_at","secret"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false}}}}},"description":"Roll the endpoint's signing secret. The new secret is returned ONCE; deliveries sign with it immediately.","summary":"Roll an endpoint's signing secret","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/webhooks/v1/endpoints/{id}/test":{"post":{"operationId":"postApiWebhooksV1EndpointsByIdTest","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"delivered":{"type":"boolean"},"response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"response_body":{"type":"string"},"error":{"type":"string"}},"required":["delivered","response_status"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}}},"description":"Send a signed test event through the full delivery path. Contract: the route answers 200 whenever the test itself ran; data.delivered says whether the receiver accepted it, so clients must read the body, not the status code.","summary":"Send a test event to an endpoint","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/webhooks/v1/endpoints/{id}/deliveries":{"get":{"operationId":"getApiWebhooksV1EndpointsByIdDeliveries","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"dispatch_id":{"type":"string"},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"event_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outcome":{"type":"string","enum":["success","retryable","terminal","pending"]},"response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"latency_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"fired_at":{"type":"string"}},"required":["id","dispatch_id","attempt","event_count","outcome","response_status","latency_ms","error","fired_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass back as `cursor` for the next page. Null means the walk is exhausted; a full page does NOT mean there is more.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}}},"description":"The endpoint's delivery log: every attempt with the receiver's HTTP status, latency, and error","summary":"List an endpoint's delivery attempts","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"cursor","schema":{"type":"string","maxLength":500}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":200}}]}},"/api/webhooks/v1/endpoints/{id}/health":{"get":{"operationId":"getApiWebhooksV1EndpointsByIdHealth","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["active","disabled"]},"disabled_reason":{"type":["string","null"]},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"oldest_undelivered_age_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dlq_depth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sends_per_minute":{"type":"number"},"success_rate":{"type":["number","null"]},"p95_latency_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["status","disabled_reason","failing_since","last_success_at","last_failure_at","oldest_undelivered_age_ms","dlq_depth","sends_per_minute","success_rate","p95_latency_ms"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}}},"description":"Delivery health. The headline number is oldest_undelivered_age_ms, the feed's staleness: age of the oldest envelope still buffered or retrying. Also: DLQ depth, failure streak, sends/min, success rate, and p95 latency over the last hour.","summary":"Read an endpoint's delivery health","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/webhooks/v1/event-types":{"get":{"operationId":"getApiWebhooksV1EventTypes","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"family":{"type":"string"},"schema_version":{"type":"string"},"is_emitting":{"type":"boolean"},"description":{"type":"string"}},"required":["type","family","schema_version","is_emitting","description"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}},"description":"The event catalog: every subscribable type, grouped by family; types marked emitting=false are declared contracts whose producers have not shipped yet","summary":"List subscribable event types","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:view"]}}},"/api/webhooks/v1/events":{"get":{"operationId":"getApiWebhooksV1Events","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"created":{"type":"string"},"schema_version":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","created","schema_version","data"],"additionalProperties":false}},"next_cursor":{"description":"Pass back as `cursor` for the next page. Null means the walk is exhausted; a full page does NOT mean there is more.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}}},"description":"The organization's emitted-events log for the request families: cursor-paged, newest first, filter by type. `from` and `to` bound the created range in epoch milliseconds, are REQUIRED, and `from` must not be later than `to` - a range that ends before it starts is rejected rather than answered with an empty page. They are required because the log is a ranged read over the 13-month spend table and an unbounded walk sorts all of it on every page. Webhooks are push over this log, never the only copy of it. SERVES `gateway.request.completed` and `gateway.request.settled` ONLY. The governance families (`gateway.budget.*`, `gateway.virtual_key.*`) are delivered by webhook but are not retained in a queryable log, so they cannot be listed or replayed here; any other type returns an empty page rather than an error, so a client can probe forward-compatibly.","summary":"List emitted events","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:view"]},"parameters":[{"in":"query","name":"type","schema":{"type":"string","minLength":1,"maxLength":200}},{"in":"query","name":"from","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"required":true},{"in":"query","name":"to","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"required":true},{"in":"query","name":"cursor","schema":{"type":"string","maxLength":500}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":200}}]}},"/api/webhooks/v1/events/{id}":{"get":{"operationId":"getApiWebhooksV1EventsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"created":{"type":"string"},"schema_version":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","created","schema_version","data"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}}},"description":"One emitted event by its id, as it was delivered. Serves the same families the events log serves. A 404 covers every reason the log cannot answer -- never emitted, past the retention horizon, or belonging to another organization -- because telling those apart would confirm the existence of another tenant's request ids.","summary":"Get one emitted event","tags":["Webhooks"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["webhookEndpoints:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/gateway/v1/spend-events/replay":{"post":{"operationId":"postApiGatewayV1SpendEventsReplay","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"endpoint_id":{"type":"string"},"replay_id":{"type":"string"},"replayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"window":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false}},"required":["endpoint_id","replay_id","replayed","window"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"trace_id":{"type":"string"},"span_id":{"type":"string"},"trace":{"type":"object","properties":{"traceId":{"type":"string"},"spanId":{"type":"string"},"traceUrl":{"type":"string"},"logsUrl":{"type":"string"}}},"tips":{"type":"array","items":{"type":"string"}},"docs_url":{"type":"string"},"fault":{"type":"string","enum":["customer","platform","provider","presumed_platform"]},"reasons":{"type":"array","items":{}}},"required":["type","code","message","retryable"]}}}}},"description":"Re-delivers the window's spend envelopes to ONE endpoint through the normal delivery path (per-endpoint stream, retry ladder, delivery log), honoring the endpoint's event subscriptions. Envelope ids are UNCHANGED: your consumer's event-id dedup decides what a redelivery means. Mind your downstream billing system's finite dedup window (Metronome 34 days, Stripe 24h+): replaying older than that window can double-bill on your side, so prefer pull-and-diff for old ranges. The window is capped at 7 days and 10,000 envelopes per call; both caps are checked before any delivery is queued, so a refused replay ships nothing.","summary":"Replay spend events to an endpoint","tags":["Gateway Spend"],"security":[{"admin_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["organization_api_key"],"permissions":["gatewaySpend:manage"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"to":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"endpoint_id":{"type":"string","minLength":1,"maxLength":200}},"required":["from","to","endpoint_id"]}}}}}},"/api/v1/workflows":{"get":{"operationId":"getApiWorkflows","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":["string","null"]},"description":{"type":["string","null"]},"isEvaluator":{"type":"boolean"},"isComponent":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","icon","description","isEvaluator","isComponent","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}}}},"description":"List all non-archived workflows for the project","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:view"]}}},"/api/v1/workflows/{id}":{"get":{"operationId":"getApiWorkflowsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":["string","null"]},"description":{"type":["string","null"]},"isEvaluator":{"type":"boolean"},"isComponent":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","icon","description","isEvaluator","isComponent","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"The project holds no workflow with this id","content":{}}},"description":"Get a workflow by its ID","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:view"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchApiWorkflowsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":["string","null"]},"description":{"type":["string","null"]},"isEvaluator":{"type":"boolean"},"isComponent":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"platformUrl":{"type":"string","format":"uri"}},"required":["id","name","icon","description","isEvaluator","isComponent","createdAt","updatedAt","platformUrl"],"additionalProperties":false}}}},"404":{"description":"The project holds no workflow with this id","content":{}}},"description":"Update a workflow's metadata (name, icon, description)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"icon":{"type":"string"},"description":{"type":"string"}}}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:update"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"delete":{"operationId":"deleteApiWorkflowsById","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","archived"],"additionalProperties":false}}}},"404":{"description":"The project holds no workflow with this id","content":{}}},"description":"Archive (soft-delete) a workflow","security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:manage"]},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/optimization/{workflowId}/{versionId}":{"post":{"operationId":"postApiOptimizationByWorkflowIdByVersionId","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"status":{"type":"string","enum":["idle","waiting","running","success","error","skipped"]},"trace_id":{"type":"string"},"nodes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"total_cost":{"type":"number"},"duration_ms":{"type":"number"},"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"node_id":{"type":"string"},"traceback":{"type":"string"}},"required":["type","message"],"additionalProperties":false}},"required":["status"],"additionalProperties":false}}}}},"description":"Run one pinned version of an Optimization Studio workflow synchronously. Identical to `POST /api/workflows/{workflowId}/{versionId}/run`, which is the path to use in new integrations; this one stays for callers written against it. The body is the workflow's own input fields, named as its entry node names them.","summary":"Run a workflow version (legacy path)","tags":["Workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"The workflow's input fields, named as the workflow's entry node names them"}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:manage"]},"parameters":[{"in":"path","name":"workflowId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"versionId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/workflows/{workflowId}/run":{"post":{"operationId":"postApiWorkflowsByWorkflowIdRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"status":{"type":"string","enum":["idle","waiting","running","success","error","skipped"]},"trace_id":{"type":"string"},"nodes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"total_cost":{"type":"number"},"duration_ms":{"type":"number"},"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"node_id":{"type":"string"},"traceback":{"type":"string"}},"required":["type","message"],"additionalProperties":false}},"required":["status"],"additionalProperties":false}}}}},"description":"Run an Optimization Studio workflow synchronously and return its output. Runs the workflow's published version; address a specific version with the `{versionId}` form of this path. The body is the workflow's own input fields, named as its entry node names them.","summary":"Run a workflow","tags":["Workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"The workflow's input fields, named as the workflow's entry node names them"}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:manage"]},"parameters":[{"in":"path","name":"workflowId","schema":{"type":"string","minLength":1},"required":true}]}},"/api/v1/workflows/{workflowId}/{versionId}/run":{"post":{"operationId":"postApiWorkflowsByWorkflowIdByVersionIdRun","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"status":{"type":"string","enum":["idle","waiting","running","success","error","skipped"]},"trace_id":{"type":"string"},"nodes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"total_cost":{"type":"number"},"duration_ms":{"type":"number"},"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"node_id":{"type":"string"},"traceback":{"type":"string"}},"required":["type","message"],"additionalProperties":false}},"required":["status"],"additionalProperties":false}}}}},"description":"Run one pinned version of an Optimization Studio workflow synchronously and return its output. Use this when a caller must keep hitting the same version as the workflow is edited. The body is the workflow's own input fields, named as its entry node names them.","summary":"Run a specific workflow version","tags":["Workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"The workflow's input fields, named as the workflow's entry node names them"}}}},"security":[{"project_api_key":[]}],"x-access-policy":{"kind":"handlerManaged","credential":["project_api_key"],"permissions":["workflows:manage"]},"parameters":[{"in":"path","name":"workflowId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"versionId","schema":{"type":"string","minLength":1},"required":true}]}}}}