{"openapi":"3.1.0","info":{"title":"LIVOI Assistant API","description":"This is a custom API for a middleware providing a bridge between Chat-Software with LLMs!","version":"1.2.3","x-build-revision":"1c185f14be8527d3cc022a4e446e0662d5f6c78d"},"servers":[{"url":"https://api.livoi.de","description":"Production Environment"}],"paths":{"/api/v1/agent/core/create":{"post":{"tags":["v1/Agent/agents"],"summary":"Create agent","description":"Create a new agent.\n\nRequired permissions:\n- `agents.create`","operationId":"createAgent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreateAgentBody","$defs":{"ChatOutputSchema":{"additionalProperties":false,"properties":{"fields":{"items":{"$ref":"#/$defs/FieldSchema"},"title":"Fields","type":"array"}},"required":["fields"],"title":"ChatOutputSchema","type":"object"},"FieldSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"}},"required":["type","name"],"title":"FieldSchema","type":"object"},"JsonValue":{},"ValueSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]}},"required":["type"],"title":"ValueSchema","type":"object"}},"additionalProperties":false,"example":{"agent_image":"agent-profile.png","datev_profile_id":"7442678451937742086","default_chat_summary":true,"default_chat_title":true,"default_embedding":true,"default_file_title_tags":true,"default_transcribe":true,"description":"Answers customer support questions and escalates billing issues.","llm_api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","llm_custom_url":"https://api.openai.com/v1","model":"gpt-6-luna","name":"Support Assistant","output_schema":"{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}","whatsapp_business_phone_number_id":"7442551216804781021"},"properties":{"default_file_title_tags":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether uploaded files should default to title tag extraction.","examples":[true,false,null],"title":"Default File Title Tags"},"default_chat_summary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether chats should default to summary generation.","examples":[true,false,null],"title":"Default Chat Summary"},"default_chat_title":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether chats should default to generated titles.","examples":[true,false,null],"title":"Default Chat Title"},"default_transcribe":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether uploaded audio should default to transcription.","examples":[true,false,null],"title":"Default Transcribe"},"default_embedding":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether uploaded content should default to embedding generation.","examples":[true,false,null],"title":"Default Embedding"},"output_schema":{"contentMediaType":"application/json","contentSchema":{"anyOf":[{"$ref":"#/$defs/ChatOutputSchema"},{"type":"null"}]},"description":"Output field definitions as JSON text. Omit or send null for text answers.","examples":["{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}"],"title":"Output Schema","type":"string"},"name":{"description":"Agent display name.","examples":["Support Assistant","Invoice Assistant"],"minLength":1,"title":"Name","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional short description of what the agent helps with.","examples":["Answers customer support questions and escalates billing issues."],"title":"Description"},"llm_api_key":{"description":"OpenAI API key used by the agent.","examples":["sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","sk_prod_7443128874215608479_pIZrSYz:yyyyyyyyy","sk_wb_7443128874215608651_ySpzIRZ:zzzzzzzzz","sk_test_7443128874215608790_RiZsYPz:aaaaaaaaa"],"minLength":1,"title":"Llm Api Key","type":"string"},"llm_custom_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional custom OpenAI-compatible base URL.","examples":["https://api.openai.com/v1"],"title":"Llm Custom Url"},"model":{"default":"gpt-6-luna","description":"Model used by the agent.","examples":["gpt-6-luna"],"minLength":1,"title":"Model","type":"string"},"whatsapp_business_phone_number_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional WhatsApp business phone number ID to assign to the agent.","examples":[7442551216804781021],"title":"Whatsapp Business Phone Number Id"},"agent_image":{"title":"Agent Image","description":"Optional uploaded profile image for the agent.","examples":["agent-profile.png",null],"type":"string","format":"binary"},"agent_image_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Existing agent image ID to reuse.","examples":[null,7443001845129083411],"title":"Agent Image Id"},"datev_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional DATEV profile ID to assign.","examples":[7442678451937742086],"title":"Datev Profile Id"}},"required":["name","llm_api_key"],"title":"CreateAgentBody","type":"object"},"examples":{"example_1":{"value":{"default_file_title_tags":true,"default_chat_summary":true,"default_chat_title":true,"default_transcribe":true,"default_embedding":true,"output_schema":"{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}","name":"Support Assistant","description":"Answers customer support questions and escalates billing issues.","llm_api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","llm_custom_url":"https://api.openai.com/v1","model":"gpt-6-luna","whatsapp_business_phone_number_id":"7442551216804781021","agent_image":"agent-profile.png","datev_profile_id":"7442678451937742086"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentResponse"},"examples":{"example_1":{"value":{"agent_id":"7442550215703679004","agent_image_id":"7443001845129083411"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"create","key":"agents.create"}]}},"/api/v1/agent/core/{agent_id}/{whatsapp_business_phone_number_id}/assign":{"post":{"tags":["v1/Agent/agents"],"summary":"Assign agent to phone number","description":"Assign an agent to a WhatsApp business phone number.\n\nRequired permissions:\n- `agents.update`","operationId":"assignAgentPhone","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPhoneResponse"},"examples":{"example_1":{"value":{"assigned_agent_id":"7442550215703679004","assigned_whatsapp_business_phone_number_id":"7442551216804781021","unassigned_agent_id":"7442550215703679137","unassigned_whatsapp_business_phone_number_id":"7442551216804781198"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/core/{agent_id}/{whatsapp_business_phone_number_id}/unassign":{"post":{"tags":["v1/Agent/agents"],"summary":"Unassign agent from phone number","description":"Unassign an agent from a WhatsApp business phone number.\n\nRequired permissions:\n- `agents.update`","operationId":"unassignAgentPhone","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPhoneResponse"},"examples":{"example_1":{"value":{"assigned_agent_id":"7442550215703679004","assigned_whatsapp_business_phone_number_id":"7442551216804781021","unassigned_agent_id":"7442550215703679137","unassigned_whatsapp_business_phone_number_id":"7442551216804781198"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/core/{agent_id}/datev-profile/{datev_profile_id}/assign":{"post":{"tags":["v1/Agent/agents"],"summary":"Assign agent to DATEV profile","description":"Assign an agent to a DATEV profile.\n\nRequired permissions:\n- `agents.update`","operationId":"assignAgentDatevProfile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDatevProfileResponse"},"examples":{"example_1":{"value":{"assigned_agent_id":"7442550215703679004","assigned_datev_profile_id":"7442678451937742086","unassigned_agent_id":"7442550215703679137","unassigned_datev_profile_id":"7442678451937742214"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/core/{agent_id}/datev-profile/{datev_profile_id}/unassign":{"post":{"tags":["v1/Agent/agents"],"summary":"Unassign agent from DATEV profile","description":"Unassign an agent from a DATEV profile.\n\nRequired permissions:\n- `agents.update`","operationId":"unassignAgentDatevProfile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDatevProfileResponse"},"examples":{"example_1":{"value":{"assigned_agent_id":"7442550215703679004","assigned_datev_profile_id":"7442678451937742086","unassigned_agent_id":"7442550215703679137","unassigned_datev_profile_id":"7442678451937742214"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/core/{agent_id}/update":{"patch":{"tags":["v1/Agent/agents"],"summary":"Update agent","description":"Update an agent.\n\nRequired permissions:\n- `agents.update`","operationId":"updateAgent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UpdateAgentBody","$defs":{"ChatOutputSchema":{"additionalProperties":false,"properties":{"fields":{"items":{"$ref":"#/$defs/FieldSchema"},"title":"Fields","type":"array"}},"required":["fields"],"title":"ChatOutputSchema","type":"object"},"FieldSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"}},"required":["type","name"],"title":"FieldSchema","type":"object"},"JsonValue":{},"ValueSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]}},"required":["type"],"title":"ValueSchema","type":"object"}},"additionalProperties":false,"example":{"agent_image":"agent-profile-updated.png","datev_profile_id":"7442678451937742214","default_chat_summary":true,"default_chat_title":true,"default_embedding":true,"default_file_title_tags":true,"default_transcribe":true,"description":"Prepares invoice drafts and answers DATEV workflow questions.","llm_api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","llm_custom_url":"https://api.openai.com/v1","model":"gpt-6-luna","name":"Invoice Assistant","output_schema":"{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}"},"properties":{"default_file_title_tags":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether uploaded files should default to title tag extraction.","examples":[true,false,null],"title":"Default File Title Tags"},"default_chat_summary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether chats should default to summary generation.","examples":[true,false,null],"title":"Default Chat Summary"},"default_chat_title":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether chats should default to generated titles.","examples":[true,false,null],"title":"Default Chat Title"},"default_transcribe":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether uploaded audio should default to transcription.","examples":[true,false,null],"title":"Default Transcribe"},"default_embedding":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether uploaded content should default to embedding generation.","examples":[true,false,null],"title":"Default Embedding"},"output_schema":{"contentMediaType":"application/json","contentSchema":{"anyOf":[{"$ref":"#/$defs/ChatOutputSchema"},{"type":"null"}]},"description":"Output field definitions as JSON text. Omit to preserve; send null to restore text answers.","examples":["{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}","null"],"title":"Output Schema","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Updated agent display name.","examples":["Invoice Assistant"],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Updated short description of what the agent helps with.","examples":["Prepares invoice drafts and answers DATEV workflow questions."],"title":"Description"},"llm_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Updated OpenAI API key used by the agent.","examples":["sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","sk_prod_7443128874215608479_pIZrSYz:yyyyyyyyy","sk_wb_7443128874215608651_ySpzIRZ:zzzzzzzzz","sk_test_7443128874215608790_RiZsYPz:aaaaaaaaa"],"title":"Llm Api Key"},"llm_custom_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Updated OpenAI-compatible base URL.","examples":["https://api.openai.com/v1"],"title":"Llm Custom Url"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Updated model name.","examples":["gpt-6-luna"],"title":"Model"},"agent_image":{"title":"Agent Image","description":"Updated uploaded profile image for the agent.","examples":["agent-profile-updated.png",null],"type":"string","format":"binary"},"agent_image_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Updated existing agent image ID to reuse.","examples":[null,7443001845129083597],"title":"Agent Image Id"},"datev_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Updated DATEV profile ID assignment.","examples":[7442678451937742214],"title":"Datev Profile Id"}},"title":"UpdateAgentBody","type":"object"},"examples":{"example_1":{"value":{"default_file_title_tags":true,"default_chat_summary":true,"default_chat_title":true,"default_transcribe":true,"default_embedding":true,"output_schema":"{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}","name":"Invoice Assistant","description":"Prepares invoice drafts and answers DATEV workflow questions.","llm_api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","llm_custom_url":"https://api.openai.com/v1","model":"gpt-6-luna","agent_image":"agent-profile-updated.png","datev_profile_id":"7442678451937742214"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentResponse"},"examples":{"example_1":{"value":{}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/core/profile/image/delete":{"delete":{"tags":["v1/Agent/agents"],"summary":"Delete agent profile images","description":"Delete agent profile images.\n\nRequired permissions:\n- `agents.update`","operationId":"deleteAgentProfileImages","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentProfileImagesBody","example":{"agent_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"agent_image_ids":["7443001845129083597","7443001845129083742","7443001845129083880","7443001845129083411"]},"properties":{"agent_ids":{"anyOf":[{"items":{"type":"integer"},"minItems":1,"type":"array","uniqueItems":true},{"type":"null"}],"description":"Agent IDs whose profile images should be removed.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"title":"Agent Ids"},"agent_image_ids":{"description":"Agent image IDs to delete.","examples":[[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]],"items":{"type":"integer"},"minItems":1,"title":"Agent Image Ids","type":"array","uniqueItems":true}},"required":["agent_image_ids"],"title":"DeleteAgentProfileImagesBody","type":"object"},"examples":{"example_1":{"value":{"agent_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"agent_image_ids":["7443001845129083597","7443001845129083742","7443001845129083880","7443001845129083411"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentProfileImagesResponse"},"examples":{"example_1":{"value":{"status":"Deleted 2 agent profile images.","updated_agent_ids":["7442550215703679004","7442550215703679137"],"deleted_image_ids":["7443001845129083411","7443001845129083597"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_profile_images","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/core/{agent_id}/delete":{"delete":{"tags":["v1/Agent/agents"],"summary":"Delete agent","description":"Delete an agent.\n\nRequired permissions:\n- `agents.delete`","operationId":"deleteAgent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentResponse"},"examples":{"example_1":{"value":{"status":"Agent deleted successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"agent","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"delete","key":"agents.delete"}]}},"/api/v1/agent/core/whitelist/{agent_id}/update":{"patch":{"tags":["v1/Agent/whitelist"],"summary":"Add agent whitelist entries","description":"Add users to an agent whitelist.\n\nRequired permissions:\n- `agents.update`\n- `agent_whitelist_entries.read`\n- `agent_whitelist_entries.create`","operationId":"addAgentWhitelist","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddAgentWhitelistBody","$defs":{"WhitelistMatchType":{"enum":["user_id","email","email_domain","phone_number","microsoft","clerk","better_auth","whatsapp"],"title":"WhitelistMatchType","type":"string"}},"example":{"entries":{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]}},"properties":{"entries":{"additionalProperties":{"items":{"type":"string"},"type":"array","uniqueItems":true},"description":"Whitelist entries keyed by match type, for example user_id, email, email_domain, phone_number, clerk, whatsapp, microsoft, or better_auth.","examples":[{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]}],"propertyNames":{"$ref":"#/$defs/WhitelistMatchType"},"title":"Entries","type":"object"}},"title":"AddAgentWhitelistBody","type":"object"},"examples":{"example_1":{"value":{"entries":{"user_id":["7442551216804781021"],"email_domain":["example.com"],"phone_number":["+491701234567"],"clerk":["user_123"],"whatsapp":["DE.7349586264223476"]}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddAgentWhitelistResponse"},"examples":{"example_1":{"value":{"added":"Added 2 whitelist entries.","already_present":"1 whitelist entry already existed."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_whitelist","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"},{"model":"agent_whitelist_entries","action":"read","key":"agent_whitelist_entries.read"},{"model":"agent_whitelist_entries","action":"create","key":"agent_whitelist_entries.create"}]}},"/api/v1/agent/core/whitelist/{agent_id}/delete":{"delete":{"tags":["v1/Agent/whitelist"],"summary":"Remove agent whitelist entries","description":"Remove entries from an agent whitelist.\n\nRequired permissions:\n- `agents.update`\n- `agent_whitelist_entries.read`\n- `agent_whitelist_entries.delete`","operationId":"removeAgentWhitelist","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveAgentWhitelistBody","$defs":{"WhitelistMatchType":{"enum":["user_id","email","email_domain","phone_number","microsoft","clerk","better_auth","whatsapp"],"title":"WhitelistMatchType","type":"string"}},"example":{"entries":{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]},"entry_ids":["7442678451937742389","7442678451937742086","7442678451937742214","7442678451937742520"]},"properties":{"entries":{"additionalProperties":{"items":{"type":"string"},"type":"array","uniqueItems":true},"description":"Whitelist entries keyed by match type, for example user_id, email, email_domain, phone_number, clerk, whatsapp, microsoft, or better_auth.","examples":[{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]}],"propertyNames":{"$ref":"#/$defs/WhitelistMatchType"},"title":"Entries","type":"object"},"entry_ids":{"description":"Whitelist entry IDs to remove from the agent whitelist.","examples":[[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]],"items":{"type":"integer"},"title":"Entry Ids","type":"array","uniqueItems":true}},"title":"RemoveAgentWhitelistBody","type":"object"},"examples":{"example_1":{"value":{"entries":{"user_id":["7442551216804781021"],"email_domain":["example.com"],"phone_number":["+491701234567"],"clerk":["user_123"],"whatsapp":["DE.7349586264223476"]},"entry_ids":["7442678451937742389","7442678451937742086","7442678451937742214","7442678451937742520"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveAgentWhitelistResponse"},"examples":{"example_1":{"value":{"removed":"Removed 2 whitelist entries.","not_present":"1 whitelist entry was not present.","not_found":{"123456789012345678":"whitelist entry not found"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_whitelist","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"},{"model":"agent_whitelist_entries","action":"read","key":"agent_whitelist_entries.read"},{"model":"agent_whitelist_entries","action":"delete","key":"agent_whitelist_entries.delete"}]}},"/api/v1/agent/core/instruction/{agent_id}/update":{"patch":{"tags":["v1/Agent/agents"],"summary":"Update agent instruction","description":"Update the instruction prompt for an agent.\n\nRequired permissions:\n- `agents.update`","operationId":"updateAgentInstruction","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentInstructionBody","example":{"instruction":"Answer in German, stay concise, and ask for missing invoice details before creating a draft."},"properties":{"instruction":{"description":"System instruction text used by the agent.","examples":["Answer in German, stay concise, and ask for missing invoice details before creating a draft."],"title":"Instruction","type":"string"}},"required":["instruction"],"title":"UpdateAgentInstructionBody","type":"object"},"examples":{"example_1":{"value":{"instruction":"Answer in German, stay concise, and ask for missing invoice details before creating a draft."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentInstructionResponse"},"examples":{"example_1":{"value":{"message":"Agent instruction updated successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_instruction","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/core/model-settings/{agent_id}/update":{"patch":{"tags":["v1/Agent/agents"],"summary":"Update agent model settings","description":"Update the agent's model settings.\n\nRequired permissions:\n- `agents.update`","operationId":"updateAgentModelSettings","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentModelSettingsBody","$defs":{"JsonObject":{"additionalProperties":{"$ref":"#/$defs/JsonValue"},"type":"object"},"JsonValue":{}},"additionalProperties":false,"example":{"model_settings":{"openai_reasoning_effort":"low","openai_text_verbosity":"low"}},"properties":{"model_settings":{"anyOf":[{"$ref":"#/$defs/JsonObject"},{"type":"null"}],"description":"Model settings for the agent. Use null to clear all model settings. extra_body, openai_background, openai_conversation_id and openai_previous_response_id are rejected. Chat agent runs always send store=false to OpenAI, even if openai_store is true.","examples":[{"openai_reasoning_effort":"low","openai_text_verbosity":"low"},null]}},"required":["model_settings"],"title":"UpdateAgentModelSettingsBody","type":"object"},"examples":{"example_1":{"value":{"model_settings":{"openai_reasoning_effort":"low","openai_text_verbosity":"low"}}}}}}},"responses":{"204":{"description":"Successful Response"},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_model_settings","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/tools/{agent_id}/seed":{"post":{"tags":["v1/Agent/tools"],"summary":"Seed agent tools","description":"Seed built-in tools for an agent.\n\nRequired permissions:\n- `agent_tools.create`","operationId":"seedAgentTools","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedAgentToolsBody","example":{"function_names":["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]},"properties":{"function_names":{"description":"Built-in tool function names to seed for the agent.","examples":[["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]],"items":{"type":"string"},"title":"Function Names","type":"array"}},"required":["function_names"],"title":"SeedAgentToolsBody","type":"object"},"examples":{"example_1":{"value":{"function_names":["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedAgentToolsResponse"},"examples":{"example_1":{"value":{"seeded_count_message":"Seeded 4 tools.","auto_assigned_datev_profile_id":"7442551216804781198"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"create","key":"agent_tools.create"}]}},"/api/v1/agent/tools/{agent_id}/custom/create":{"post":{"tags":["v1/Agent/tools"],"summary":"Create custom agent tools","description":"Create custom tools for an agent.\n\nRequired permissions:\n- `agent_tools.create`","operationId":"createCustomToolForAgent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomToolForAgentBody","$defs":{"AgentCustomToolBase":{"example":{"api_key":"sk_tool_live_123456","defer_loading":true,"max_retries":1,"request_config":"<request_config>","tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"},"properties":{"tool_name":{"description":"Tool name.","examples":["lookup_customer"],"maxLength":128,"minLength":1,"title":"Tool Name","type":"string"},"tool_description":{"description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."],"minLength":1,"title":"Tool Description","type":"string"},"request_config":{"$ref":"#/$defs/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/$defs/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"description":"Max retries.","examples":[1],"title":"Max Retries"},"read_only":{"default":false,"description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","title":"Read Only","type":"boolean"},"defer_loading":{"default":false,"description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","examples":[true],"title":"Defer Loading","type":"boolean"},"input_schema":{"$ref":"#/$defs/CustomToolInputSchema","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Optional API key used when calling the custom tool.","examples":["sk_tool_live_123456"],"title":"Api Key"}},"required":["tool_name","tool_description","request_config"],"title":"AgentCustomToolBase","type":"object"},"CustomToolConditionPath":{"items":{"anyOf":[{"type":"string"},{"minimum":0,"type":"integer"}]},"maxItems":16,"minItems":1,"type":"array"},"CustomToolEmptyListCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"absent_or_empty_list","title":"Operator","type":"string"}},"required":["path","operator"],"title":"CustomToolEmptyListCondition","type":"object"},"CustomToolEqualsCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"equals","title":"Operator","type":"string"},"value":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value"}},"required":["path","operator","value"],"title":"CustomToolEqualsCondition","type":"object"},"CustomToolInputSchema":{"additionalProperties":false,"properties":{"parameters":{"items":{"$ref":"#/$defs/CustomToolParameter"},"title":"Parameters","type":"array"}},"title":"CustomToolInputSchema","type":"object"},"CustomToolParameter":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"},"location":{"enum":["path","query","body"],"title":"Location","type":"string"}},"required":["type","name","location"],"title":"CustomToolParameter","type":"object"},"CustomToolRequestConfig":{"additionalProperties":false,"properties":{"api_url":{"minLength":1,"title":"Api Url","type":"string"},"http_method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Http Method","type":"string"},"api_key_location":{"default":"header","enum":["header","query"],"title":"Api Key Location","type":"string"},"auth_param":{"default":"Authorization","minLength":1,"title":"Auth Param","type":"string"},"api_key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"Bearer","title":"Api Key Prefix"},"additional_headers":{"additionalProperties":{"type":"string"},"title":"Additional Headers","type":"object"},"unwrap_single_body_parameter":{"default":false,"title":"Unwrap Single Body Parameter","type":"boolean"},"timeout_seconds":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"title":"Timeout Seconds"},"body_template":{"$ref":"#/$defs/JsonValue","description":"Optional JSON body template. A value written as {\"$livoi_input\": \"<body parameter name>\"} is replaced with that parameter's validated value. Every other value is sent exactly as written and is not part of the agent's input schema, so the agent cannot change it. Every body parameter must be referenced, and unwrap_single_body_parameter must be false. When a template is set, an optional input that the agent omits or sends as null uses its default; without a default, the object member that references it is removed. On update, omit this field to keep the stored template or send null to remove it. Do not put credentials here; use api_key.","examples":[{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10}]}},"required":["api_url","http_method"],"title":"CustomToolRequestConfig","type":"object"},"CustomToolResponseConfig":{"additionalProperties":false,"properties":{"success_condition":{"anyOf":[{"$ref":"#/$defs/CustomToolSuccessCondition"},{"type":"null"}],"description":"Optional check on the parsed upstream response, after HTTP error handling. Paths contain object keys or nonnegative array indexes. equals compares scalar values without coercion; integers and floats compare numerically, but booleans never equal numbers. absent_or_empty_list accepts a missing path or an empty list; other types are unexpected responses. An unmet or unevaluable condition returns a terminal failure. It does not trigger automatic retries.","examples":[{"operator":"absent_or_empty_list","path":["errors"]}]}},"title":"CustomToolResponseConfig","type":"object"},"CustomToolSuccessCondition":{"discriminator":{"mapping":{"absent_or_empty_list":"#/$defs/CustomToolEmptyListCondition","equals":"#/$defs/CustomToolEqualsCondition"},"propertyName":"operator"},"oneOf":[{"$ref":"#/$defs/CustomToolEqualsCondition"},{"$ref":"#/$defs/CustomToolEmptyListCondition"}]},"FieldSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"}},"required":["type","name"],"title":"FieldSchema","type":"object"},"JsonValue":{},"ValueSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]}},"required":["type"],"title":"ValueSchema","type":"object"}},"example":{"custom_tools":[]},"properties":{"custom_tools":{"description":"Custom tools.","examples":[[]],"items":{"$ref":"#/$defs/AgentCustomToolBase"},"minItems":1,"title":"Custom Tools","type":"array"}},"required":["custom_tools"],"title":"CreateCustomToolForAgentBody","type":"object"},"examples":{"example_1":{"value":{"custom_tools":[]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomToolForAgentResponse"},"examples":{"example_1":{"value":{"created_tools":[{"agent_tool_id":"7442551216804781344","tool_name":"lookup_customer","tool_description":"Looks up a customer record by customer ID.","api_url":"https://api.example.com/customers/{customer_id}","http_method":"GET","max_retries":2,"has_api_key":true,"input_parameters":["customer_id"]}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"create","key":"agent_tools.create"}]}},"/api/v1/agent/tools/{agent_tool_id}/custom/update":{"patch":{"tags":["v1/Agent/tools"],"summary":"Update custom agent tool","description":"Update a custom tool.\n\nRequired permissions:\n- `agent_tools.update`","operationId":"updateCustomToolForAgent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_tool_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Tool Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomToolForAgentBody","$defs":{"CustomToolConditionPath":{"items":{"anyOf":[{"type":"string"},{"minimum":0,"type":"integer"}]},"maxItems":16,"minItems":1,"type":"array"},"CustomToolEmptyListCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"absent_or_empty_list","title":"Operator","type":"string"}},"required":["path","operator"],"title":"CustomToolEmptyListCondition","type":"object"},"CustomToolEqualsCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"equals","title":"Operator","type":"string"},"value":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value"}},"required":["path","operator","value"],"title":"CustomToolEqualsCondition","type":"object"},"CustomToolInputSchema":{"additionalProperties":false,"properties":{"parameters":{"items":{"$ref":"#/$defs/CustomToolParameter"},"title":"Parameters","type":"array"}},"title":"CustomToolInputSchema","type":"object"},"CustomToolParameter":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"},"location":{"enum":["path","query","body"],"title":"Location","type":"string"}},"required":["type","name","location"],"title":"CustomToolParameter","type":"object"},"CustomToolRequestConfig":{"additionalProperties":false,"properties":{"api_url":{"minLength":1,"title":"Api Url","type":"string"},"http_method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Http Method","type":"string"},"api_key_location":{"default":"header","enum":["header","query"],"title":"Api Key Location","type":"string"},"auth_param":{"default":"Authorization","minLength":1,"title":"Auth Param","type":"string"},"api_key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"Bearer","title":"Api Key Prefix"},"additional_headers":{"additionalProperties":{"type":"string"},"title":"Additional Headers","type":"object"},"unwrap_single_body_parameter":{"default":false,"title":"Unwrap Single Body Parameter","type":"boolean"},"timeout_seconds":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"title":"Timeout Seconds"},"body_template":{"$ref":"#/$defs/JsonValue","description":"Optional JSON body template. A value written as {\"$livoi_input\": \"<body parameter name>\"} is replaced with that parameter's validated value. Every other value is sent exactly as written and is not part of the agent's input schema, so the agent cannot change it. Every body parameter must be referenced, and unwrap_single_body_parameter must be false. When a template is set, an optional input that the agent omits or sends as null uses its default; without a default, the object member that references it is removed. On update, omit this field to keep the stored template or send null to remove it. Do not put credentials here; use api_key.","examples":[{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10}]}},"required":["api_url","http_method"],"title":"CustomToolRequestConfig","type":"object"},"CustomToolResponseConfig":{"additionalProperties":false,"properties":{"success_condition":{"anyOf":[{"$ref":"#/$defs/CustomToolSuccessCondition"},{"type":"null"}],"description":"Optional check on the parsed upstream response, after HTTP error handling. Paths contain object keys or nonnegative array indexes. equals compares scalar values without coercion; integers and floats compare numerically, but booleans never equal numbers. absent_or_empty_list accepts a missing path or an empty list; other types are unexpected responses. An unmet or unevaluable condition returns a terminal failure. It does not trigger automatic retries.","examples":[{"operator":"absent_or_empty_list","path":["errors"]}]}},"title":"CustomToolResponseConfig","type":"object"},"CustomToolSuccessCondition":{"discriminator":{"mapping":{"absent_or_empty_list":"#/$defs/CustomToolEmptyListCondition","equals":"#/$defs/CustomToolEqualsCondition"},"propertyName":"operator"},"oneOf":[{"$ref":"#/$defs/CustomToolEqualsCondition"},{"$ref":"#/$defs/CustomToolEmptyListCondition"}]},"FieldSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"}},"required":["type","name"],"title":"FieldSchema","type":"object"},"JsonValue":{},"ValueSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]}},"required":["type"],"title":"ValueSchema","type":"object"}},"example":{"api_key":"sk_tool_live_123456","defer_loading":true,"max_retries":1,"request_config":"<request_config>","tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"},"properties":{"tool_name":{"description":"Tool name.","examples":["lookup_customer"],"maxLength":128,"minLength":1,"title":"Tool Name","type":"string"},"tool_description":{"description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."],"minLength":1,"title":"Tool Description","type":"string"},"request_config":{"$ref":"#/$defs/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/$defs/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"description":"Max retries.","examples":[1],"title":"Max Retries"},"read_only":{"default":false,"description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","title":"Read Only","type":"boolean"},"defer_loading":{"default":false,"description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","examples":[true],"title":"Defer Loading","type":"boolean"},"input_schema":{"$ref":"#/$defs/CustomToolInputSchema","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Optional API key used when calling the custom tool.","examples":["sk_tool_live_123456"],"title":"Api Key"}},"required":["tool_name","tool_description","request_config"],"title":"UpdateCustomToolForAgentBody","type":"object"},"examples":{"example_1":{"value":{"tool_name":"lookup_customer","tool_description":"Looks up a customer record by customer ID.","request_config":"<request_config>","max_retries":1,"defer_loading":true,"api_key":"sk_tool_live_123456"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomToolForAgentResponse"},"examples":{"example_1":{"value":{"agent_tool_id":"7442551216804781344","tool_name":"lookup_customer","tool_description":"Looks up a customer record by customer ID.","api_url":"https://api.example.com/customers/{customer_id}","http_method":"GET","max_retries":2,"defer_loading":true,"has_api_key":true,"input_parameters":["customer_id"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"update","key":"agent_tools.update"}]}},"/api/v1/agent/tools/{agent_tool_id}/custom":{"get":{"tags":["v1/Agent/tools"],"summary":"Get custom agent tool","description":"Get the stored configuration of a custom tool with JSON types preserved, for editing. Dynamic Query returns tool metadata scalars as strings, so use this operation to load a body_template.\n\nRequired permissions:\n- `agent_tools.read`","operationId":"getCustomToolForAgent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_tool_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Tool Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCustomToolForAgentResponse"},"examples":{"example_1":{"value":{"agent_tool_id":"7442551216804781344","agent_id":"7442550215703679004","tool_name":"search_companies","tool_description":"Searches companies by name and returns their ID, name, and email address.","request_config":{"api_url":"https://api.example.com/v1/contacts/search","http_method":"POST","additional_headers":{"X-Workspace-Id":"example"},"body_template":{"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"fields":["id","name","email"],"limit":10}},"max_retries":1,"defer_loading":true,"input_schema":{"parameters":[{"name":"name","type":"string","location":"body","description":"Company name to search for."}]},"has_api_key":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"read","key":"agent_tools.read"}]}},"/api/v1/agent/tools/{agent_id}/custom/preview":{"post":{"tags":["v1/Agent/tools"],"summary":"Preview custom tool request","description":"Validates a custom tool configuration and sample arguments and builds the HTTP request exactly as the agent runtime would, without contacting the connected API. API keys and configured header values are redacted. Body templates reference inputs with {\"$livoi_input\": \"<name>\"}.\n\nRequired permissions:\n- `agent_tools.read`","operationId":"previewCustomToolRequest","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewCustomToolRequestBody","$defs":{"CustomToolConditionPath":{"items":{"anyOf":[{"type":"string"},{"minimum":0,"type":"integer"}]},"maxItems":16,"minItems":1,"type":"array"},"CustomToolEmptyListCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"absent_or_empty_list","title":"Operator","type":"string"}},"required":["path","operator"],"title":"CustomToolEmptyListCondition","type":"object"},"CustomToolEqualsCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"equals","title":"Operator","type":"string"},"value":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value"}},"required":["path","operator","value"],"title":"CustomToolEqualsCondition","type":"object"},"CustomToolInputSchema":{"additionalProperties":false,"properties":{"parameters":{"items":{"$ref":"#/$defs/CustomToolParameter"},"title":"Parameters","type":"array"}},"title":"CustomToolInputSchema","type":"object"},"CustomToolParameter":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"},"location":{"enum":["path","query","body"],"title":"Location","type":"string"}},"required":["type","name","location"],"title":"CustomToolParameter","type":"object"},"CustomToolRequestConfig":{"additionalProperties":false,"properties":{"api_url":{"minLength":1,"title":"Api Url","type":"string"},"http_method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Http Method","type":"string"},"api_key_location":{"default":"header","enum":["header","query"],"title":"Api Key Location","type":"string"},"auth_param":{"default":"Authorization","minLength":1,"title":"Auth Param","type":"string"},"api_key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"Bearer","title":"Api Key Prefix"},"additional_headers":{"additionalProperties":{"type":"string"},"title":"Additional Headers","type":"object"},"unwrap_single_body_parameter":{"default":false,"title":"Unwrap Single Body Parameter","type":"boolean"},"timeout_seconds":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"title":"Timeout Seconds"},"body_template":{"$ref":"#/$defs/JsonValue","description":"Optional JSON body template. A value written as {\"$livoi_input\": \"<body parameter name>\"} is replaced with that parameter's validated value. Every other value is sent exactly as written and is not part of the agent's input schema, so the agent cannot change it. Every body parameter must be referenced, and unwrap_single_body_parameter must be false. When a template is set, an optional input that the agent omits or sends as null uses its default; without a default, the object member that references it is removed. On update, omit this field to keep the stored template or send null to remove it. Do not put credentials here; use api_key.","examples":[{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10}]}},"required":["api_url","http_method"],"title":"CustomToolRequestConfig","type":"object"},"CustomToolResponseConfig":{"additionalProperties":false,"properties":{"success_condition":{"anyOf":[{"$ref":"#/$defs/CustomToolSuccessCondition"},{"type":"null"}],"description":"Optional check on the parsed upstream response, after HTTP error handling. Paths contain object keys or nonnegative array indexes. equals compares scalar values without coercion; integers and floats compare numerically, but booleans never equal numbers. absent_or_empty_list accepts a missing path or an empty list; other types are unexpected responses. An unmet or unevaluable condition returns a terminal failure. It does not trigger automatic retries.","examples":[{"operator":"absent_or_empty_list","path":["errors"]}]}},"title":"CustomToolResponseConfig","type":"object"},"CustomToolSuccessCondition":{"discriminator":{"mapping":{"absent_or_empty_list":"#/$defs/CustomToolEmptyListCondition","equals":"#/$defs/CustomToolEqualsCondition"},"propertyName":"operator"},"oneOf":[{"$ref":"#/$defs/CustomToolEqualsCondition"},{"$ref":"#/$defs/CustomToolEmptyListCondition"}]},"FieldSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"}},"required":["type","name"],"title":"FieldSchema","type":"object"},"JsonValue":{},"ValueSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]}},"required":["type"],"title":"ValueSchema","type":"object"}},"example":{"agent_tool_id":"7442551216804781021","arguments":{"name":"Acme"},"input_schema":{"parameters":[{"description":"Company name to search for.","location":"body","name":"name","type":"string"}]},"request_config":{"additional_headers":{"X-Workspace-Id":"example"},"api_url":"https://api.example.com/v1/contacts/search","body_template":{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10},"http_method":"POST"},"tool_description":"Searches companies by name and returns their ID, name, and email address.","tool_name":"search_companies"},"properties":{"tool_name":{"description":"Tool name.","examples":["lookup_customer"],"maxLength":128,"minLength":1,"title":"Tool Name","type":"string"},"tool_description":{"description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."],"minLength":1,"title":"Tool Description","type":"string"},"request_config":{"$ref":"#/$defs/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/$defs/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"description":"Max retries.","examples":[1],"title":"Max Retries"},"read_only":{"default":false,"description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","title":"Read Only","type":"boolean"},"defer_loading":{"default":false,"description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","examples":[true],"title":"Defer Loading","type":"boolean"},"input_schema":{"$ref":"#/$defs/CustomToolInputSchema","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Omit to use the saved tool's stored API key (requires agent_tool_id). Send null to build the request without a key, or a string to use that key. Key values are never returned.","examples":["sk_tool_live_123456"],"title":"Api Key"},"agent_tool_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Saved custom tool of this agent. When set, an omitted api_key or request_config.body_template uses the stored value, as in updateCustomToolForAgent.","examples":[7442551216804781021],"title":"Agent Tool Id"},"arguments":{"additionalProperties":{"$ref":"#/$defs/JsonValue"},"description":"Sample arguments exactly as the agent would send them. They are validated like a real tool call.","examples":[{"name":"Acme"}],"title":"Arguments","type":"object"}},"required":["tool_name","tool_description","request_config"],"title":"PreviewCustomToolRequestBody","type":"object"},"examples":{"example_1":{"value":{"tool_name":"search_companies","tool_description":"Searches companies by name and returns their ID, name, and email address.","request_config":{"api_url":"https://api.example.com/v1/contacts/search","http_method":"POST","additional_headers":{"X-Workspace-Id":"example"},"body_template":{"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"fields":["id","name","email"],"limit":10}},"input_schema":{"parameters":[{"name":"name","type":"string","location":"body","description":"Company name to search for."}]},"agent_tool_id":"7442551216804781021","arguments":{"name":"Acme"}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewCustomToolRequestResponse"},"examples":{"example_1":{"value":{"validated_arguments":{"name":"Acme"},"request":{"method":"POST","url":"https://api.example.com/v1/contacts/search","url_truncated":false,"headers":[{"name":"Host","value":"api.example.com"},{"name":"X-Workspace-Id","value":"<redacted>"},{"name":"Authorization","value":"Bearer <redacted>"},{"name":"Content-Length","value":"98"},{"name":"Content-Type","value":"application/json"}],"headers_truncated":false,"body_text":"{\"filter\":{\"name\":{\"contains\":\"Acme\"},\"type\":\"company\"},\"fields\":[\"id\",\"name\",\"email\"],\"limit\":10}","body_size_bytes":98,"body_truncated":false,"timeout_seconds":30.0},"has_api_key":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"read","key":"agent_tools.read"}]}},"/api/v1/agent/tools/{agent_id}/custom/test":{"post":{"tags":["v1/Agent/tools"],"summary":"Send custom tool test request","description":"Not a dry run: sends one real HTTP request using the same request building as the agent runtime and, for a saved tool, its stored API key. The connected API can create, change, or delete data. Requires confirm_upstream_request=true. The stored API key is only sent to the saved tool's origin. Nothing is stored. Upstream errors, timeouts, and connection failures are returned with HTTP 200 in the response body. Use previewCustomToolRequest to inspect a request without sending it.\n\nRequired permissions:\n- `agent_tools.update`","operationId":"sendCustomToolTestRequest","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendCustomToolTestRequestBody","$defs":{"CustomToolConditionPath":{"items":{"anyOf":[{"type":"string"},{"minimum":0,"type":"integer"}]},"maxItems":16,"minItems":1,"type":"array"},"CustomToolEmptyListCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"absent_or_empty_list","title":"Operator","type":"string"}},"required":["path","operator"],"title":"CustomToolEmptyListCondition","type":"object"},"CustomToolEqualsCondition":{"additionalProperties":false,"properties":{"path":{"$ref":"#/$defs/CustomToolConditionPath"},"operator":{"const":"equals","title":"Operator","type":"string"},"value":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value"}},"required":["path","operator","value"],"title":"CustomToolEqualsCondition","type":"object"},"CustomToolInputSchema":{"additionalProperties":false,"properties":{"parameters":{"items":{"$ref":"#/$defs/CustomToolParameter"},"title":"Parameters","type":"array"}},"title":"CustomToolInputSchema","type":"object"},"CustomToolParameter":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"},"location":{"enum":["path","query","body"],"title":"Location","type":"string"}},"required":["type","name","location"],"title":"CustomToolParameter","type":"object"},"CustomToolRequestConfig":{"additionalProperties":false,"properties":{"api_url":{"minLength":1,"title":"Api Url","type":"string"},"http_method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Http Method","type":"string"},"api_key_location":{"default":"header","enum":["header","query"],"title":"Api Key Location","type":"string"},"auth_param":{"default":"Authorization","minLength":1,"title":"Auth Param","type":"string"},"api_key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"Bearer","title":"Api Key Prefix"},"additional_headers":{"additionalProperties":{"type":"string"},"title":"Additional Headers","type":"object"},"unwrap_single_body_parameter":{"default":false,"title":"Unwrap Single Body Parameter","type":"boolean"},"timeout_seconds":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"title":"Timeout Seconds"},"body_template":{"$ref":"#/$defs/JsonValue","description":"Optional JSON body template. A value written as {\"$livoi_input\": \"<body parameter name>\"} is replaced with that parameter's validated value. Every other value is sent exactly as written and is not part of the agent's input schema, so the agent cannot change it. Every body parameter must be referenced, and unwrap_single_body_parameter must be false. When a template is set, an optional input that the agent omits or sends as null uses its default; without a default, the object member that references it is removed. On update, omit this field to keep the stored template or send null to remove it. Do not put credentials here; use api_key.","examples":[{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10}]}},"required":["api_url","http_method"],"title":"CustomToolRequestConfig","type":"object"},"CustomToolResponseConfig":{"additionalProperties":false,"properties":{"success_condition":{"anyOf":[{"$ref":"#/$defs/CustomToolSuccessCondition"},{"type":"null"}],"description":"Optional check on the parsed upstream response, after HTTP error handling. Paths contain object keys or nonnegative array indexes. equals compares scalar values without coercion; integers and floats compare numerically, but booleans never equal numbers. absent_or_empty_list accepts a missing path or an empty list; other types are unexpected responses. An unmet or unevaluable condition returns a terminal failure. It does not trigger automatic retries.","examples":[{"operator":"absent_or_empty_list","path":["errors"]}]}},"title":"CustomToolResponseConfig","type":"object"},"CustomToolSuccessCondition":{"discriminator":{"mapping":{"absent_or_empty_list":"#/$defs/CustomToolEmptyListCondition","equals":"#/$defs/CustomToolEqualsCondition"},"propertyName":"operator"},"oneOf":[{"$ref":"#/$defs/CustomToolEqualsCondition"},{"$ref":"#/$defs/CustomToolEmptyListCondition"}]},"FieldSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]},"name":{"minLength":1,"title":"Name","type":"string"},"required":{"default":true,"title":"Required","type":"boolean"},"default":{"$ref":"#/$defs/JsonValue"}},"required":["type","name"],"title":"FieldSchema","type":"object"},"JsonValue":{},"ValueSchema":{"additionalProperties":false,"properties":{"type":{"enum":["string","integer","number","boolean","object","array"],"title":"Type","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/$defs/FieldSchema"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/$defs/ValueSchema"},{"type":"null"}]}},"required":["type"],"title":"ValueSchema","type":"object"}},"example":{"agent_tool_id":"7442551216804781021","arguments":{"name":"Acme"},"confirm_upstream_request":true,"input_schema":{"parameters":[{"description":"Company name to search for.","location":"body","name":"name","type":"string"}]},"request_config":{"additional_headers":{"X-Workspace-Id":"example"},"api_url":"https://api.example.com/v1/contacts/search","body_template":{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10},"http_method":"POST"},"tool_description":"Searches companies by name and returns their ID, name, and email address.","tool_name":"search_companies"},"properties":{"tool_name":{"description":"Tool name.","examples":["lookup_customer"],"maxLength":128,"minLength":1,"title":"Tool Name","type":"string"},"tool_description":{"description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."],"minLength":1,"title":"Tool Description","type":"string"},"request_config":{"$ref":"#/$defs/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/$defs/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"description":"Max retries.","examples":[1],"title":"Max Retries"},"read_only":{"default":false,"description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","title":"Read Only","type":"boolean"},"defer_loading":{"default":false,"description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","examples":[true],"title":"Defer Loading","type":"boolean"},"input_schema":{"$ref":"#/$defs/CustomToolInputSchema","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Omit to use the saved tool's stored API key (requires agent_tool_id). Send null to build the request without a key, or a string to use that key. Key values are never returned.","examples":["sk_tool_live_123456"],"title":"Api Key"},"agent_tool_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Saved custom tool of this agent. When set, an omitted api_key or request_config.body_template uses the stored value, as in updateCustomToolForAgent.","examples":[7442551216804781021],"title":"Agent Tool Id"},"arguments":{"additionalProperties":{"$ref":"#/$defs/JsonValue"},"description":"Sample arguments exactly as the agent would send them. They are validated like a real tool call.","examples":[{"name":"Acme"}],"title":"Arguments","type":"object"},"confirm_upstream_request":{"const":true,"description":"Must be true. Sends one real request that can create, change, or delete data in the connected API.","examples":[true],"title":"Confirm Upstream Request","type":"boolean"}},"required":["tool_name","tool_description","request_config","confirm_upstream_request"],"title":"SendCustomToolTestRequestBody","type":"object"},"examples":{"example_1":{"value":{"tool_name":"search_companies","tool_description":"Searches companies by name and returns their ID, name, and email address.","request_config":{"api_url":"https://api.example.com/v1/contacts/search","http_method":"POST","additional_headers":{"X-Workspace-Id":"example"},"body_template":{"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"fields":["id","name","email"],"limit":10}},"input_schema":{"parameters":[{"name":"name","type":"string","location":"body","description":"Company name to search for."}]},"agent_tool_id":"7442551216804781021","arguments":{"name":"Acme"},"confirm_upstream_request":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendCustomToolTestRequestResponse"},"examples":{"example_1":{"value":{"validated_arguments":{"name":"Acme"},"request":{"method":"POST","url":"https://api.example.com/v1/contacts/search","url_truncated":false,"headers":[{"name":"Host","value":"api.example.com"},{"name":"X-Workspace-Id","value":"<redacted>"},{"name":"Authorization","value":"Bearer <redacted>"},{"name":"Content-Length","value":"98"},{"name":"Content-Type","value":"application/json"}],"headers_truncated":false,"body_text":"{\"filter\":{\"name\":{\"contains\":\"Acme\"},\"type\":\"company\"},\"fields\":[\"id\",\"name\",\"email\"],\"limit\":10}","body_size_bytes":98,"body_truncated":false,"timeout_seconds":30.0},"has_api_key":true,"outcome":"completed","request_possibly_processed":true,"duration_ms":412,"response":{"status_code":200,"headers":[{"name":"content-type","value":"application/json"}],"headers_truncated":false,"body_text":"[{\"id\": 7, \"name\": \"Acme GmbH\", \"email\": \"info@acme.example\"}]","body_size_bytes":63,"body_truncated":false},"agent_result":{"status":"completed","status_code":200,"response":[{"id":7,"name":"Acme GmbH","email":"info@acme.example"}]},"agent_result_omitted":false}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"update","key":"agent_tools.update"}]}},"/api/v1/agent/tools/{agent_id}/delete":{"delete":{"tags":["v1/Agent/tools"],"summary":"Delete agent tools","description":"Delete tools from an agent.\n\nRequired permissions:\n- `agent_tools.delete`","operationId":"deleteAgentTools","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentToolsBody","example":{"function_names":["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]},"properties":{"function_names":{"description":"Built-in tool function names to seed for the agent.","examples":[["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]],"items":{"type":"string"},"title":"Function Names","type":"array"}},"required":["function_names"],"title":"DeleteAgentToolsBody","type":"object"},"examples":{"example_1":{"value":{"function_names":["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentToolsResponse"},"examples":{"example_1":{"value":{"deleted_count_message":"Deleted 2 tools."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"delete","key":"agent_tools.delete"}]}},"/api/v1/agent/tools/{agent_tool_id}/update":{"patch":{"tags":["v1/Agent/tools"],"summary":"Update agent tool metadata","description":"Update metadata or the agent-facing description for an agent tool.\n\nRequired permissions:\n- `agent_tools.update`","operationId":"updateAgentToolMeta","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_tool_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Tool Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentToolMetaBody","$defs":{"JsonValue":{}},"example":{"meta":{"history_visibility":{"model_visible":true,"user_visible":true}},"tool_description":"Creates an e-invoice XML draft from the invoice data collected in this chat."},"properties":{"meta":{"additionalProperties":{"$ref":"#/$defs/JsonValue"},"description":"Metadata to store for the agent tool.","examples":[{"history_visibility":{"model_visible":true,"user_visible":true}}],"title":"Meta","type":"object"},"tool_description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent-specific description used when exposing the tool to the model. Set to a non-empty string to replace the current description; set to null or an empty string to restore the built-in default; omit to leave the description unchanged.","examples":["Creates an e-invoice XML draft from the invoice data collected in this chat.","",null],"title":"Tool Description"}},"title":"UpdateAgentToolMetaBody","type":"object"},"examples":{"example_1":{"value":{"meta":{"history_visibility":{"model_visible":true,"user_visible":true}},"tool_description":"Creates an e-invoice XML draft from the invoice data collected in this chat."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentToolMetaResponse"},"examples":{"example_1":{"value":{"agent_tool_id":"7442551216804781021","meta":{"history_visibility":{"model_visible":true,"user_visible":true}},"tool_description":"Creates an e-invoice XML draft."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_tools","action":"update","key":"agent_tools.update"}]}},"/api/v1/agent/mcp/catalog":{"get":{"tags":["v1/Agent/mcp"],"summary":"List MCP catalog","description":"List the curated MCP servers that can be installed by catalog ID.\n\nRequired permissions:\n- `mcp_servers.read`","operationId":"listMcpCatalog","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMcpCatalogResponse"},"examples":{"example_1":{"value":{"entries":[{"id":"notion","title":"Notion","url":"https://mcp.notion.com/mcp","website_url":"https://www.notion.com","auth_modes":["user_oauth"]}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"mcp_catalog","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"read","key":"mcp_servers.read"}]}},"/api/v1/agent/mcp/servers/create":{"post":{"tags":["v1/Agent/mcp"],"summary":"Install MCP server","description":"Install a catalog or custom MCP server for the tenant. Agents use it after it is linked to them. LIVOI identity always needs a streamable HTTP URL. It must use HTTPS unless the deployment's private-host allowlist covers its host name or IP address. It returns 409 when the deployment has no signing keys.\n\nRequired permissions:\n- `mcp_servers.create`","operationId":"createMcpServer","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMcpServerBody","$defs":{"McpAuthMode":{"enum":["registration","user_oauth","livoi_identity"],"type":"string"},"McpToolErrorBehavior":{"enum":["failed","retry","error"],"type":"string"},"McpToolName":{"maxLength":256,"minLength":1,"type":"string"},"McpToolPolicy":{"enum":["allow","block"],"type":"string"}},"additionalProperties":false,"example":{"catalog_id":"notion","headers":{"Authorization":"Bearer mcp_token"},"max_retries":2,"name":"Accounting","tool_policies":{"delete_page":"block"},"url":"https://mcp.example.com/mcp"},"properties":{"catalog_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Catalog entry to install. Provide either this or a custom URL.","examples":["notion"],"title":"Catalog Id"},"url":{"anyOf":[{"format":"uri","minLength":1,"type":"string"},{"type":"null"}],"description":"Custom remote streamable-HTTP or SSE MCP endpoint. Provide either this or a catalog ID.","examples":["https://mcp.example.com/mcp"],"title":"Url"},"name":{"description":"Display name of the server.","examples":["Accounting"],"maxLength":100,"minLength":1,"title":"Name","type":"string"},"headers":{"additionalProperties":{"type":"string"},"description":"HTTP headers sent to the MCP server. Values are never returned by the API.","examples":[{"Authorization":"Bearer mcp_token"}],"title":"Headers","type":"object"},"enabled":{"default":true,"description":"Whether agents can use this server.","title":"Enabled","type":"boolean"},"auth_mode":{"anyOf":[{"$ref":"#/$defs/McpAuthMode"},{"type":"null"}],"description":"Registration uses the configured headers as a server-scoped service identity. User OAuth requires each user to authorize separately. LIVOI identity sends a short-lived token signed by LIVOI that names the calling user and is valid only for this server URL. Defaults to the catalog entry's first auth mode, or registration for a custom URL."},"include_instructions":{"default":false,"description":"Include instructions returned by the MCP server in the agent instructions.","title":"Include Instructions","type":"boolean"},"include_return_schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether MCP tool return schemas are sent to the model. Null uses the default behavior.","title":"Include Return Schema"},"max_retries":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"description":"MCP tool retry limit. Null inherits the agent tool retry setting.","examples":[2],"title":"Max Retries"},"tool_error_behavior":{"$ref":"#/$defs/McpToolErrorBehavior","default":"failed","description":"How the agent handles an MCP tool error. failed returns a completed tool error to the model as the call result, retry asks the model to correct the call within the retry limit, and error stops the agent run. Protocol errors are retried unless the behavior is error."},"init_timeout":{"default":5.0,"description":"Connection and initialization timeout in seconds.","exclusiveMinimum":0,"maximum":120,"title":"Init Timeout","type":"number"},"read_timeout":{"default":300.0,"description":"Long-lived MCP connection read timeout in seconds.","exclusiveMinimum":0,"maximum":3600,"title":"Read Timeout","type":"number"},"tool_policies":{"additionalProperties":{"$ref":"#/$defs/McpToolPolicy"},"description":"Tool policy overrides by tool name. They replace the catalog default for that tool.","examples":[{"delete_page":"block"}],"propertyNames":{"$ref":"#/$defs/McpToolName"},"title":"Tool Policies","type":"object"}},"required":["name"],"title":"CreateMcpServerBody","type":"object"},"examples":{"example_1":{"value":{"catalog_id":"notion","url":"https://mcp.example.com/mcp","name":"Accounting","headers":{"Authorization":"Bearer mcp_token"},"max_retries":2,"tool_policies":{"delete_page":"block"}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"},"examples":{"example_1":{"value":{"mcp_server_id":"7442551216804781198","name":"<name>","url":"<url>","enabled":"<enabled>","auth_mode":"<auth_mode>","include_instructions":"<include_instructions>","include_return_schema":"<include_return_schema>","max_retries":"<max_retries>","tool_error_behavior":"<tool_error_behavior>","init_timeout":"<init_timeout>","read_timeout":"<read_timeout>","header_names":["Authorization"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_server","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"create","key":"mcp_servers.create"}]}},"/api/v1/agent/mcp/servers/test":{"post":{"tags":["v1/Agent/mcp"],"summary":"Test MCP server connection","description":"Connect to a registration MCP server configuration without saving it and list its tools. Besides server read permission, it requires server create permission without mcp_server_id, or update permission on that server with one. Connection results, including a remote 401 or 403, return 200 with the outcome; the test gives up as failed after 30 seconds. A URL the initial outbound network policy check rejects, an mcp_server_id of a server without registration auth, or reusing stored headers on another origin returns 400.\n\nRequired permissions:\n- `mcp_servers.read`","operationId":"testMcpServer","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerTestBody","additionalProperties":false,"example":{"headers":{"Authorization":"Bearer mcp_token"},"url":"https://mcp.example.com/mcp"},"properties":{"url":{"description":"Remote streamable-HTTP or SSE MCP endpoint to test.","examples":["https://mcp.example.com/mcp"],"format":"uri","minLength":1,"title":"Url","type":"string"},"headers":{"additionalProperties":{"type":"string"},"description":"HTTP headers to send; an empty object sends none. When omitted with an mcp_server_id of a registration server that has stored headers, the stored headers are sent; a URL on another origin then returns 400. Otherwise none are sent.","examples":[{"Authorization":"Bearer mcp_token"}],"title":"Headers","type":"object"},"mcp_server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Installed server being edited. An omitted headers field reuses its stored registration headers.","title":"Mcp Server Id"},"init_timeout":{"default":5.0,"description":"MCP session negotiation timeout in seconds.","exclusiveMinimum":0,"maximum":120,"title":"Init Timeout","type":"number"},"read_timeout":{"default":300.0,"description":"Read timeout in seconds for listing the server's tools.","exclusiveMinimum":0,"maximum":3600,"title":"Read Timeout","type":"number"}},"required":["url"],"title":"McpServerTestBody","type":"object"},"examples":{"example_1":{"value":{"url":"https://mcp.example.com/mcp","headers":{"Authorization":"Bearer mcp_token"}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerTestResponse"},"examples":{"example_1":{"value":{"outcome":"<outcome>","auth_scheme":"Bearer"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_server_test","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"read","key":"mcp_servers.read"}]}},"/api/v1/agent/mcp/servers":{"get":{"tags":["v1/Agent/mcp"],"summary":"List MCP servers","description":"List the MCP servers installed for the tenant. Custom server URLs are shown as origins unless the caller can update servers.\n\nRequired permissions:\n- `mcp_servers.read`","operationId":"listMcpServers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMcpServersResponse"},"examples":{"example_1":{"value":{"servers":[{"mcp_server_id":"7442551216804781198","name":"<name>","url":"<url>","enabled":"<enabled>","auth_mode":"<auth_mode>","include_instructions":"<include_instructions>","include_return_schema":"<include_return_schema>","max_retries":"<max_retries>","tool_error_behavior":"<tool_error_behavior>","init_timeout":"<init_timeout>","read_timeout":"<read_timeout>","header_names":["Authorization"]}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"mcp_servers","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"read","key":"mcp_servers.read"}]}},"/api/v1/agent/mcp/servers/{mcp_server_id}/update":{"patch":{"tags":["v1/Agent/mcp"],"summary":"Update MCP server","description":"Update an installed MCP server for every linked agent. Changing the URL, headers, auth mode or enabled state disconnects open apps of this server. When the URL or auth mode changes and the resulting mode is LIVOI identity, the update returns 409 if the deployment has no signing keys.\n\nRequired permissions:\n- `mcp_servers.update`","operationId":"updateMcpServer","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mcp_server_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Server Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMcpServerBody","$defs":{"McpAuthMode":{"enum":["registration","user_oauth","livoi_identity"],"type":"string"},"McpToolErrorBehavior":{"enum":["failed","retry","error"],"type":"string"},"McpToolName":{"maxLength":256,"minLength":1,"type":"string"},"McpToolPolicy":{"enum":["allow","block"],"type":"string"}},"additionalProperties":false,"example":{"tool_policies":{"delete_page":"block","search":null}},"properties":{"name":{"anyOf":[{"maxLength":100,"minLength":1,"type":"string"},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"format":"uri","minLength":1,"type":"string"},{"type":"null"}],"description":"New URL. Catalog servers keep the catalog URL.","title":"Url"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"description":"Replacement headers. Null or an empty object clears stored headers. Omission retains them unless the auth mode leaves registration, which clears them. Moving a server that has stored headers to another origin while it stays registration needs its headers sent again or cleared.","title":"Headers"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"auth_mode":{"anyOf":[{"$ref":"#/$defs/McpAuthMode"},{"type":"null"}]},"include_instructions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Instructions"},"include_return_schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Return Schema"},"max_retries":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Max Retries"},"tool_error_behavior":{"anyOf":[{"$ref":"#/$defs/McpToolErrorBehavior"},{"type":"null"}]},"init_timeout":{"anyOf":[{"exclusiveMinimum":0,"maximum":120,"type":"number"},{"type":"null"}],"title":"Init Timeout"},"read_timeout":{"anyOf":[{"exclusiveMinimum":0,"maximum":3600,"type":"number"},{"type":"null"}],"title":"Read Timeout"},"tool_policies":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/$defs/McpToolPolicy"},{"type":"null"}]},"propertyNames":{"$ref":"#/$defs/McpToolName"},"type":"object"},{"type":"null"}],"description":"Tool policy overrides to change. Each listed tool gets the given policy; null removes its override. Unlisted tools keep theirs.","examples":[{"delete_page":"block","search":null}],"title":"Tool Policies"}},"title":"UpdateMcpServerBody","type":"object"},"examples":{"example_1":{"value":{"tool_policies":{"delete_page":"block","search":null}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"},"examples":{"example_1":{"value":{"mcp_server_id":"7442551216804781198","name":"<name>","url":"<url>","enabled":"<enabled>","auth_mode":"<auth_mode>","include_instructions":"<include_instructions>","include_return_schema":"<include_return_schema>","max_retries":"<max_retries>","tool_error_behavior":"<tool_error_behavior>","init_timeout":"<init_timeout>","read_timeout":"<read_timeout>","header_names":["Authorization"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_server","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"update","key":"mcp_servers.update"}]}},"/api/v1/agent/mcp/servers/{mcp_server_id}/delete":{"delete":{"tags":["v1/Agent/mcp"],"summary":"Delete MCP server","description":"Uninstall an MCP server and remove it from every agent.\n\nRequired permissions:\n- `mcp_servers.delete`","operationId":"deleteMcpServer","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mcp_server_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Server Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMcpServerResponse"},"examples":{"example_1":{"value":{"status":"MCP server deleted successfully."}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"mcp_server","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"delete","key":"mcp_servers.delete"}]}},"/api/v1/agent/mcp/servers/{mcp_server_id}/tools":{"get":{"tags":["v1/Agent/mcp"],"summary":"List MCP server tools","description":"Connect to an MCP server and list the tools it currently exposes, with their effective policy. Custom or header-authenticated registration servers require server update permission. User OAuth servers use the authenticated user's authorization. LIVOI identity servers need a request made for a user and return 409 for a tenant key without one, or when the server redirects to a URL other than the registered one.\n\nRequired permissions:\n- `mcp_servers.read`","operationId":"listMcpServerTools","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mcp_server_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Server Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMcpServerToolsResponse"},"examples":{"example_1":{"value":{"tools":[{"name":"search","effective_policy":"<effective_policy>"}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_server_tools","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"read","key":"mcp_servers.read"}]}},"/api/v1/agent/mcp/servers/{mcp_server_id}/oauth/authorize":{"post":{"tags":["v1/Agent/mcp"],"summary":"Authorize an MCP server with OAuth","description":"Authorize a user OAuth MCP server with an authorization-code flow and PKCE. The resulting credentials belong to the authenticated user and are scoped to this server's URL.\n\nRequired permissions:\n- `mcp_servers.read`","operationId":"startMcpServerOAuth","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mcp_server_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Server Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMcpServerOAuthBody","$defs":{"OAuth2ClientAuthMethod":{"enum":["none","client_secret_post","client_secret_basic"],"type":"string"}},"additionalProperties":false,"example":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete","scopes":["openid","email"]},"properties":{"scopes":{"description":"OAuth scopes for this MCP resource server. When omitted, scopes advertised by the MCP server are used. These are independent from scopes granted to direct provider integrations.","examples":[["openid","email"]],"items":{"type":"string"},"title":"Scopes","type":"array"},"completion_redirect_uri":{"anyOf":[{"format":"uri","minLength":1,"type":"string"},{"type":"null"}],"description":"Allowed redirect URI to open after authorization completes. Omit to receive the callback result as JSON.","examples":["https://app.livoi.de/integrations/oauth/complete"],"title":"Completion Redirect Uri"},"client_id":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Pre-registered OAuth client ID. Mutually exclusive with client_metadata_url. When both are omitted on an HTTPS deployment, LIVOI supplies its own Client ID Metadata Document URL and uses it when the authorization server advertises CIMD and either lists none or leaves token endpoint authentication methods unspecified; otherwise LIVOI falls back to dynamic client registration when available.","title":"Client Id"},"client_secret":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"OAuth client secret. It is never returned by the API.","title":"Client Secret"},"token_endpoint_auth_method":{"anyOf":[{"$ref":"#/$defs/OAuth2ClientAuthMethod"},{"type":"null"}],"description":"Token endpoint authentication method. Defaults to client_secret_post when a secret is supplied."},"client_metadata_url":{"anyOf":[{"format":"uri","minLength":1,"type":"string"},{"type":"null"}],"description":"HTTPS Client ID Metadata Document URL. Mutually exclusive with client_id. When both are omitted on an HTTPS deployment, LIVOI supplies its own metadata document URL.","title":"Client Metadata Url"}},"title":"StartMcpServerOAuthBody","type":"object"},"examples":{"example_1":{"value":{"scopes":["openid","email"],"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMcpServerOAuthResponse"},"examples":{"example_1":{"value":{"integration_identity_id":"<integration_identity_id>","authorization_url":"<authorization_url>","expires_at":"<expires_at>"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_server_oauth","x-auth-context":"tenant","x-required-permissions":[{"model":"mcp_servers","action":"read","key":"mcp_servers.read"}]}},"/api/v1/agent/mcp/{agent_id}/create":{"post":{"tags":["v1/Agent/mcp"],"summary":"Link MCP server to agent","description":"Let an agent use an installed MCP server under a tool prefix.\n\nRequired permissions:\n- `agents.update`\n- `mcp_servers.update`","operationId":"createAgentMcpClient","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentMcpClientBody","additionalProperties":false,"example":{"mcp_server_id":"7442551216804781198","name":"accounting"},"properties":{"mcp_server_id":{"description":"Installed MCP server to link.","examples":[7442551216804781198],"title":"Mcp Server Id","type":"integer"},"name":{"description":"Tool prefix for this server on this agent. It must be unique per agent.","examples":["accounting"],"maxLength":64,"minLength":1,"title":"Name","type":"string"},"enabled":{"default":true,"description":"Whether the agent uses this server.","title":"Enabled","type":"boolean"}},"required":["mcp_server_id","name"],"title":"CreateAgentMcpClientBody","type":"object"},"examples":{"example_1":{"value":{"mcp_server_id":"7442551216804781198","name":"accounting"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMcpClientResponse"},"examples":{"example_1":{"value":{"mcp_client_id":"7442551216804781021","agent_id":"7442550215703679004","mcp_server_id":"7442551216804781198","name":"accounting","enabled":"<enabled>"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_mcp_client","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"},{"model":"mcp_servers","action":"update","key":"mcp_servers.update"}]}},"/api/v1/agent/mcp/{agent_id}":{"get":{"tags":["v1/Agent/mcp"],"summary":"List agent MCP clients","description":"List the MCP servers linked to an agent.\n\nRequired permissions:\n- `agents.read`","operationId":"listAgentMcpClients","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentMcpClientsResponse"},"examples":{"example_1":{"value":{"clients":[{"mcp_client_id":"7442551216804781021","agent_id":"7442550215703679004","mcp_server_id":"7442551216804781198","name":"accounting","enabled":"<enabled>"}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"agent_mcp_clients","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"read","key":"agents.read"}]}},"/api/v1/agent/mcp/{mcp_client_id}/update":{"patch":{"tags":["v1/Agent/mcp"],"summary":"Update agent MCP client","description":"Change the tool prefix of a linked MCP server, or turn it on or off for this agent.\n\nRequired permissions:\n- `agents.update`","operationId":"updateAgentMcpClient","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mcp_client_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Client Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentMcpClientBody","additionalProperties":false,"properties":{"name":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Name"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"title":"UpdateAgentMcpClientBody","type":"object"},"examples":{"example_1":{"value":{}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMcpClientResponse"},"examples":{"example_1":{"value":{"mcp_client_id":"7442551216804781021","agent_id":"7442550215703679004","mcp_server_id":"7442551216804781198","name":"accounting","enabled":"<enabled>"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_mcp_client","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/mcp/{mcp_client_id}/delete":{"delete":{"tags":["v1/Agent/mcp"],"summary":"Delete agent MCP client","description":"Remove an MCP server from an agent. The installed server stays available for other agents.\n\nRequired permissions:\n- `agents.update`","operationId":"deleteAgentMcpClient","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mcp_client_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Client Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentMcpClientResponse"},"examples":{"example_1":{"value":{"status":"MCP client deleted successfully."}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"agent_mcp_client","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"}]}},"/api/v1/agent/mcp/chats/{chat_id}/servers/{mcp_client_id}/discovery":{"get":{"tags":["v1/Agent/mcp"],"summary":"Discover MCP tools and resources for a chat","description":"Discover current MCP tools, UI metadata, and resources for the authenticated chat user.\n\nRequired permissions:\n- `agents.read`","operationId":"discoverMcpChatServer","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"mcp_client_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Client Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatDiscoveryResponse"},"examples":{"example_1":{"value":{"mcp_client_id":"<mcp_client_id>","configuration_version":"<configuration_version>"}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_chat_discovery","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"read","key":"agents.read"}]}},"/api/v1/agent/mcp/chats/{chat_id}/servers/{mcp_client_id}/resources/read":{"post":{"tags":["v1/Agent/mcp"],"summary":"Read an MCP resource for a chat","description":"Owners can read listed resources and resources referenced by allowed UI tools. Chat readers can open a published app document using its visible history part. Servers using personal OAuth require the caller's own connection.\n\nRequired permissions:\n- `agents.read`","operationId":"readMcpChatResource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"mcp_client_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Client Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatResourceBody","example":{"uri":"<uri>"},"properties":{"uri":{"maxLength":2048,"minLength":1,"title":"Uri","type":"string"},"app_history_part_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Visible tool-return part publishing this UI resource. Required for chat viewers.","title":"App History Part Id"}},"required":["uri"],"title":"McpChatResourceBody","type":"object"},"examples":{"example_1":{"value":{"uri":"<uri>"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatResourceResponse"},"examples":{"example_1":{"value":{"configuration_version":"<configuration_version>"}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_chat_resource","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"read","key":"agents.read"}]}},"/api/v1/agent/mcp/chats/{chat_id}/servers/{mcp_client_id}/tools/call":{"post":{"tags":["v1/Agent/mcp"],"summary":"Call a server tool from a chat app","description":"Proxy an app-visible tool call from a rendered app instance in the authenticated chat.\n\nRequired permissions:\n- `agents.read`\n- `chat_history_entries.create`","operationId":"callMcpChatAppTool","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"mcp_client_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Client Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatToolCallBody","example":{"app_history_part_id":"7442551216804781021","client_call_id":"5799e4d0-f7e2-46f7-97c0-4ae276a5f999","tool_name":"<tool_name>"},"properties":{"app_history_part_id":{"examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"App History Part Id","type":"integer"},"client_call_id":{"examples":["5799e4d0-f7e2-46f7-97c0-4ae276a5f999"],"title":"Client Call Id","type":"string"},"tool_name":{"maxLength":256,"minLength":1,"title":"Tool Name","type":"string"},"arguments":{"additionalProperties":true,"title":"Arguments","type":"object"}},"required":["app_history_part_id","client_call_id","tool_name"],"title":"McpChatToolCallBody","type":"object"},"examples":{"example_1":{"value":{"app_history_part_id":"7442551216804781021","client_call_id":"5799e4d0-f7e2-46f7-97c0-4ae276a5f999","tool_name":"<tool_name>"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatToolCallResponse"},"examples":{"example_1":{"value":{"client_call_id":"5799e4d0-f7e2-46f7-97c0-4ae276a5f999","status":"completed"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_chat_tool_result","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"read","key":"agents.read"},{"model":"chat_history_entries","action":"create","key":"chat_history_entries.create"}]}},"/api/v1/agent/mcp/chats/{chat_id}/servers/{mcp_client_id}/model-context":{"post":{"tags":["v1/Agent/mcp"],"summary":"Update model context from a chat app","description":"Save an anchored app's context for future model turns. Each update replaces that app's earlier context.\n\nRequired permissions:\n- `agents.read`\n- `chat_history_entries.create`","operationId":"updateMcpChatAppModelContext","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"mcp_client_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Client Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatModelContextBody","example":{"app_history_part_id":"7442551216804781021"},"properties":{"app_history_part_id":{"examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"App History Part Id","type":"integer"},"content":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Content"},"structuredContent":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structuredcontent"}},"required":["app_history_part_id"],"title":"McpChatModelContextBody","type":"object"},"examples":{"example_1":{"value":{"app_history_part_id":"7442551216804781021"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatModelContextResponse"},"examples":{"example_1":{"value":{"history_entry_id":"7442551216804781021"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"mcp_chat_model_context","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"read","key":"agents.read"},{"model":"chat_history_entries","action":"create","key":"chat_history_entries.create"}]}},"/api/v1/agent/mcp/chats/{chat_id}/servers/{mcp_client_id}/messages":{"post":{"tags":["v1/Agent/mcp"],"summary":"Send an app message to the chat agent","description":"Run the chat agent with text forwarded from an anchored MCP app by the authenticated user. Retry with the same client_message_id to inspect the original turn without running it again.\n\nRequired permissions:\n- `agents.read`\n- `chats.create`\n- `chat_history_entries.create`","operationId":"sendMcpChatAppMessage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"mcp_client_id","in":"path","required":true,"schema":{"type":"integer","title":"Mcp Client Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatAppMessageBody","example":{"app_history_part_id":"7442551216804781021","client_message_id":"<client_message_id>","prompt":"Summarize this view."},"properties":{"app_history_part_id":{"examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"App History Part Id","type":"integer"},"client_message_id":{"format":"uuid","title":"Client Message Id","type":"string"},"prompt":{"examples":["Summarize this view."],"maxLength":8192,"minLength":1,"title":"Prompt","type":"string"}},"required":["app_history_part_id","client_message_id","prompt"],"title":"McpChatAppMessageBody","type":"object"},"examples":{"example_1":{"value":{"app_history_part_id":"7442551216804781021","client_message_id":"<client_message_id>","prompt":"Summarize this view."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpChatAppMessageResponse"},"examples":{"example_1":{"value":{"client_message_id":"<client_message_id>","status":"<status>","chat_id":"<chat_id>","result":{"type":"text","message":"Hello! How can I help?","chat_id":"7442550215703679004","history_id":"7442551216804781021","html_render":{"version":1,"title":"Calculator","height":600,"history_part_id":"7442551216804781344"},"history_part_types":{"7442551216804781021":"text","7442551216804781198":"tool_call","7442551216804781344":"tool_return","7442551216804781509":"text"}}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chat","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"read","key":"agents.read"},{"model":"chats","action":"create","key":"chats.create"},{"model":"chat_history_entries","action":"create","key":"chat_history_entries.create"}]}},"/api/v1/agent/files/upload":{"post":{"tags":["v1/Agent/files"],"summary":"Upload agent knowledge files","description":"Upload files as storage objects, create knowledge files, and start knowledge processing. Assigning them to agents additionally requires update access to each requested agent.\n\nRequired permissions:\n- `storage_objects.create`\n- `knowledgefile.create`","operationId":"uploadAgentKnowledgeFiles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/KnowledgeFileUploadBody","$defs":{"RequireAllowedKnowledgeFileUpload":{"format":"binary","type":"string"}},"example":{"agent_ids":["7442550215703679004","7442550215703679137"],"files":["report.pdf","summary.txt"]},"properties":{"files":{"description":"Knowledge files to upload.","examples":[["report.pdf","summary.txt"]],"items":{"$ref":"#/$defs/RequireAllowedKnowledgeFileUpload"},"minItems":1,"title":"Files","type":"array"},"agent_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"description":"Optional agent IDs to associate with each uploaded knowledge file.","examples":[[7442550215703679004,7442550215703679137]],"title":"Agent Ids"}},"required":["files"],"title":"KnowledgeFileUploadBody","type":"object"},"examples":{"example_1":{"value":{"files":["report.pdf","summary.txt"],"agent_ids":["7442550215703679004","7442550215703679137"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeFileUploadResponse"},"examples":{"example_1":{"value":{"uploaded_files":{"report.pdf":"7442551216804781021","summary.txt":"7442551216804781198"},"processing_tasks":{"report.pdf":"7442550215703679004","summary.txt":"7442550215703679137"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_files","x-auth-context":"tenant","x-required-permissions":[{"model":"storage_objects","action":"create","key":"storage_objects.create"},{"model":"knowledgefile","action":"create","key":"knowledgefile.create"}]}},"/api/v1/agent/files/assign":{"post":{"tags":["v1/Agent/files"],"summary":"Assign files to agents","description":"Assign files to agents.\n\nRequired permissions:\n- `agents.update`\n- `knowledgefile.update`","operationId":"assignAgentFiles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignAgentFilesBody","$defs":{"AgentFileBase":{"properties":{"agent_ids":{"description":"Agent IDs.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"items":{"type":"integer"},"minItems":1,"title":"Agent Ids","type":"array"},"file_ids":{"description":"File IDs.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"minItems":1,"title":"File Ids","type":"array"}},"required":["agent_ids","file_ids"],"title":"AgentFileBase","type":"object"}},"example":{"agent_file_assign":["<agent_file_assign>"]},"properties":{"agent_file_assign":{"description":"Agent-file assignments to create.","items":{"$ref":"#/$defs/AgentFileBase"},"title":"Agent File Assign","type":"array"}},"required":["agent_file_assign"],"title":"AssignAgentFilesBody","type":"object"},"examples":{"example_1":{"value":{"agent_file_assign":["<agent_file_assign>"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignAgentFilesResponse"},"examples":{"example_1":{"value":{"assigned":{"7442550215703679004":["7442551216804781021"]},"failed":{"7442551216804781198":"File not found."}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_files","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"},{"model":"knowledgefile","action":"update","key":"knowledgefile.update"}]}},"/api/v1/agent/files/unassign":{"patch":{"tags":["v1/Agent/files"],"summary":"Unassign files from agents","description":"Unassign files from agents.\n\nRequired permissions:\n- `agents.update`\n- `knowledgefile.update`","operationId":"unassignAgentFiles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnassignAgentFilesBody","$defs":{"AgentFileBase":{"properties":{"agent_ids":{"description":"Agent IDs.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"items":{"type":"integer"},"minItems":1,"title":"Agent Ids","type":"array"},"file_ids":{"description":"File IDs.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"minItems":1,"title":"File Ids","type":"array"}},"required":["agent_ids","file_ids"],"title":"AgentFileBase","type":"object"}},"example":{"agent_file_unassign":["<agent_file_unassign>"]},"properties":{"agent_file_unassign":{"description":"Agent-file assignments to remove.","items":{"$ref":"#/$defs/AgentFileBase"},"title":"Agent File Unassign","type":"array"}},"required":["agent_file_unassign"],"title":"UnassignAgentFilesBody","type":"object"},"examples":{"example_1":{"value":{"agent_file_unassign":["<agent_file_unassign>"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnassignAgentFilesResponse"},"examples":{"example_1":{"value":{"unassigned":{"7442550215703679004":["7442551216804781021"]},"failed":{"7442551216804781198":"File was not assigned to the agent."}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_files","x-auth-context":"tenant","x-required-permissions":[{"model":"agents","action":"update","key":"agents.update"},{"model":"knowledgefile","action":"update","key":"knowledgefile.update"}]}},"/api/v1/agent/files/download":{"post":{"tags":["v1/Agent/files"],"summary":"Download agent knowledge files","description":"Download one or more agent knowledge files by ID.\n\nRequired permissions:\n- `knowledgefile.read`","operationId":"downloadAgentKnowledgeFiles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeFileDownloadBody","example":{"file_ids":["7442551216804781021"]},"properties":{"file_ids":{"description":"Knowledge file IDs to download.","examples":[[7442551216804781021],[7442551216804781021,7442551216804781198]],"items":{"type":"integer"},"minItems":1,"title":"File Ids","type":"array"}},"required":["file_ids"],"title":"KnowledgeFileDownloadBody","type":"object"},"examples":{"example_1":{"value":{"file_ids":["7442551216804781021"]}}}}}},"responses":{"200":{"description":"Requested file, or a zip archive when multiple files are requested.","content":{"application/json":{"schema":{}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_files","x-auth-context":"tenant","x-file-response":{"media_types":["application/octet-stream","application/zip"]},"x-required-permissions":[{"model":"knowledgefile","action":"read","key":"knowledgefile.read"}]}},"/api/v1/agent/files/delete":{"delete":{"tags":["v1/Agent/files"],"summary":"Delete agent knowledge files","description":"Delete one or more agent knowledge files and their unreferenced storage objects by ID.\n\nRequired permissions:\n- `knowledgefile.delete`","operationId":"deleteAgentKnowledgeFiles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeFileDeleteBody","example":{"file_ids":["7442551216804781021"]},"properties":{"file_ids":{"description":"Knowledge file IDs to delete.","examples":[[7442551216804781021],[7442551216804781021,7442551216804781198]],"items":{"type":"integer"},"maxItems":100,"minItems":1,"title":"File Ids","type":"array"}},"required":["file_ids"],"title":"KnowledgeFileDeleteBody","type":"object"},"examples":{"example_1":{"value":{"file_ids":["7442551216804781021"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeFileDeleteResponse"},"examples":{"example_1":{"value":{"message":"2 knowledge files deleted successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"agent_files","x-auth-context":"tenant","x-required-permissions":[{"model":"knowledgefile","action":"delete","key":"knowledgefile.delete"}]}},"/api/v1/agent/library/prompts":{"post":{"tags":["v1/Agent/library"],"summary":"Create Prompts","description":"Creates prompt library entries in bulk and returns partial-success results.\n\nRequired permissions:\n- `prompt_library.create`","operationId":"createPrompt","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromptsBody","$defs":{"CreateItem":{"example":{"content":"Write a follow-up email for {customer_name} after meeting about {topic}. Use tone {tone}.","folder_id":"744128060820239091","name":"Meeting follow-up","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"tone":{"default":"professional","description":"Desired writing tone."},"topic":{"description":"Main topic to address.","required":true}}},"properties":{"name":{"description":"Display name of the prompt entry.","examples":["Meeting follow-up","Customer onboarding","Incident summary"],"minLength":1,"title":"Name","type":"string"},"content":{"description":"Prompt content to store in the prompt library.","examples":["Write a follow-up email for {customer_name} after meeting about {topic}. Use tone {tone}.","Draft an onboarding message for {customer_name} covering {product_area}.","Summarize the incident for {customer_name} including impact {impact_level}."],"minLength":1,"title":"Content","type":"string"},"folder_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional folder identifier used to place the prompt within the library.","examples":[744128060820239091],"title":"Folder Id"},"variable_json":{"additionalProperties":{"$ref":"#/$defs/VariableDefinition"},"description":"Optional variable definitions keyed by placeholder name used in the prompt content.","examples":[{"customer_name":{"description":"Name of the customer.","required":true},"tone":{"default":"professional","description":"Desired writing tone."},"topic":{"description":"Main topic to address.","required":true}},{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to introduce.","required":true}},{"customer_name":{"description":"Name of the customer.","required":true},"impact_level":{"default":"high","description":"Incident impact severity."}}],"title":"Variable Json","type":"object"}},"required":["name","content"],"title":"CreateItem","type":"object"},"VariableDefinition":{"example":{"default":"professional","description":"Name of the customer.","required":true},"properties":{"default":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional default value for the variable.","examples":["professional","friendly","high"],"title":"Default"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional description of the variable.","examples":["Name of the customer.","Main topic to address.","Desired writing tone."],"title":"Description"},"required":{"default":false,"description":"Whether the variable must be provided.","examples":[true,false],"title":"Required","type":"boolean"}},"title":"VariableDefinition","type":"object"}},"example":{"prompts":[{"content":"Welcome to our platform! We are excited to have you onboard.","folder_id":null,"name":"Welcome message","variable_json":{}}]},"properties":{"prompts":{"description":"Prompt entries to create in bulk.","examples":[[{"content":"Welcome to our platform! We are excited to have you onboard.","folder_id":null,"name":"Welcome message","variable_json":{}}],[{"content":"Please review the meeting notes attached above.","folder_id":7442678451937742086,"name":"Meeting follow-up","variable_json":{}}],[{"content":"Write a follow-up email for {customer_name} after meeting about {topic}. Use tone {tone}.","folder_id":7442678451937742086,"name":"Meeting follow-up","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"tone":{"default":"professional","description":"Desired writing tone."},"topic":{"description":"Main topic to address.","required":true}}}],[{"content":"Summarize the incident for {customer_name} including impact {impact_level}.","folder_id":null,"name":"Incident summary","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"impact_level":{"default":"high","description":"Incident impact severity."}}}],[{"content":"We value your feedback, {customer_name}! Please rate {product_area} on a scale of 1-5.","folder_id":7442678451937742214,"name":"Customer survey","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to review.","required":true}}},{"content":"Draft an onboarding message for {customer_name} covering {product_area}.","folder_id":7442678451937742214,"name":"Customer onboarding","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to introduce.","required":true}}}]],"items":{"$ref":"#/$defs/CreateItem"},"minItems":1,"title":"Prompts","type":"array"}},"required":["prompts"],"title":"CreatePromptsBody","type":"object"},"examples":{"create_prompt_minimal":{"summary":"Create prompt without folder and without variables","value":{"prompts":[{"name":"Welcome message","content":"Welcome to our platform! We are excited to have you onboard.","folder_id":null,"variable_json":{}}]}},"create_prompt_with_folder":{"summary":"Create prompt with folder and without variables","value":{"prompts":[{"name":"Meeting follow-up","content":"Please review the meeting notes attached above.","folder_id":"7442678451937742086","variable_json":{}}]}},"create_prompt_with_folder_and_variables":{"summary":"Create prompt with folder and variables","value":{"prompts":[{"name":"Meeting follow-up","content":"Write a follow-up email for {customer_name} after meeting about {topic}. Use tone {tone}.","folder_id":"7442678451937742086","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"topic":{"description":"Main topic to address.","required":true},"tone":{"default":"professional","description":"Desired writing tone."}}}]}},"create_prompt_at_root_with_variables":{"summary":"Create prompt at root level with variables","value":{"prompts":[{"name":"Incident summary","content":"Summarize the incident for {customer_name} including impact {impact_level}.","folder_id":null,"variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"impact_level":{"default":"high","description":"Incident impact severity."}}}]}},"create_prompt_bulk":{"summary":"Create multiple prompts in a single request","value":{"prompts":[{"name":"Customer survey","content":"We value your feedback, {customer_name}! Please rate {product_area} on a scale of 1-5.","folder_id":"7442678451937742214","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to review.","required":true}}},{"name":"Customer onboarding","content":"Draft an onboarding message for {customer_name} covering {product_area}.","folder_id":"7442678451937742214","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to introduce.","required":true}}}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromptsResponse"},"examples":{"create_prompt_no_failure":{"summary":"No failure","value":{"created_prompts":{"Meeting follow-up":7442550215703679004,"Customer onboarding":7442550215703679137},"failed_prompts":[]}},"create_prompt_single_failure":{"summary":"Single failure","value":{"created_prompts":{"Meeting follow-up":7442551216804781021},"failed_prompts":["Incident summary"]}},"create_prompt_partial_success":{"summary":"Partial success","value":{"created_prompts":{"Meeting follow-up":7442550215703679004},"failed_prompts":["Customer onboarding","Incident summary"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"library","x-auth-context":"tenant","x-required-permissions":[{"model":"prompt_library","action":"create","key":"prompt_library.create"}]}},"/api/v1/agent/library/prompts/{prompt_id}":{"patch":{"tags":["v1/Agent/library"],"summary":"Update Prompt","description":"Updates a prompt library entry by identifier and returns the updated prompt identifier.\n\nRequired permissions:\n- `prompt_library.update`","operationId":"updatePrompt","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prompt_id","in":"path","required":true,"schema":{"type":"integer","title":"Prompt Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePromptsBody","$defs":{"VariableDefinition":{"example":{"default":"professional","description":"Name of the customer.","required":true},"properties":{"default":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional default value for the variable.","examples":["professional","friendly","high"],"title":"Default"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional description of the variable.","examples":["Name of the customer.","Main topic to address.","Desired writing tone."],"title":"Description"},"required":{"default":false,"description":"Whether the variable must be provided.","examples":[true,false],"title":"Required","type":"boolean"}},"title":"VariableDefinition","type":"object"}},"example":{"content":"Write a follow-up email for {customer_name} about {topic}.","name":"Meeting follow-up v2","variable_json":{"customer_name":{"default":null,"description":"Name of the customer.","required":true},"topic":{"default":null,"description":"Main topic to address.","required":true}}},"properties":{"name":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated display name of the prompt entry. Value is trimmed; null/blank values are rejected when this field is provided.","examples":["Meeting follow-up v2","Customer onboarding draft","Incident summary final"],"title":"Name"},"content":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated prompt content. Value is trimmed; null/blank values are rejected when this field is provided. If content and/or variable_json are updated, placeholders and variable keys must match exactly.","examples":["Write a follow-up email for {customer_name} about {topic}.","Draft an onboarding note for {customer_name} introducing {product_area}.","Summarize the incident for {customer_name} with impact {impact_level} and next steps."],"title":"Content"},"variable_json":{"anyOf":[{"additionalProperties":{"$ref":"#/$defs/VariableDefinition"},"type":"object"},{"type":"null"}],"description":"Updated variable definitions mapped to prompt placeholders. Each variable may include description, required, and default. You may update this field with or without content, but placeholders and variable keys must always match exactly.","examples":[{"customer_name":{"default":null,"description":"Name of the customer.","required":true},"topic":{"default":null,"description":"Main topic to address.","required":true}}],"title":"Variable Json"}},"title":"UpdatePromptsBody","type":"object"},"examples":{"update_name_only":{"summary":"Update name only","value":{"name":"Meeting follow-up v2"}},"update_content":{"summary":"Update content","value":{"content":"Write a follow-up email for {customer_name} about {topic}."}},"update_all":{"summary":"Update name, content and variables","value":{"name":"Customer onboarding draft","content":"Draft an onboarding note for {customer_name} introducing {product_area}.","variable_json":{"customer_name":{"description":"Name of the customer.","required":true,"default":null},"topic":{"description":"Main topic to address.","required":true,"default":null}}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePromptsResponse"},"examples":{"update_success":{"summary":"Update successful","value":{"prompt_id":7442550215703679004}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"library","x-auth-context":"tenant","x-required-permissions":[{"model":"prompt_library","action":"update","key":"prompt_library.update"}]}},"/api/v1/agent/library/prompts/move":{"post":{"tags":["v1/Agent/library"],"summary":"Move Prompts","description":"Moves prompt library entries to another folder or to the root library and returns grouped folder transition results.\n\nRequired permissions:\n- `prompt_library.update`","operationId":"movePrompt","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MovePromptsBody","example":{"folder_id":"7442678451937742214","prompt_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]},"properties":{"prompt_ids":{"description":"Identifiers of prompt entries to move.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"minItems":1,"title":"Prompt Ids","type":"array","uniqueItems":true},"folder_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Target folder identifier. Set to null to move prompts to root.","examples":[7442678451937742214,null],"title":"Folder Id"}},"required":["prompt_ids"],"title":"MovePromptsBody","type":"object"},"examples":{"move_to_folder":{"summary":"Move prompts to folder","value":{"prompt_ids":["7442550215703679004"],"folder_id":"7442678451937742214"}},"move_to_root":{"summary":"Move prompts to root","value":{"prompt_ids":["7442550215703679412","7442550215703679137","7442550215703679284","7442550215703679004"],"folder_id":null}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MovePromptsResponse"},"examples":{"move_success":{"summary":"Moved to folder","value":{"moves":[{"prompt_ids":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"folder_id":{"previous":"7442678451937742389","new":"7442678451937742214"}}]}},"move_to_root":{"summary":"Moved to root","value":{"moves":[{"prompt_ids":[744128060820239091],"folder_id":{"previous":"7442678451937742214","new":null}}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"library","x-auth-context":"tenant","x-required-permissions":[{"model":"prompt_library","action":"update","key":"prompt_library.update"}]}},"/api/v1/agent/library/prompts/delete":{"delete":{"tags":["v1/Agent/library"],"summary":"Delete Prompts","description":"Deletes prompt library entries in bulk and returns identifiers for deleted and missing prompt entries.\n\nRequired permissions:\n- `prompt_library.delete`","operationId":"deletePrompt","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePromptsBody","example":{"prompt_ids":["7442550215703679412","7442550215703679137","744128060820239091","7442550215703679284","7442550215703679004"]},"properties":{"prompt_ids":{"description":"Identifiers of prompt entries to delete.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412,744128060820239091],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"minItems":1,"title":"Prompt Ids","type":"array","uniqueItems":true}},"required":["prompt_ids"],"title":"DeletePromptsBody","type":"object"},"examples":{"delete_multiple":{"summary":"Delete multiple prompts","value":{"prompt_ids":["7442550215703679137","744128060820239091","7442550215703679412","7442550215703679284","7442550215703679004"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePromptsResponse"},"examples":{"delete_all_success":{"summary":"All prompts deleted","value":{"deleted_prompt_ids":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"missing_prompt_ids":[]}},"delete_with_missing":{"summary":"Some prompts not found","value":{"deleted_prompt_ids":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"missing_prompt_ids":[744128060820239091]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"library","x-auth-context":"tenant","x-required-permissions":[{"model":"prompt_library","action":"delete","key":"prompt_library.delete"}]}},"/api/v1/agent/library/folders/create":{"post":{"tags":["v1/Agent/library"],"summary":"Create Folders","description":"Creates prompt library folders in bulk and returns created and failed folder identifiers.\n\nRequired permissions:\n- `prompt_library_folder.create`","operationId":"createFolder","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFoldersBody","$defs":{"FolderCreateItem":{"example":{"name":"Sales"},"properties":{"name":{"description":"Display name of the folder.","examples":["Sales","Marketing","Support"],"maxLength":40,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"FolderCreateItem","type":"object"}},"example":{"folders":[{"name":"Sales"},{"name":"Marketing"}]},"properties":{"folders":{"description":"Prompt library folders to create in bulk.","examples":[[{"name":"Sales"},{"name":"Marketing"}],[{"name":"Support"}]],"items":{"$ref":"#/$defs/FolderCreateItem"},"minItems":1,"title":"Folders","type":"array"}},"required":["folders"],"title":"CreateFoldersBody","type":"object"},"examples":{"create_multiple_folders":{"summary":"Create multiple folders","value":{"folders":[{"name":"Sales"},{"name":"Marketing"}]}},"create_single_folder":{"summary":"Create single folder","value":{"folders":[{"name":"Support"}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFoldersResponse"},"examples":{"create_folder_all_created":{"summary":"All folders created","value":{"created_folders":{"Sales":7442678451937742086,"Marketing":7442678451937742214},"failed_folders":[]}},"create_folder_partial_failure":{"summary":"Partial failure","value":{"created_folders":{"Sales":7442678451937742086},"failed_folders":["Marketing"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"library","x-auth-context":"tenant","x-required-permissions":[{"model":"prompt_library_folder","action":"create","key":"prompt_library_folder.create"}]}},"/api/v1/agent/library/folders/{folder_id}":{"patch":{"tags":["v1/Agent/library"],"summary":"Update Folder","description":"Updates a prompt library folder and returns the applied folder name changes.\n\nRequired permissions:\n- `prompt_library_folder.update`","operationId":"updateFolder","security":[{"HTTPBearer":[]}],"parameters":[{"name":"folder_id","in":"path","required":true,"schema":{"type":"integer","title":"Folder Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderBody","example":{"name":"Sales_Outdated"},"properties":{"name":{"description":"Updated display name of the folder.","examples":["Sales_Outdated","Marketing_Archive","Support_Legacy"],"maxLength":40,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"UpdateFolderBody","type":"object"},"examples":{"rename_folder":{"summary":"Rename folder","value":{"name":"Sales_Outdated"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderResponse"},"examples":{"rename_success":{"summary":"Folder renamed","value":{"name":{"previous":"Sales","new":"Sales_Outdated"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"library","x-auth-context":"tenant","x-required-permissions":[{"model":"prompt_library_folder","action":"update","key":"prompt_library_folder.update"}]}},"/api/v1/agent/library/folders/delete":{"delete":{"tags":["v1/Agent/library"],"summary":"Delete Folders","description":"Deletes prompt library folders in bulk including all prompts contained within the folders and returns deleted and missing folder identifiers.\n\nRequired permissions:\n- `prompt_library_folder.delete`","operationId":"deleteFolder","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteFoldersBody","example":{"folder_ids":["7442550215703679412","7442550215703679137","744128060820239091","7442550215703679284","7442550215703679004"]},"properties":{"folder_ids":{"description":"Identifiers of prompt library folders to delete; Important: Deleting a folder also deletes all prompts contained in that folder.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412,744128060820239091],[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]],"items":{"type":"integer"},"minItems":1,"title":"Folder Ids","type":"array","uniqueItems":true}},"required":["folder_ids"],"title":"DeleteFoldersBody","type":"object"},"examples":{"delete_folder_multiple":{"summary":"Delete multiple folders","value":{"folder_ids":["7442550215703679137","744128060820239091","7442550215703679412","7442550215703679284","7442550215703679004"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteFoldersResponse"},"examples":{"delete_folder_all_success":{"summary":"All folders deleted","value":{"deleted_folder_ids":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520],"missing_folder_ids":[]}},"delete_folder_with_missing":{"summary":"Some folders not found","value":{"deleted_folder_ids":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880],"missing_folder_ids":[744128060820239091]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"library","x-auth-context":"tenant","x-required-permissions":[{"model":"prompt_library_folder","action":"delete","key":"prompt_library_folder.delete"}]}},"/api/v1/agent/chat/{agent_id}/chat":{"post":{"tags":["v1/Agent/chat"],"summary":"Chat with agent","description":"Run an agent with a prompt, uploaded media, or linked storage objects and return the completed response.\n\nRequired permissions:\n- `chats.create`\n- `chat_history_entries.create`","operationId":"chatAwait","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ChatAwaitBody","$defs":{"McpAppMessageOrigin":{"example":{"app_history_part_id":"7442551216804781021","mcp_client_id":"7442550215703679004"},"properties":{"mcp_client_id":{"examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Mcp Client Id","type":"integer"},"app_history_part_id":{"examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"App History Part Id","type":"integer"},"client_message_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Client Message Id"},"prompt_digest":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Digest"}},"required":["mcp_client_id","app_history_part_id"],"title":"McpAppMessageOrigin","type":"object"},"RequireAllowedChatMediaUpload":{"format":"binary","type":"string"}},"example":{"app_origin":{"app_history_part_id":"7442551216804781021","mcp_client_id":"7442550215703679004"},"chat_id":"7442550215703679004","media":["report.pdf","summary.txt"],"prompt":"Hello LIVOI, how can you help me?","storage_object_ids":["7442551216804781021","7442551216804781198"]},"properties":{"chat_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"ID of the chat to continue.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Chat Id"},"app_origin":{"anyOf":[{"$ref":"#/$defs/McpAppMessageOrigin"},{"type":"null"}]},"supports_mcp_apps":{"default":false,"description":"Whether the chat client can render MCP Apps. Omit for text-only tool results.","title":"Supports Mcp Apps","type":"boolean"},"supports_html_renders":{"default":false,"description":"Set to true when this client can display interactive HTML attachments. The agent may then publish one per response. The response field `html_render` and its history part (file_handling `html_render`) identify it; read the document with readChatHtmlRender, which requires read access to the chat and its history. Send the same value on every request from a client.","title":"Supports Html Renders","type":"boolean"},"prompt":{"anyOf":[{"maxLength":65536,"type":"string"},{"type":"null"}],"description":"User input prompt.","examples":["Hello LIVOI, how can you help me?","How can you save me time?","Which documents can I upload?"],"title":"Prompt"},"media":{"anyOf":[{"items":{"$ref":"#/$defs/RequireAllowedChatMediaUpload"},"minItems":1,"type":"array"},{"type":"null"}],"description":"Uploaded media files.","examples":[["report.pdf","summary.txt"],null],"title":"Media"},"storage_object_ids":{"anyOf":[{"items":{"type":"integer"},"minItems":1,"type":"array"},{"type":"null"}],"description":"Existing storage object IDs to attach to the message.","examples":[[7442551216804781021,7442551216804781198],null],"title":"Storage Object Ids"}},"title":"ChatAwaitBody","type":"object"},"examples":{"example_1":{"value":{"chat_id":"7442550215703679004","app_origin":{"mcp_client_id":"7442550215703679004","app_history_part_id":"7442551216804781021"},"prompt":"Hello LIVOI, how can you help me?","media":["report.pdf","summary.txt"],"storage_object_ids":["7442551216804781021","7442551216804781198"]}},"example_2":{"value":{"chat_id":"7442550215703679137","app_origin":{"mcp_client_id":"7442550215703679137","app_history_part_id":"7442551216804781198"},"prompt":"How can you save me time?"}},"example_3":{"value":{"chat_id":"7442550215703679284","app_origin":{"mcp_client_id":"7442550215703679284","app_history_part_id":"7442551216804781344"},"prompt":"Which documents can I upload?","media":["report.pdf","summary.txt"],"storage_object_ids":["7442551216804781021","7442551216804781198"]}},"example_4":{"value":{"chat_id":"7442550215703679412","app_origin":{"mcp_client_id":"7442550215703679412","app_history_part_id":"7442551216804781509"},"prompt":"Hello LIVOI, how can you help me?","media":["report.pdf","summary.txt"],"storage_object_ids":["7442551216804781021","7442551216804781198"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAwaitResponse"},"examples":{"example_1":{"value":{"type":"text","message":"Hello! How can I help?","chat_id":"7442550215703679004","history_id":"7442551216804781021","html_render":{"version":1,"title":"Calculator","height":600,"history_part_id":"7442551216804781344"},"history_part_types":{"7442551216804781021":"text","7442551216804781198":"tool_call","7442551216804781344":"tool_return","7442551216804781509":"text"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chat","x-auth-context":"tenant","x-required-permissions":[{"model":"chats","action":"create","key":"chats.create"},{"model":"chat_history_entries","action":"create","key":"chat_history_entries.create"}]}},"/api/v1/agent/chat/{agent_id}/stream":{"post":{"tags":["v1/Agent/chat"],"summary":"Stream chat with agent","description":"Run an agent with a prompt, uploaded media, or linked storage objects. HTTP 200 starts the NDJSON stream. A finished run sends chat metadata and an end event; when the agent fails, the metadata carries its failure message. Other failures after streaming begins are reported as an error event. Once the prompt is saved to chat history, closing the HTTP connection stops only response delivery; the run continues and saves its reply. If the client falls behind or the server restarts, the stream ends with a 503 error event; reload the chat history for the final reply. While no other output is sent, the stream sends an empty line every 15 seconds to keep the connection open; ignore empty lines.\n\nRequired permissions:\n- `chats.create`\n- `chat_history_entries.create`","operationId":"chatStream","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ChatStreamBody","$defs":{"McpAppMessageOrigin":{"example":{"app_history_part_id":"7442551216804781021","mcp_client_id":"7442550215703679004"},"properties":{"mcp_client_id":{"examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Mcp Client Id","type":"integer"},"app_history_part_id":{"examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"App History Part Id","type":"integer"},"client_message_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Client Message Id"},"prompt_digest":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Digest"}},"required":["mcp_client_id","app_history_part_id"],"title":"McpAppMessageOrigin","type":"object"},"RequireAllowedChatMediaUpload":{"format":"binary","type":"string"}},"example":{"app_origin":{"app_history_part_id":"7442551216804781021","mcp_client_id":"7442550215703679004"},"chat_id":"7442550215703679004","media":["report.pdf","summary.txt"],"prompt":"Hello LIVOI, how can you help me?","storage_object_ids":["7442551216804781021","7442551216804781198"]},"properties":{"chat_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"ID of the chat to continue.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Chat Id"},"app_origin":{"anyOf":[{"$ref":"#/$defs/McpAppMessageOrigin"},{"type":"null"}]},"supports_mcp_apps":{"default":false,"description":"Whether the chat client can render MCP Apps. Omit for text-only tool results.","title":"Supports Mcp Apps","type":"boolean"},"supports_html_renders":{"default":false,"description":"Set to true when this client can display interactive HTML attachments. The agent may then publish one per response. The response field `html_render` and its history part (file_handling `html_render`) identify it; read the document with readChatHtmlRender, which requires read access to the chat and its history. Send the same value on every request from a client.","title":"Supports Html Renders","type":"boolean"},"prompt":{"anyOf":[{"maxLength":65536,"type":"string"},{"type":"null"}],"description":"User input prompt.","examples":["Hello LIVOI, how can you help me?","How can you save me time?","Which documents can I upload?"],"title":"Prompt"},"media":{"anyOf":[{"items":{"$ref":"#/$defs/RequireAllowedChatMediaUpload"},"minItems":1,"type":"array"},{"type":"null"}],"description":"Uploaded media files.","examples":[["report.pdf","summary.txt"],null],"title":"Media"},"storage_object_ids":{"anyOf":[{"items":{"type":"integer"},"minItems":1,"type":"array"},{"type":"null"}],"description":"Existing storage object IDs to attach to the message.","examples":[[7442551216804781021,7442551216804781198],null],"title":"Storage Object Ids"}},"title":"ChatStreamBody","type":"object"},"examples":{"example_1":{"value":{"chat_id":"7442550215703679004","app_origin":{"mcp_client_id":"7442550215703679004","app_history_part_id":"7442551216804781021"},"prompt":"Hello LIVOI, how can you help me?","media":["report.pdf","summary.txt"],"storage_object_ids":["7442551216804781021","7442551216804781198"]}},"example_2":{"value":{"chat_id":"7442550215703679137","app_origin":{"mcp_client_id":"7442550215703679137","app_history_part_id":"7442551216804781198"},"prompt":"How can you save me time?"}},"example_3":{"value":{"chat_id":"7442550215703679284","app_origin":{"mcp_client_id":"7442550215703679284","app_history_part_id":"7442551216804781344"},"prompt":"Which documents can I upload?","media":["report.pdf","summary.txt"],"storage_object_ids":["7442551216804781021","7442551216804781198"]}},"example_4":{"value":{"chat_id":"7442550215703679412","app_origin":{"mcp_client_id":"7442550215703679412","app_history_part_id":"7442551216804781509"},"prompt":"Hello LIVOI, how can you help me?","media":["report.pdf","summary.txt"],"storage_object_ids":["7442551216804781021","7442551216804781198"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/x-ndjson":{"schema":{"discriminator":{"mapping":{"data":"#/$defs/StreamDataEvent_ChatStreamResponse_","end":"#/$defs/StreamEndEvent","error":"#/$defs/StreamErrorEvent"},"propertyName":"type"},"oneOf":[{"properties":{"type":{"const":"data","default":"data","title":"Type","type":"string"},"item":{"anyOf":[{"example":{"token":"Hello! I can answer questions, help you find information, and handle recurring communications."},"properties":{"token":{"description":"Next streamed response token.","examples":["Hello! I can answer questions, help you find information, and handle recurring communications.","I save time by answering common questions, summarizing information, and preparing workflows.","You can upload PDFs, Office documents, images, and audio files, for example."],"title":"Token","type":"string"}},"required":["token"],"title":"ChatStreamToken","type":"object"},{"additionalProperties":false,"example":{"chat_id":"7442550215703679004","history_id":"7442551216804781021","history_part_types":{"123":"text","124":"tool_call","125":"tool_return","126":"text"},"html_render":{"height":600,"history_part_id":"7442551216804781344","title":"Calculator","version":1},"message":"Hello! How can I help?","type":"text"},"properties":{"type":{"enum":["text","structured_output"],"type":"string","description":"Whether message contains plain text or a validated structured output.","examples":["text"]},"message":{"anyOf":[{"type":"string"},{"additionalProperties":{},"type":"object"}],"description":"Plain text or the validated configured output object.","examples":["Hello! How can I help?"],"title":"Message"},"chat_id":{"description":"Chat session ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Chat Id","type":"integer"},"history_id":{"description":"Assistant history entry ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"History Id","type":"integer"},"html_render":{"anyOf":[{"additionalProperties":false,"properties":{"version":{"const":1,"default":1,"description":"Metadata version.","title":"Version","type":"integer"},"title":{"description":"Short name of the attachment.","maxLength":160,"minLength":1,"title":"Title","type":"string"},"height":{"description":"Expected content height in CSS pixels. Use it as the initial frame height and, on phones, as the maximum frame height.","maximum":2000,"minimum":80,"title":"Height","type":"integer"},"history_part_id":{"description":"History part of the attachment. Pass it to readChatHtmlRender to read the document.","title":"History Part Id","type":"integer"}},"required":["title","height","history_part_id"],"title":"ChatResponseHtmlRender","type":"object"},{"type":"null"}],"description":"Interactive HTML attachment published in this response, if any. Requires supports_html_renders.","examples":[{"height":600,"history_part_id":"7442551216804781344","title":"Calculator","version":1},null]},"history_part_types":{"additionalProperties":{"type":"string"},"description":"Ordered mapping of visible history part IDs to their types.","examples":[{"123":"text","124":"tool_call","125":"tool_return","126":"text"}],"title":"History Part Types","type":"object"}},"required":["type","message","chat_id","history_id"],"title":"ChatStreamMetadata","type":"object"}]},"error":{"title":"Error","type":"null"}},"required":["item"],"title":"StreamDataEventOfChatStreamResponse","type":"object"},{"properties":{"type":{"const":"error","default":"error","title":"Type","type":"string"},"item":{"title":"Item","type":"null"},"error":{"example":{"errors":[{"cause":null,"context":null,"info":"Unexpected internal server error occurred.","type":null}],"status_code":"500","status_message":"Internal Server Error"},"properties":{"status_code":{"description":"HTTP status code of the error","title":"Status Code","type":"string"},"status_message":{"description":"Reason phrase for the HTTP status code","title":"Status Message","type":"string"},"errors":{"description":"List of errors","items":{"properties":{"info":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable addition to explain the error","title":"Info"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The type of exception","title":"Type"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Additional information about the error","title":"Context"},"cause":{"anyOf":[{"additionalProperties":true,"properties":{"details":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Detailed information about the cause","title":"Details"},"value":{"anyOf":[{"type":"string"},{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The value associated with the cause","title":"Value"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The location associated with the cause","title":"Location"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional machine-readable error code","title":"Code"}},"title":"CauseDetails","type":"object"},{"items":{"additionalProperties":true,"properties":{"details":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Detailed information about the cause","title":"Details"},"value":{"anyOf":[{"type":"string"},{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The value associated with the cause","title":"Value"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The location associated with the cause","title":"Location"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional machine-readable error code","title":"Code"}},"title":"CauseDetails","type":"object"},"type":"array"},{"type":"null"}],"description":"The underlying cause","title":"Cause"}},"title":"ErrorDetails","type":"object"},"title":"Errors","type":"array"}},"required":["status_code","status_message","errors"],"title":"ErrorResponse","type":"object"}},"required":["error"],"title":"StreamErrorEvent","type":"object"},{"properties":{"type":{"const":"end","default":"end","title":"Type","type":"string"},"item":{"title":"Item","type":"null"},"error":{"title":"Error","type":"null"}},"title":"StreamEndEvent","type":"object"}]},"examples":{"data":{"summary":"Data chunk","value":{"type":"data","item":{"token":"Hello, my name is"},"error":null}},"error":{"summary":"Error chunk","value":{"type":"error","item":null,"error":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"end":{"summary":"End chunk","value":{"type":"end","item":null,"error":null}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chat","x-auth-context":"tenant","x-stream":{"mode":"ndjson","media_type":"application/x-ndjson","item_schema":{"$defs":{"ChatOutputType":{"enum":["text","structured_output"],"type":"string"},"ChatResponseHtmlRender":{"additionalProperties":false,"properties":{"version":{"const":1,"default":1,"description":"Metadata version.","title":"Version","type":"integer"},"title":{"description":"Short name of the attachment.","maxLength":160,"minLength":1,"title":"Title","type":"string"},"height":{"description":"Expected content height in CSS pixels. Use it as the initial frame height and, on phones, as the maximum frame height.","maximum":2000,"minimum":80,"title":"Height","type":"integer"},"history_part_id":{"description":"History part of the attachment. Pass it to readChatHtmlRender to read the document.","title":"History Part Id","type":"integer"}},"required":["title","height","history_part_id"],"title":"ChatResponseHtmlRender","type":"object"},"ChatStreamMetadata":{"additionalProperties":false,"example":{"chat_id":"7442550215703679004","history_id":"7442551216804781021","history_part_types":{"123":"text","124":"tool_call","125":"tool_return","126":"text"},"html_render":{"height":600,"history_part_id":"7442551216804781344","title":"Calculator","version":1},"message":"Hello! How can I help?","type":"text"},"properties":{"type":{"$ref":"#/$defs/ChatOutputType","description":"Whether message contains plain text or a validated structured output.","examples":["text"]},"message":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#/$defs/JsonValue"},"type":"object"}],"description":"Plain text or the validated configured output object.","examples":["Hello! How can I help?"],"title":"Message"},"chat_id":{"description":"Chat session ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Chat Id","type":"integer"},"history_id":{"description":"Assistant history entry ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"History Id","type":"integer"},"html_render":{"anyOf":[{"$ref":"#/$defs/ChatResponseHtmlRender"},{"type":"null"}],"description":"Interactive HTML attachment published in this response, if any. Requires supports_html_renders.","examples":[{"height":600,"history_part_id":"7442551216804781344","title":"Calculator","version":1},null]},"history_part_types":{"additionalProperties":{"type":"string"},"description":"Ordered mapping of visible history part IDs to their types.","examples":[{"123":"text","124":"tool_call","125":"tool_return","126":"text"}],"title":"History Part Types","type":"object"}},"required":["type","message","chat_id","history_id"],"title":"ChatStreamMetadata","type":"object"},"ChatStreamToken":{"example":{"token":"Hello! I can answer questions, help you find information, and handle recurring communications."},"properties":{"token":{"description":"Next streamed response token.","examples":["Hello! I can answer questions, help you find information, and handle recurring communications.","I save time by answering common questions, summarizing information, and preparing workflows.","You can upload PDFs, Office documents, images, and audio files, for example."],"title":"Token","type":"string"}},"required":["token"],"title":"ChatStreamToken","type":"object"},"JsonValue":{}},"anyOf":[{"$ref":"#/$defs/ChatStreamToken"},{"$ref":"#/$defs/ChatStreamMetadata"}]},"error_schema":{"$defs":{"CauseDetails":{"additionalProperties":true,"properties":{"details":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Detailed information about the cause","title":"Details"},"value":{"anyOf":[{"type":"string"},{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The value associated with the cause","title":"Value"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The location associated with the cause","title":"Location"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional machine-readable error code","title":"Code"}},"title":"CauseDetails","type":"object"},"ErrorDetails":{"properties":{"info":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable addition to explain the error","title":"Info"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The type of exception","title":"Type"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Additional information about the error","title":"Context"},"cause":{"anyOf":[{"$ref":"#/$defs/CauseDetails"},{"items":{"$ref":"#/$defs/CauseDetails"},"type":"array"},{"type":"null"}],"description":"The underlying cause","title":"Cause"}},"title":"ErrorDetails","type":"object"}},"example":{"errors":[{"cause":null,"context":null,"info":"Unexpected internal server error occurred.","type":null}],"status_code":"500","status_message":"Internal Server Error"},"properties":{"status_code":{"description":"HTTP status code of the error","title":"Status Code","type":"string"},"status_message":{"description":"Reason phrase for the HTTP status code","title":"Status Message","type":"string"},"errors":{"description":"List of errors","items":{"$ref":"#/$defs/ErrorDetails"},"title":"Errors","type":"array"}},"required":["status_code","status_message","errors"],"title":"ErrorResponse","type":"object"}},"x-required-permissions":[{"model":"chats","action":"create","key":"chats.create"},{"model":"chat_history_entries","action":"create","key":"chat_history_entries.create"}]}},"/api/v1/agent/chat/{chat_id}/validate":{"post":{"tags":["v1/Agent/chat"],"summary":"Validate chat history","description":"Validate a chat history hash and optionally return changed entries.\n\nRequired permissions:\n- `chat_history_entries.read`\n- `chats.read`","operationId":"validateChatHistory","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatHistoryValidationBody","example":{"hash":"sha256:8fd4e1c67a2d28fced849ee1bb76e739","last_validation":"2026-06-08T12:00:00Z"},"properties":{"last_validation":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last validation timestamp in UTC.","examples":["2026-06-08T12:00:00Z"],"title":"Last Validation"},"hash":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Hash representing the known history state.","examples":["sha256:8fd4e1c67a2d28fced849ee1bb76e739"],"title":"Hash"}},"title":"ChatHistoryValidationBody","type":"object"},"examples":{"example_1":{"value":{"last_validation":"2026-06-08T12:00:00Z","hash":"sha256:8fd4e1c67a2d28fced849ee1bb76e739"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatHistoryValidationResponse"},"examples":{"example_1":{"value":{"hashed":"sha256:bbd4c8ef9a14f7f3134a4c5d02b6e612","diff":[{"role":"user","content":"Hello LIVOI, how can you help me?","timestamp":"2026-06-08T12:00:00Z","history_id":7442550215703679004}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chat","x-auth-context":"tenant","x-required-permissions":[{"model":"chat_history_entries","action":"read","key":"chat_history_entries.read"},{"model":"chats","action":"read","key":"chats.read"}]}},"/api/v1/agent/chat/{chat_id}/history/{history_part_id}/render":{"get":{"tags":["v1/Agent/chat"],"summary":"Read published HTML render content","description":"Read immutable HTML as inert JSON data through its authorized owning chat and history part.\n\nRequired permissions:\n- `chats.read`\n- `chat_history_entries.read`","operationId":"readChatHtmlRender","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"history_part_id","in":"path","required":true,"schema":{"type":"integer","title":"History Part Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlRenderContentResponse"},"examples":{"example_1":{"value":{"history_part_id":"7442550215703679004","storage_object_id":"7442551216804781021","html_render":{"version":1,"title":"Calculator","height":600},"html":"<!doctype html><html><body>Calculator</body></html>"}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chat","x-auth-context":"tenant","x-required-permissions":[{"model":"chats","action":"read","key":"chats.read"},{"model":"chat_history_entries","action":"read","key":"chat_history_entries.read"}]}},"/api/v1/agent/chat/delete":{"delete":{"tags":["v1/Agent/chat"],"summary":"Delete chats or histories","description":"Delete multiple chats or specific history entries.\n\nRequired permissions:\n- `chats.delete`","operationId":"deleteChats","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDeleteBody","example":{"chat_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"history_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]},"properties":{"chat_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"description":"Chat IDs to delete.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"title":"Chat Ids"},"history_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"description":"History entry IDs to delete.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"title":"History Ids"}},"title":"ChatDeleteBody","type":"object"},"examples":{"example_1":{"value":{"chat_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"history_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDeleteResponse"},"examples":{"example_1":{"value":{"status":"Successfully deleted 2 chats and their histories.","attachments_deleted":1}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chat","x-auth-context":"tenant","x-required-permissions":[{"model":"chats","action":"delete","key":"chats.delete"}]}},"/api/v1/agent/chat/{chat_id}/summarize":{"post":{"tags":["v1/Agent/chat"],"summary":"Summarize chat history","description":"Summarize a chat history.\n\nRequired permissions:\n- `chat_history_entries.read`","operationId":"summarizeChat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSummaryBody","example":{"include_prompts":true,"include_responses":true,"user_addition":"Focus on open action items and unresolved customer questions."},"properties":{"include_responses":{"default":true,"description":"Include agent responses.","examples":[true,false],"title":"Include Responses","type":"boolean"},"include_prompts":{"default":true,"description":"Include user prompts.","examples":[true,false],"title":"Include Prompts","type":"boolean"},"user_addition":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Additional summarization instruction.","examples":["Focus on open action items and unresolved customer questions."],"title":"User Addition"}},"title":"ChatSummaryBody","type":"object"},"examples":{"example_1":{"value":{"include_responses":true,"include_prompts":true,"user_addition":"Focus on open action items and unresolved customer questions."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSummaryResponse"},"examples":{"example_1":{"value":{"summary":"The customer asked about invoice status and needs a follow-up by Friday."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chat","x-auth-context":"tenant","x-required-permissions":[{"model":"chat_history_entries","action":"read","key":"chat_history_entries.read"}]}},"/api/v1/agent/labels/create":{"post":{"tags":["v1/Agent/labels"],"summary":"Create labels","description":"Create chat labels.\n\nRequired permissions:\n- `labels.create`","operationId":"createChatLabels","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelCreateBody","$defs":{"LabelBase":{"example":{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","name":"Urgent"},"properties":{"name":{"description":"Label name.","examples":["Urgent"],"minLength":1,"title":"Name","type":"string"},"description":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Label description.","examples":["Requires same-day customer follow-up."],"title":"Description"},"color_code":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"default":"#FFFFFFFF","description":"RGBA hex color code.","examples":["#FF3B30FF"],"title":"Color Code"}},"required":["name"],"title":"LabelBase","type":"object"}},"example":{"labels":[{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","name":"Urgent"}]},"properties":{"labels":{"description":"Labels to create.","examples":[{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","name":"Urgent"}],"items":{"$ref":"#/$defs/LabelBase"},"minItems":1,"title":"Labels","type":"array"}},"required":["labels"],"title":"LabelCreateBody","type":"object"},"examples":{"example_1":{"value":{"labels":[{"name":"Urgent","description":"Requires same-day customer follow-up.","color_code":"#FF3B30FF"}]}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelCreateResponse"},"examples":{"example_1":{"value":{"created":[{"name":"Urgent","description":"Requires same-day customer follow-up.","color_code":"#FF3B30FF","label_id":"7442550215703679004"}],"failed":["<failed>"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"labels","x-auth-context":"tenant","x-required-permissions":[{"model":"labels","action":"create","key":"labels.create"}]}},"/api/v1/agent/labels/update":{"patch":{"tags":["v1/Agent/labels"],"summary":"Update labels","description":"Update chat labels.\n\nRequired permissions:\n- `labels.update`","operationId":"updateChatLabels","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelUpdateBody","$defs":{"LabelUpdateItem":{"example":{"color_code":"#34C759FF","description":"Needs a response within two business days.","label_id":"7442550215703679004","name":"Follow-up"},"properties":{"label_id":{"description":"Label ID.","examples":[7442550215703679004],"title":"Label Id","type":"integer"},"name":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated name.","examples":["Follow-up"],"title":"Name"},"description":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated description.","examples":["Needs a response within two business days."],"title":"Description"},"color_code":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated color code.","examples":["#34C759FF"],"title":"Color Code"}},"required":["label_id"],"title":"LabelUpdateItem","type":"object"}},"example":{"updates":[{"color_code":"#34C759FF","label_id":"7442550215703679004","name":"Follow-up"}]},"properties":{"updates":{"description":"Label updates.","examples":[{"color_code":"#34C759FF","label_id":7442550215703679004,"name":"Follow-up"}],"items":{"$ref":"#/$defs/LabelUpdateItem"},"minItems":1,"title":"Updates","type":"array"}},"required":["updates"],"title":"LabelUpdateBody","type":"object"},"examples":{"example_1":{"value":{"updates":[{"label_id":"7442550215703679004","name":"Follow-up","color_code":"#34C759FF"}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelUpdateResponse"},"examples":{"example_1":{"value":{"updated":[{"name":"Urgent","description":"Requires same-day customer follow-up.","color_code":"#FF3B30FF","label_id":"7442550215703679004"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"labels","x-auth-context":"tenant","x-required-permissions":[{"model":"labels","action":"update","key":"labels.update"}]}},"/api/v1/agent/labels/delete":{"delete":{"tags":["v1/Agent/labels"],"summary":"Delete labels","description":"Delete chat labels.\n\nRequired permissions:\n- `labels.delete`","operationId":"deleteChatLabels","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelDeleteBody","example":{"label_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]},"properties":{"label_ids":{"description":"Label IDs to delete.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"items":{"type":"integer"},"minItems":1,"title":"Label Ids","type":"array"}},"required":["label_ids"],"title":"LabelDeleteBody","type":"object"},"examples":{"example_1":{"value":{"label_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelDeleteResponse"},"examples":{"example_1":{"value":{"message":"Deleted 2 labels.","deleted_ids":["7442550215703679004"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"labels","x-auth-context":"tenant","x-required-permissions":[{"model":"labels","action":"delete","key":"labels.delete"}]}},"/api/v1/agent/labels/assign":{"post":{"tags":["v1/Agent/labels"],"summary":"Assign labels to chats","description":"Assign labels to chats.\n\nRequired permissions:\n- `labels.update`","operationId":"assignChatLabels","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelAssignBody","$defs":{"LabelAssignBase":{"example":{"chat_id":"7442550215703679004","label_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]},"properties":{"chat_id":{"description":"Chat ID.","examples":[7442550215703679004],"title":"Chat Id","type":"integer"},"label_ids":{"description":"Label IDs.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"minItems":1,"title":"Label Ids","type":"array","uniqueItems":true}},"required":["chat_id","label_ids"],"title":"LabelAssignBase","type":"object"}},"example":{"assignments":[{"chat_id":"7442550215703679004","label_ids":["7442551216804781021"]}]},"properties":{"assignments":{"description":"Chat-label assignments.","examples":[{"chat_id":7442550215703679004,"label_ids":[7442551216804781021]}],"items":{"$ref":"#/$defs/LabelAssignBase"},"minItems":1,"title":"Assignments","type":"array"}},"required":["assignments"],"title":"LabelAssignBody","type":"object"},"examples":{"example_1":{"value":{"assignments":[{"chat_id":"7442550215703679004","label_ids":["7442551216804781021"]}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelAssignResponse"},"examples":{"example_1":{"value":{"assigned":{"7442550215703679004":["7442551216804781021"]},"failed":{"7442550215703679004":"Chat not found"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"labels","x-auth-context":"tenant","x-required-permissions":[{"model":"labels","action":"update","key":"labels.update"}]}},"/api/v1/agent/labels/unassign":{"post":{"tags":["v1/Agent/labels"],"summary":"Unassign labels from chats","description":"Unassign labels from chats.\n\nRequired permissions:\n- `labels.update`","operationId":"unassignChatLabels","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelUnassignBody","$defs":{"LabelAssignBase":{"example":{"chat_id":"7442550215703679004","label_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]},"properties":{"chat_id":{"description":"Chat ID.","examples":[7442550215703679004],"title":"Chat Id","type":"integer"},"label_ids":{"description":"Label IDs.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"minItems":1,"title":"Label Ids","type":"array","uniqueItems":true}},"required":["chat_id","label_ids"],"title":"LabelAssignBase","type":"object"}},"example":{"unassignments":[{"chat_id":"7442550215703679004","label_ids":["7442551216804781021"]}]},"properties":{"unassignments":{"description":"Chat-label unassignments.","examples":[{"chat_id":7442550215703679004,"label_ids":[7442551216804781021]}],"items":{"$ref":"#/$defs/LabelAssignBase"},"minItems":1,"title":"Unassignments","type":"array"}},"required":["unassignments"],"title":"LabelUnassignBody","type":"object"},"examples":{"example_1":{"value":{"unassignments":[{"chat_id":"7442550215703679004","label_ids":["7442551216804781021"]}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelUnassignResponse"},"examples":{"example_1":{"value":{"unassigned":{"7442550215703679004":["7442551216804781021"]},"failed":{"7442550215703679004":["7442551216804781021","7442551216804781198"]}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"labels","x-auth-context":"tenant","x-required-permissions":[{"model":"labels","action":"update","key":"labels.update"}]}},"/api/v1/agent/transcribe":{"post":{"tags":["v1/Agent/chat"],"summary":"Transcribe an audio recording","description":"Return the recording's transcript without running an agent or saving a chat, history entry, or audio object.","operationId":"transcribeAudio","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/TranscribeAudioBody","$defs":{"TranscriptionAudioUpload":{"format":"binary","type":"string"}},"additionalProperties":false,"example":{"audio":["recording.webm"]},"properties":{"audio":{"description":"One completed audio recording, at most 25 MB.","examples":[["recording.webm"]],"items":{"$ref":"#/$defs/TranscriptionAudioUpload"},"maxItems":1,"minItems":1,"title":"Audio","type":"array"}},"required":["audio"],"title":"TranscribeAudioBody","type":"object"},"examples":{"example_1":{"value":{"audio":["recording.webm"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}}},"text/plain":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}}},"text/plain":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}}},"text/plain":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}}},"text/plain":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Content Too Large","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"413","status_message":"Content Too Large","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}}},"text/plain":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}}},"text/plain":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}}},"text/plain":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant"}},"/api/v1/auth/me":{"get":{"tags":["v1/Core/auth"],"summary":"Get current authentication context","description":"Returns the currently authenticated user and tenant context.","operationId":"getMe","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"},"examples":{"example_1":{"value":{"authenticated":true,"effective_user_id":"7442550215703679004","effective_tenant_id":"7442551216804781021","real_user_id":"7442678451937742086","real_tenant_id":"7443001845129083411","request_id":"req_8f3a21c4"}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"auth_context","x-auth-context":"any"}},"/api/v1/auth/api-keys/":{"post":{"tags":["v1/Core/auth"],"summary":"Create API key","description":"Create a new tenant-bound or user-scoped API key.","operationId":"createApiKey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyBody","$defs":{"ApiKeyInstance":{"enum":["prod","staging","dev","test","local"],"title":"ApiKeyInstance","type":"string"},"ApiKeyKind":{"enum":["pk","sk","wk"],"title":"ApiKeyKind","type":"string"}},"additionalProperties":false,"example":{"description":"Used for local development","expires_at":"2027-02-10T11:22:33Z","instance":"dev","kind":"sk","name":"Local Dev Key","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"tenant_bound":true,"tenant_id":"7442551216804781021","user_id":"7442550215703679004"},"properties":{"name":{"description":"Display name of the API key.","examples":["Local Dev Key"],"title":"Name","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional description.","examples":["Used for local development"],"title":"Description"},"kind":{"$ref":"#/$defs/ApiKeyKind","description":"API key kind.","examples":["sk"]},"instance":{"$ref":"#/$defs/ApiKeyInstance","description":"API key instance.","examples":["dev"]},"tenant_bound":{"default":true,"description":"Whether the API key is bound to a tenant.","examples":[true,false],"title":"Tenant Bound","type":"boolean"},"tenant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Tenant ID for tenant-bound keys.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Tenant Id"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional owner user ID. Omit to bind tenant-scoped keys to the current user; set null for tenant-only keys.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"User Id"},"expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Optional expiration timestamp.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"],"title":"Expires At"},"permissions":{"description":"Optional permissions.","examples":[["agents.read","agents.read.any","knowledgefile.read.granted"],["users.read","users.update","groups.read"],["roles.create","roles.update","roles.delete.any"],["agents.read.own","groups.read","users.read"]],"items":{"type":"string"},"title":"Permissions","type":"array"}},"required":["name","kind","instance"],"title":"CreateApiKeyBody","type":"object"},"examples":{"example_1":{"value":{"name":"Local Dev Key","description":"Used for local development","kind":"sk","instance":"dev","tenant_bound":true,"tenant_id":"7442551216804781021","user_id":"7442550215703679004","expires_at":"2027-02-10T11:22:33Z","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"},"examples":{"example_1":{"value":{"id":"7442551216804781021","name":"Local Dev Key","kind":"sk","instance":"dev","api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","user_id":"7442678451937742086","tenant_id":"7443001845129083411","expires_at":"2027-02-10T11:22:33Z","is_superuser":true,"permissions":["agents.read","agents.read.any","knowledgefile.read.granted"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"api_key","x-auth-context":"any"},"get":{"tags":["v1/Core/auth"],"summary":"List API keys","description":"List visible API keys for the current tenant.\n\nRequired permissions:\n- `api_keys.read`","operationId":"listApiKeys","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442550215703679004","name":"Local Dev Key","kind":"sk","instance":"dev","tenant_id":"7442551216804781021","user_id":"7442678451937742086","is_active":true,"is_superuser":true,"expires_at":"2027-02-10T11:22:33Z","revoked_at":"2027-12-01T07:55:09Z","last_used_at":"2027-01-23T05:18:42Z","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"]}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"api_keys","x-auth-context":"any","x-required-permissions":[{"model":"api_keys","action":"read","key":"api_keys.read"}]}},"/api/v1/auth/api-keys/{api_key_id}":{"delete":{"tags":["v1/Core/auth"],"summary":"Delete API key","description":"Delete an API key by ID.\n\nRequired permissions:\n- `api_keys.delete`","operationId":"deleteApiKey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"type":"integer","title":"Api Key Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteApiKeyResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"api_key","x-auth-context":"any","x-required-permissions":[{"model":"api_keys","action":"delete","key":"api_keys.delete"}]}},"/api/v1/auth/api-keys/{api_key_id}/revoke":{"post":{"tags":["v1/Core/auth"],"summary":"Revoke API key","description":"Revokes an API key so it can no longer be used.\n\nRequired permissions:\n- `api_keys.update`","operationId":"revokeApiKey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"type":"integer","title":"Api Key Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeApiKeyResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"api_key","x-auth-context":"any","x-required-permissions":[{"model":"api_keys","action":"update","key":"api_keys.update"}]}},"/api/v1/automations":{"post":{"tags":["v1/Core/automations"],"summary":"Create an automation agent configuration","description":"Configure a reusable background agent before submitting prepared items.\n\nRequired permissions:\n- `automations.create`","operationId":"createAutomation","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationBody","$defs":{"AutomationConfiguration":{"additionalProperties":false,"properties":{"preparation":{"$ref":"#/$defs/PreparationPolicy"},"reason_codes":{"items":{"type":"string"},"maxItems":64,"title":"Reason Codes","type":"array","uniqueItems":true},"limits":{"$ref":"#/$defs/BackgroundLimits"}},"title":"AutomationConfiguration","type":"object"},"BackgroundLimits":{"additionalProperties":false,"properties":{"requests":{"default":8,"maximum":32,"minimum":1,"title":"Requests","type":"integer"},"tool_calls":{"default":16,"maximum":64,"minimum":1,"title":"Tool Calls","type":"integer"},"total_tokens":{"default":32000,"maximum":128000,"minimum":1,"title":"Total Tokens","type":"integer"},"output_tokens":{"default":4000,"maximum":16000,"minimum":1,"title":"Output Tokens","type":"integer"},"timeout_seconds":{"default":120,"exclusiveMinimum":0,"maximum":600,"title":"Timeout Seconds","type":"number"},"tool_timeout_seconds":{"default":20,"exclusiveMinimum":0,"maximum":60,"title":"Tool Timeout Seconds","type":"number"},"request_bytes":{"default":65536,"maximum":262144,"minimum":1,"title":"Request Bytes","type":"integer"},"response_bytes":{"default":262144,"maximum":1048576,"minimum":1,"title":"Response Bytes","type":"integer"}},"title":"BackgroundLimits","type":"object"},"PreparationPolicy":{"additionalProperties":false,"properties":{"images":{"default":"include","enum":["include","exclude"],"title":"Images","type":"string"}},"title":"PreparationPolicy","type":"object"}},"additionalProperties":false,"example":{"agent_id":"7442550215703679004","name":"Order preparation"},"properties":{"name":{"examples":["Order preparation"],"maxLength":200,"minLength":1,"title":"Name","type":"string"},"agent_id":{"examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Agent Id","type":"integer"},"configuration":{"$ref":"#/$defs/AutomationConfiguration"},"enabled":{"default":true,"title":"Enabled","type":"boolean"}},"required":["name","agent_id"],"title":"AutomationBody","type":"object"},"examples":{"example_1":{"value":{"name":"Order preparation","agent_id":"7442550215703679004"}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationView"},"examples":{"example_1":{"value":{"name":"Order preparation","agent_id":"7442550215703679004","automation_id":"7442551216804781021"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"automation","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"create","key":"automations.create"}]}},"/api/v1/automations/{automation_id}":{"put":{"tags":["v1/Core/automations"],"summary":"Update an automation configuration","description":"Update configuration for items that have not started processing. Started items retain their execution snapshot for retries.\n\nRequired permissions:\n- `automations.update`","operationId":"updateAutomation","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationBody","$defs":{"AutomationConfiguration":{"additionalProperties":false,"properties":{"preparation":{"$ref":"#/$defs/PreparationPolicy"},"reason_codes":{"items":{"type":"string"},"maxItems":64,"title":"Reason Codes","type":"array","uniqueItems":true},"limits":{"$ref":"#/$defs/BackgroundLimits"}},"title":"AutomationConfiguration","type":"object"},"BackgroundLimits":{"additionalProperties":false,"properties":{"requests":{"default":8,"maximum":32,"minimum":1,"title":"Requests","type":"integer"},"tool_calls":{"default":16,"maximum":64,"minimum":1,"title":"Tool Calls","type":"integer"},"total_tokens":{"default":32000,"maximum":128000,"minimum":1,"title":"Total Tokens","type":"integer"},"output_tokens":{"default":4000,"maximum":16000,"minimum":1,"title":"Output Tokens","type":"integer"},"timeout_seconds":{"default":120,"exclusiveMinimum":0,"maximum":600,"title":"Timeout Seconds","type":"number"},"tool_timeout_seconds":{"default":20,"exclusiveMinimum":0,"maximum":60,"title":"Tool Timeout Seconds","type":"number"},"request_bytes":{"default":65536,"maximum":262144,"minimum":1,"title":"Request Bytes","type":"integer"},"response_bytes":{"default":262144,"maximum":1048576,"minimum":1,"title":"Response Bytes","type":"integer"}},"title":"BackgroundLimits","type":"object"},"PreparationPolicy":{"additionalProperties":false,"properties":{"images":{"default":"include","enum":["include","exclude"],"title":"Images","type":"string"}},"title":"PreparationPolicy","type":"object"}},"additionalProperties":false,"example":{"agent_id":"7442550215703679004","name":"Order preparation"},"properties":{"name":{"examples":["Order preparation"],"maxLength":200,"minLength":1,"title":"Name","type":"string"},"agent_id":{"examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Agent Id","type":"integer"},"configuration":{"$ref":"#/$defs/AutomationConfiguration"},"enabled":{"default":true,"title":"Enabled","type":"boolean"}},"required":["name","agent_id"],"title":"AutomationBody","type":"object"},"examples":{"example_1":{"value":{"name":"Order preparation","agent_id":"7442550215703679004"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationView"},"examples":{"example_1":{"value":{"name":"Order preparation","agent_id":"7442550215703679004","automation_id":"7442551216804781021"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"automation","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"update","key":"automations.update"}]},"get":{"tags":["v1/Core/automations"],"summary":"Read an automation configuration","description":"Read the agent and configured reasons and limits.\n\nRequired permissions:\n- `automations.read`","operationId":"getAutomation","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationView"},"examples":{"example_1":{"value":{"name":"Order preparation","agent_id":"7442550215703679004","automation_id":"7442551216804781021"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"automation","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"read","key":"automations.read"}]}},"/api/v1/automations/{automation_id}/items":{"post":{"tags":["v1/Core/automations"],"summary":"Submit prepared content to an automation","description":"Persist prepared text and enqueue its agent in the same transaction. Capture the current authorized configuration when processing starts and retain it for retries.\n\nRequired permissions:\n- `automations.update`","operationId":"submitAutomationItem","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreparedItemBody","additionalProperties":false,"example":{"text":"<text>"},"properties":{"text":{"maxLength":200000,"minLength":1,"title":"Text","type":"string"}},"required":["text"],"title":"PreparedItemBody","type":"object"},"examples":{"example_1":{"value":{"text":"<text>"}}}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmittedItem"},"examples":{"example_1":{"value":{"item_id":"7442678451937742086","status":"pending"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"item","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"update","key":"automations.update"}]},"get":{"tags":["v1/Core/automations"],"summary":"List discovered automation items","description":"Read item identities and current status in descending identity order.\n\nRequired permissions:\n- `automations.read`","operationId":"listAutomationItems","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemListView"},"examples":{"example_1":{"value":{"items":[{"item_id":"7442678451937742086","status":"pending"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"items","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"read","key":"automations.read"}]}},"/api/v1/automations/items/{item_id}":{"get":{"tags":["v1/Core/automations"],"summary":"Read an automation item and its agent runs","description":"Read canonical outcomes and evidence through the automation read permission.\n\nRequired permissions:\n- `automations.read`","operationId":"getAutomationItem","security":[{"HTTPBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemView"},"examples":{"example_1":{"value":{"item_id":"7442678451937742086","status":"pending","automation_id":"7442551216804781021","selected_run_id":"7443001845129083411","runs":[{"run_id":"7443001845129083411","attempt":1,"error_code":"<error_code>","result":{"outcome":"ready","reason_code":"","reason":"Customer matched.","data":{"customer_id":"C-100"}},"evidence":[{"tool_name":"lookup_customer","arguments":{"name":"Example GmbH"},"result":{"customer_id":"C-100"}}]}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"item","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"read","key":"automations.read"}]}},"/api/v1/automations/{automation_id}/sources":{"post":{"tags":["v1/Core/automations"],"summary":"Connect a personal mailbox source","description":"Resolve the caller's connected mailbox and schedule discovery when enabled.\n\nRequired permissions:\n- `automations.update`","operationId":"createAutomationMailboxSource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceBody","$defs":{"EmailMailbox":{"enum":["inbox","outbox","sent","draft","spam","trash","all"],"title":"EmailMailbox","type":"string"},"MailboxFilter":{"discriminator":{"mapping":{"sender":"#/$defs/MailboxSenderFilter","tag":"#/$defs/MailboxTagFilter"},"propertyName":"kind"},"oneOf":[{"$ref":"#/$defs/MailboxSenderFilter"},{"$ref":"#/$defs/MailboxTagFilter"}]},"MailboxFilters":{"additionalProperties":false,"properties":{"mailbox":{"$ref":"#/$defs/EmailMailbox","default":"inbox"},"include":{"items":{"$ref":"#/$defs/MailboxFilter"},"maxItems":64,"title":"Include","type":"array"},"exclude":{"items":{"$ref":"#/$defs/MailboxFilter"},"maxItems":64,"title":"Exclude","type":"array"}},"title":"MailboxFilters","type":"object"},"MailboxSenderFilter":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"kind":{"const":"sender","default":"sender","title":"Kind","type":"string"}},"title":"MailboxSenderFilter","type":"object"},"MailboxTagFilter":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"kind":{"const":"tag","default":"tag","title":"Kind","type":"string"}},"title":"MailboxTagFilter","type":"object"}},"additionalProperties":false,"example":{"integration_identity_id":"7442550215703679004"},"properties":{"integration_identity_id":{"examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Integration Identity Id","type":"integer"},"filters":{"$ref":"#/$defs/MailboxFilters"},"cutoff":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Cutoff"},"enabled":{"default":false,"title":"Enabled","type":"boolean"},"interval_seconds":{"default":300,"maximum":86400,"minimum":60,"title":"Interval Seconds","type":"integer"}},"required":["integration_identity_id"],"title":"SourceBody","type":"object"},"examples":{"example_1":{"value":{"integration_identity_id":"7442550215703679004"}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceView"},"examples":{"example_1":{"value":{"source_id":"7442678451937742086","automation_id":"7442551216804781021","mailbox_identity":{"namespace":"google.oidc-sub.v1","mailbox_id":"verified-sub"},"filters":{"mailbox":"inbox"},"enabled":true,"removed":false,"revision":1,"interval_seconds":300,"failed_scans":0}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Please slow down.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"429","status_message":"Too Many Requests","errors":[{"info":"Too many requests. Please slow down.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"source","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"update","key":"automations.update"}]},"get":{"tags":["v1/Core/automations"],"summary":"List automation mailbox sources","description":"Read source configuration and intake health without granting personal mailbox access.\n\nRequired permissions:\n- `automations.read`","operationId":"listAutomationMailboxSources","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceListView"},"examples":{"example_1":{"value":{"sources":[{"source_id":"7442678451937742086","automation_id":"7442551216804781021","mailbox_identity":{"namespace":"google.oidc-sub.v1","mailbox_id":"verified-sub"},"filters":{"mailbox":"inbox"},"enabled":true,"removed":false,"revision":1,"interval_seconds":300,"failed_scans":0}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"sources","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"read","key":"automations.read"}]}},"/api/v1/automations/{automation_id}/sources/{source_id}":{"put":{"tags":["v1/Core/automations"],"summary":"Configure or pause a personal mailbox source","description":"Only the source owner can change its credentials or intake settings. Resume retains the original cutoff.\n\nRequired permissions:\n- `automations.update`","operationId":"updateAutomationMailboxSource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"integer","title":"Source Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceBody","$defs":{"EmailMailbox":{"enum":["inbox","outbox","sent","draft","spam","trash","all"],"title":"EmailMailbox","type":"string"},"MailboxFilter":{"discriminator":{"mapping":{"sender":"#/$defs/MailboxSenderFilter","tag":"#/$defs/MailboxTagFilter"},"propertyName":"kind"},"oneOf":[{"$ref":"#/$defs/MailboxSenderFilter"},{"$ref":"#/$defs/MailboxTagFilter"}]},"MailboxFilters":{"additionalProperties":false,"properties":{"mailbox":{"$ref":"#/$defs/EmailMailbox","default":"inbox"},"include":{"items":{"$ref":"#/$defs/MailboxFilter"},"maxItems":64,"title":"Include","type":"array"},"exclude":{"items":{"$ref":"#/$defs/MailboxFilter"},"maxItems":64,"title":"Exclude","type":"array"}},"title":"MailboxFilters","type":"object"},"MailboxSenderFilter":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"kind":{"const":"sender","default":"sender","title":"Kind","type":"string"}},"title":"MailboxSenderFilter","type":"object"},"MailboxTagFilter":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"kind":{"const":"tag","default":"tag","title":"Kind","type":"string"}},"title":"MailboxTagFilter","type":"object"}},"additionalProperties":false,"example":{"integration_identity_id":"7442550215703679004"},"properties":{"integration_identity_id":{"examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"Integration Identity Id","type":"integer"},"filters":{"$ref":"#/$defs/MailboxFilters"},"cutoff":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Cutoff"},"enabled":{"default":false,"title":"Enabled","type":"boolean"},"interval_seconds":{"default":300,"maximum":86400,"minimum":60,"title":"Interval Seconds","type":"integer"}},"required":["integration_identity_id"],"title":"SourceBody","type":"object"},"examples":{"example_1":{"value":{"integration_identity_id":"7442550215703679004"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceView"},"examples":{"example_1":{"value":{"source_id":"7442678451937742086","automation_id":"7442551216804781021","mailbox_identity":{"namespace":"google.oidc-sub.v1","mailbox_id":"verified-sub"},"filters":{"mailbox":"inbox"},"enabled":true,"removed":false,"revision":1,"interval_seconds":300,"failed_scans":0}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Please slow down.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"429","status_message":"Too Many Requests","errors":[{"info":"Too many requests. Please slow down.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"source","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"update","key":"automations.update"}]},"get":{"tags":["v1/Core/automations"],"summary":"Read mailbox source health","description":"Read discovery configuration and errors through automation authorization.\n\nRequired permissions:\n- `automations.read`","operationId":"getAutomationMailboxSource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"integer","title":"Source Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceView"},"examples":{"example_1":{"value":{"source_id":"7442678451937742086","automation_id":"7442551216804781021","mailbox_identity":{"namespace":"google.oidc-sub.v1","mailbox_id":"verified-sub"},"filters":{"mailbox":"inbox"},"enabled":true,"removed":false,"revision":1,"interval_seconds":300,"failed_scans":0}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"source","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"read","key":"automations.read"}]},"delete":{"tags":["v1/Core/automations"],"summary":"Disconnect an automation mailbox source","description":"Stop future credential use and retain all accepted item history.\n\nRequired permissions:\n- `automations.update`","operationId":"removeAutomationMailboxSource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"integer","title":"Automation Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"integer","title":"Source Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceView"},"examples":{"example_1":{"value":{"source_id":"7442678451937742086","automation_id":"7442551216804781021","mailbox_identity":{"namespace":"google.oidc-sub.v1","mailbox_id":"verified-sub"},"filters":{"mailbox":"inbox"},"enabled":true,"removed":false,"revision":1,"interval_seconds":300,"failed_scans":0}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"source","x-auth-context":"user","x-required-permissions":[{"model":"automations","action":"update","key":"automations.update"}]}},"/api/v1/calendars/create":{"post":{"tags":["v1/Core/calendar"],"summary":"Create calendars for agent","description":"Creates one or more calendars and optionally assigns them to agents.\n\nRequired permissions:\n- `calendars.create`","operationId":"createCalendar","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCalendarBody","$defs":{"CalendarAssignRequestBase":{"example":{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]},"properties":{"agent_id":{"description":"Agent ID to assign calendars to.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Agent Id","type":"integer"},"calendar_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"description":"Calendar IDs to assign or unassign.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"title":"Calendar Ids"},"calendar_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Calendar names to assign or unassign.","examples":[["Team","Dev","External"]],"title":"Calendar Names"}},"required":["agent_id"],"title":"CalendarAssignRequestBase","type":"object"},"CalendarCreateItem":{"example":{"description":"Internal calendar for team meetings","link":"https://calendar.example.com/team","name":"Team","tags":["meeting","internal"]},"properties":{"name":{"description":"Name of the calendar.","examples":["Team"],"maxLength":20,"minLength":1,"title":"Name","type":"string"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Tags associated with the calendar.","examples":[["meeting","internal"],["meeting","internal","dev"],["meeting","internal","planning"]],"title":"Tags"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Description of the calendar.","examples":["Internal calendar for team meetings","Internal calendar for Dev meetings"],"title":"Description"},"link":{"description":"URL link related to the calendar.","examples":["https://calendar.example.com/team","https://calendar.example.com/dev"],"format":"uri","maxLength":2083,"minLength":1,"title":"Link","type":"string"}},"required":["name","link"],"title":"CalendarCreateItem","type":"object"}},"example":{"assigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"calendars":[{"description":"Internal calendar for team meetings","link":"https://calendar.example.com/team","name":"Team","tags":["meeting","internal"]}]},"properties":{"calendars":{"description":"List of calendars to create.","items":{"$ref":"#/$defs/CalendarCreateItem"},"minItems":1,"title":"Calendars","type":"array"},"assigns":{"anyOf":[{"items":{"$ref":"#/$defs/CalendarAssignRequestBase"},"type":"array"},{"type":"null"}],"description":"Optional mapping of agents and calendar assignments to create immediately.","title":"Assigns"}},"required":["calendars"],"title":"CreateCalendarBody","type":"object"},"examples":{"example_1":{"value":{"calendars":[{"name":"Team","tags":["meeting","internal"],"description":"Internal calendar for team meetings","link":"https://calendar.example.com/team"}],"assigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}},"example_2":{"value":{"calendars":[{"name":"Team","tags":["meeting","internal","dev"],"description":"Internal calendar for Dev meetings","link":"https://calendar.example.com/dev"}],"assigns":[{"agent_id":"7442551216804781198","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}},"example_3":{"value":{"calendars":[{"name":"Team","tags":["meeting","internal","planning"],"description":"Internal calendar for team meetings","link":"https://calendar.example.com/team"}],"assigns":[{"agent_id":"7442551216804781344","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}},"example_4":{"value":{"calendars":[{"name":"Team","tags":["meeting","internal"],"description":"Internal calendar for team meetings","link":"https://calendar.example.com/team"}],"assigns":[{"agent_id":"7442551216804781509","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCalendarResponse"},"examples":{"example_1":{"value":{"created_calendars":{"Team":"7442678451937742086"},"assigns":[{"agent_id":"7442550215703679004","calendar_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"error":"Agent not found: [744128060820239091]"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"calendar","x-auth-context":"tenant","x-required-permissions":[{"model":"calendars","action":"create","key":"calendars.create"}]}},"/api/v1/calendars/update":{"patch":{"tags":["v1/Core/calendar"],"summary":"Update calendar assignment to agents","description":"Assigns and unassigns calendars for agents by calendar ID or calendar name.\n\nRequired permissions:\n- `calendars.update`","operationId":"updateCalendarAssignments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarAssignmentsBody","$defs":{"CalendarAssignRequestBase":{"example":{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]},"properties":{"agent_id":{"description":"Agent ID to assign calendars to.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Agent Id","type":"integer"},"calendar_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"description":"Calendar IDs to assign or unassign.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"title":"Calendar Ids"},"calendar_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Calendar names to assign or unassign.","examples":[["Team","Dev","External"]],"title":"Calendar Names"}},"required":["agent_id"],"title":"CalendarAssignRequestBase","type":"object"}},"example":{"assigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"unassigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]},"properties":{"assigns":{"anyOf":[{"items":{"$ref":"#/$defs/CalendarAssignRequestBase"},"type":"array"},{"type":"null"}],"description":"Mappings that assign calendars to agents.","title":"Assigns"},"unassigns":{"anyOf":[{"items":{"$ref":"#/$defs/CalendarAssignRequestBase"},"type":"array"},{"type":"null"}],"description":"Mappings that unassign calendars from agents.","title":"Unassigns"}},"title":"UpdateCalendarAssignmentsBody","type":"object"},"examples":{"example_1":{"value":{"assigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"unassigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}},"example_2":{"value":{"assigns":[{"agent_id":"7442551216804781198","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"unassigns":[{"agent_id":"7442551216804781198","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}},"example_3":{"value":{"assigns":[{"agent_id":"7442551216804781344","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"unassigns":[{"agent_id":"7442551216804781344","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}},"example_4":{"value":{"assigns":[{"agent_id":"7442551216804781509","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"unassigns":[{"agent_id":"7442551216804781509","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarAssignmentsResponse"},"examples":{"example_1":{"value":{"assigns":[{"agent_id":"7442550215703679004","calendar_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"error":"Agent not found: [744128060820239091]"}],"unassigns":[{"agent_id":"7442550215703679004","calendar_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"error":"Agent not found: [744128060820239091]"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"calendar","x-auth-context":"tenant","x-required-permissions":[{"model":"calendars","action":"update","key":"calendars.update"}]}},"/api/v1/calendars/{calendar_id}/update":{"patch":{"tags":["v1/Core/calendar"],"summary":"Update calendar","description":"Updates a specific calendar.\n\nRequired permissions:\n- `calendars.update`","operationId":"updateCalendar","security":[{"HTTPBearer":[]}],"parameters":[{"name":"calendar_id","in":"path","required":true,"schema":{"type":"integer","title":"Calendar Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarBody","example":{"description":"Updated description for team meetings","link":"https://calendar.example.com/team","name":"Team","tags":["meeting","internal"]},"properties":{"name":{"anyOf":[{"maxLength":20,"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated name of the calendar.","examples":["Team","Dev"],"title":"Name"},"tags":{"anyOf":[{"items":{"minLength":1,"type":"string"},"type":"array"},{"type":"null"}],"description":"Updated tags associated with the calendar.","examples":[["meeting","internal"],["meeting","internal","dev"],["meeting","internal","planning"]],"title":"Tags"},"description":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated description of the calendar.","examples":["Updated description for team meetings","Internal calendar for Dev meetings"],"title":"Description"},"link":{"anyOf":[{"format":"uri","maxLength":2083,"minLength":1,"type":"string"},{"type":"null"}],"description":"Updated URL link related to the calendar.","examples":["https://calendar.example.com/team","https://calendar.example.com/dev"],"title":"Link"}},"title":"UpdateCalendarBody","type":"object"},"examples":{"example_1":{"value":{"name":"Team","tags":["meeting","internal"],"description":"Updated description for team meetings","link":"https://calendar.example.com/team"}},"example_2":{"value":{"name":"Dev","tags":["meeting","internal","dev"],"description":"Internal calendar for Dev meetings","link":"https://calendar.example.com/dev"}},"example_3":{"value":{"name":"Team","tags":["meeting","internal","planning"],"description":"Updated description for team meetings","link":"https://calendar.example.com/team"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarResponse"},"examples":{"example_1":{"value":{"message":"Successfully updated calendar 7442550215703679004","calendar_id":"7442550215703679004"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"calendar","x-auth-context":"tenant","x-required-permissions":[{"model":"calendars","action":"update","key":"calendars.update"}]}},"/api/v1/calendars/{calendar_id}/delete":{"delete":{"tags":["v1/Core/calendar"],"summary":"Delete calendar","description":"Deletes a specific calendar.\n\nRequired permissions:\n- `calendars.delete`","operationId":"deleteCalendar","security":[{"HTTPBearer":[]}],"parameters":[{"name":"calendar_id","in":"path","required":true,"schema":{"type":"integer","title":"Calendar Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCalendarResponse"},"examples":{"example_1":{"value":{"message":"Successfully deleted calendar 7442550215703679004","calendar_id":"7442550215703679004"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"calendar","x-auth-context":"tenant","x-required-permissions":[{"model":"calendars","action":"delete","key":"calendars.delete"}]}},"/api/v1/dynamic/query/tables":{"get":{"tags":["v1/Core/dynamic"],"summary":"Get queryable tables","description":"Retrieve a list of available tables for dynamic querying.","operationId":"getDynamicQueryTables","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_attributes","in":"query","required":false,"schema":{"type":"boolean","description":"Include queryable and filterable attributes for each table.","examples":[false],"default":false,"title":"Include Attributes"},"description":"Include queryable and filterable attributes for each table."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicQueryTablesResponse"},"examples":{"tables":{"summary":"Visible queryable tables","value":{"tables":["agents","agent_specs","agent_tools","users"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"dynamic_query_tables","x-auth-context":"tenant"}},"/api/v1/dynamic/query/attributes":{"get":{"tags":["v1/Core/dynamic"],"summary":"Get queryable attributes","description":"Retrieve a list of available attributes for dynamic querying.","operationId":"getDynamicQueryAttributes","security":[{"HTTPBearer":[]}],"parameters":[{"name":"query_model","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Table name to inspect.","examples":["users"],"title":"Query Model"},"description":"Table name to inspect."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicQueryAttributesResponse"},"examples":{"attributes":{"summary":"Attributes for agent specs","value":{"attributes":["agent_id","model","model_settings"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"dynamic_query_attributes","x-auth-context":"tenant"}},"/api/v1/dynamic/query":{"post":{"tags":["v1/Core/dynamic"],"summary":"Dynamic query","description":"Execute a dynamic query with provided parameters.","operationId":"executeDynamicQuery","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicQueryBodyWithPage","$defs":{"JoinBase":{"example":{"isouter":true,"on":"owner_user_id=id","target_model":"users"},"properties":{"target_model":{"description":"Table name to join with.","examples":["users"],"title":"Target Model","type":"string"},"on":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Join condition in the form '<left_field>=<right_field>'.","examples":["owner_user_id=id"],"title":"On"},"isouter":{"default":false,"description":"Whether to use LEFT OUTER JOIN.","examples":[true],"title":"Isouter","type":"boolean"}},"required":["target_model"],"title":"JoinBase","type":"object"},"PageRequest":{"properties":{"number":{"default":1,"minimum":1,"title":"Number","type":"integer"},"size":{"default":50,"minimum":1,"title":"Size","type":"integer"},"cursor":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cursor"}},"title":"PageRequest","type":"object"}},"example":{"group_by":["tenant_id","status"],"joins":[{"isouter":true,"on":"owner_user_id=id","target_model":"users"}],"order_by":["-created_at"],"page":{"number":1,"size":25},"query_attributes":["id","email","created_at"],"query_filter":{"email__ilike":"%@example.com"},"query_model":"users"},"properties":{"query_model":{"description":"Table name to query.","examples":["users"],"minLength":1,"title":"Query Model","type":"string"},"query_attributes":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"maxItems":2,"minItems":2,"prefixItems":[{"type":"string"},{"type":"string"}],"type":"array"}]},"maxItems":500,"type":"array"},{"type":"null"}],"description":"Attributes to include in the result. Leave empty to select all. Supported aggregations: ARRAY_AGG, AVG, BOOL_AND, BOOL_OR, COUNT, JSONB_AGG, JSON_AGG, MAX, MIN, STDDEV_POP, STDDEV_SAMP, SUM, VAR_POP, VAR_SAMP.","examples":[["id","email","created_at"]],"title":"Query Attributes"},"query_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Filters to apply. Supported operators: eq, gt, gte, ilike, in, isnull, like, lt, lte, ne, not_in. Relationship filters: agents__any/agents__none on knowledgefile, labels__any/labels__none on chats. They match any or none of at most 100 related IDs and preserve returned associations.","examples":[{"email__ilike":"%@example.com"}],"title":"Query Filter"},"order_by":{"anyOf":[{"items":{"type":"string"},"maxItems":100,"type":"array"},{"type":"null"}],"description":"Fields to order by. Prefix with '-' for descending.","examples":[["-created_at"]],"title":"Order By"},"group_by":{"anyOf":[{"items":{"type":"string"},"maxItems":100,"type":"array"},{"type":"null"}],"description":"Fields to group by.","examples":[["tenant_id","status"]],"title":"Group By"},"joins":{"anyOf":[{"items":{"$ref":"#/$defs/JoinBase"},"maxItems":50,"type":"array"},{"type":"null"}],"description":"Optional joins.","examples":[[{"isouter":true,"on":"owner_user_id=id","target_model":"users"}]],"title":"Joins"},"page":{"$ref":"#/$defs/PageRequest","description":"Pagination parameters.","examples":[{"number":1,"size":25}]}},"required":["query_model","page"],"title":"DynamicQueryBodyWithPage","type":"object"},"examples":{"basic_users":{"summary":"List active users","value":{"query_model":"users","query_attributes":["id","email","display_name","created_at"],"query_filter":{"is_active__eq":true},"order_by":["-created_at"],"page":{"number":1,"size":25}}},"agents_with_owner":{"summary":"Join agents with owners","value":{"query_model":"agents","query_attributes":["id","name","users.email"],"query_filter":{"name__ilike":"%support%"},"order_by":["name"],"joins":[{"target_model":"users","on":"owner_user_id=id","isouter":true}],"page":{"number":1,"size":20}}},"agent_instruction_state":{"summary":"List agent specifications","value":{"query_model":"agent_specs","query_attributes":["agent_id","model","instruction_prompt","model_settings"],"order_by":["agent_id"],"page":{"number":1,"size":50}}},"agents_with_enabled_tools":{"summary":"Filter agents by joined tools","value":{"query_model":"agents","query_attributes":["id","name","agent_tools.tool_name","agent_tools.tool_description"],"query_filter":{"agent_tools.tool_name__ilike":"%search%"},"order_by":["name","agent_tools.tool_name"],"joins":[{"target_model":"agent_tools","on":"id=agent_id","isouter":false}],"page":{"number":1,"size":50}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicQueryResponseWithPage"},"examples":{"agents_with_owner":{"summary":"Joined agent response","value":{"result":[{"id":"1","name":"Support Agent","users.email":"owner@example.com"},{"id":"2","name":"Sales Agent","users.email":"sales@example.com"}],"page":{"number":"1","size":"20","total":"2","cursor":null,"has_next":false}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"dynamic_query","x-auth-context":"tenant"}},"/api/v1/dynamic/query/bulk":{"post":{"tags":["v1/Core/dynamic"],"summary":"Dynamic query bulk","description":"Execute multiple dynamic queries in a single request.","operationId":"executeDynamicQueryBulk","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicQueryBulkBody","$defs":{"DynamicQueryBodyWithPage":{"example":{"group_by":["tenant_id","status"],"joins":[{"isouter":true,"on":"owner_user_id=id","target_model":"users"}],"order_by":["-created_at"],"page":{"number":1,"size":25},"query_attributes":["id","email","created_at"],"query_filter":{"email__ilike":"%@example.com"},"query_model":"users"},"properties":{"query_model":{"description":"Table name to query.","examples":["users"],"minLength":1,"title":"Query Model","type":"string"},"query_attributes":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"maxItems":2,"minItems":2,"prefixItems":[{"type":"string"},{"type":"string"}],"type":"array"}]},"maxItems":500,"type":"array"},{"type":"null"}],"description":"Attributes to include in the result. Leave empty to select all. Supported aggregations: ARRAY_AGG, AVG, BOOL_AND, BOOL_OR, COUNT, JSONB_AGG, JSON_AGG, MAX, MIN, STDDEV_POP, STDDEV_SAMP, SUM, VAR_POP, VAR_SAMP.","examples":[["id","email","created_at"]],"title":"Query Attributes"},"query_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Filters to apply. Supported operators: eq, gt, gte, ilike, in, isnull, like, lt, lte, ne, not_in. Relationship filters: agents__any/agents__none on knowledgefile, labels__any/labels__none on chats. They match any or none of at most 100 related IDs and preserve returned associations.","examples":[{"email__ilike":"%@example.com"}],"title":"Query Filter"},"order_by":{"anyOf":[{"items":{"type":"string"},"maxItems":100,"type":"array"},{"type":"null"}],"description":"Fields to order by. Prefix with '-' for descending.","examples":[["-created_at"]],"title":"Order By"},"group_by":{"anyOf":[{"items":{"type":"string"},"maxItems":100,"type":"array"},{"type":"null"}],"description":"Fields to group by.","examples":[["tenant_id","status"]],"title":"Group By"},"joins":{"anyOf":[{"items":{"$ref":"#/$defs/JoinBase"},"maxItems":50,"type":"array"},{"type":"null"}],"description":"Optional joins.","examples":[[{"isouter":true,"on":"owner_user_id=id","target_model":"users"}]],"title":"Joins"},"page":{"$ref":"#/$defs/PageRequest","description":"Pagination parameters.","examples":[{"number":1,"size":25}]}},"required":["query_model","page"],"title":"DynamicQueryBodyWithPage","type":"object"},"JoinBase":{"example":{"isouter":true,"on":"owner_user_id=id","target_model":"users"},"properties":{"target_model":{"description":"Table name to join with.","examples":["users"],"title":"Target Model","type":"string"},"on":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Join condition in the form '<left_field>=<right_field>'.","examples":["owner_user_id=id"],"title":"On"},"isouter":{"default":false,"description":"Whether to use LEFT OUTER JOIN.","examples":[true],"title":"Isouter","type":"boolean"}},"required":["target_model"],"title":"JoinBase","type":"object"},"PageRequest":{"properties":{"number":{"default":1,"minimum":1,"title":"Number","type":"integer"},"size":{"default":50,"minimum":1,"title":"Size","type":"integer"},"cursor":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cursor"}},"title":"PageRequest","type":"object"}},"example":{"queries":[{"order_by":["agent_id"],"page":{"number":1,"size":10},"query_attributes":["agent_id","model","model_settings"],"query_model":"agent_specs"},{"group_by":["agent_id"],"order_by":["-tool_count"],"page":{"number":1,"size":10},"query_attributes":["agent_id",["COUNT(id)","tool_count"]],"query_model":"agent_tools"}]},"properties":{"queries":{"description":"Queries to execute.","examples":[[{"order_by":["agent_id"],"page":{"number":1,"size":10},"query_attributes":["agent_id","model","model_settings"],"query_model":"agent_specs"},{"group_by":["agent_id"],"order_by":["-tool_count"],"page":{"number":1,"size":10},"query_attributes":["agent_id",["COUNT(id)","tool_count"]],"query_model":"agent_tools"}]],"items":{"$ref":"#/$defs/DynamicQueryBodyWithPage"},"maxItems":100,"title":"Queries","type":"array"}},"required":["queries"],"title":"DynamicQueryBulkBody","type":"object"},"examples":{"dashboard_batch":{"summary":"Dashboard batch","value":{"queries":[{"query_model":"agent_specs","query_attributes":["agent_id","model","model_settings"],"order_by":["agent_id"],"page":{"number":1,"size":10}},{"query_model":"agent_tools","query_attributes":["agent_id",["COUNT(id)","tool_count"]],"order_by":["-tool_count"],"group_by":["agent_id"],"page":{"number":1,"size":10}}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicQueryBulkResponse"},"examples":{"example_1":{"value":{"results":[{"result":[{"agent_id":"1","model":"gpt-6-luna","model_settings":null}],"page":{"number":"1","size":"10","total":"1","cursor":null,"has_next":false}},{"result":[{"agent_id":"1","tool_count":3}],"page":{"number":"1","size":"10","total":"1","cursor":null,"has_next":false}}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"dynamic_query_bulk","x-auth-context":"tenant"}},"/api/v1/dynamic/query/default-configuration":{"post":{"tags":["v1/Core/dynamic"],"summary":"Get default tool configurations","description":"Retrieve default configurations for tools.","operationId":"getDefaultToolConfigurations","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultConfigurationBody","example":{"function":"rag_search_tool","reference":"agent_tools"},"properties":{"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by reference table name.","examples":["agent_tools"],"title":"Reference"},"function":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by function title.","examples":["rag_search_tool"],"title":"Function"}},"title":"DefaultConfigurationBody","type":"object"},"examples":{"all":{"summary":"All default configurations","value":{}},"by_reference":{"summary":"Filter by reference","value":{"reference":"agent_tools"}},"by_function":{"summary":"Filter by function","value":{"function":"rag_search_tool"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultConfigurationResponse"},"examples":{"configuration":{"summary":"Default configurations","value":{"configurations":[{"reference":"agent_tools","function":"rag_search_tool","meta":{"history_visibility":{"model_visible":true,"user_visible":true},"limit":10,"fetch_k":50,"min_similarity":null,"max_passage_tokens":450,"max_response_content_tokens":null,"source_evidence_mode":"on_demand","answer_validation_mode":"disabled"}}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"default_tool_configurations","x-auth-context":"tenant"}},"/api/v1/frontend/phone-numbers":{"get":{"tags":["v1/Core/frontend"],"summary":"Get all phone numbers","description":"Returns a comprehensive list of all stored phone numbers, each entry including the phone number, its chat title, and its last activity timestamp.\n\nRequired permissions:\n- `chats.read`","operationId":"getFrontendPhoneNumbers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetNumbersTableResponse"},"examples":{"example_1":{"value":{"phone_numbers":{"['491701234567', '4917611122233', '4915112349876', '492211234560']":[{"chat_id":"7442550215703679004","title":"Support Chat","latest_output_timestamp":"2027-02-10T11:22:33Z"}]}}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"phone_numbers","x-auth-context":"tenant","x-required-permissions":[{"model":"chats","action":"read","key":"chats.read"}]}},"/api/v1/frontend/analytics/user_report":{"get":{"tags":["v1/Core/frontend"],"summary":"Get user activity report","description":"Generates and retrieves a user activity report for the current tenant within a specified date range.\n\nRequired permissions:\n- `chat_history_entries.read`\n- `users.read`","operationId":"getFrontendUserReport","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start date for the report.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"],"title":"Start Date"},"description":"Start date for the report."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End date for the report.","examples":["2027-12-01T07:55:09Z","2028-08-14T13:20:48Z","2029-05-22T21:44:30Z","2030-10-30T02:11:16Z"],"title":"End Date"},"description":"End date for the report."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserReportResponse"},"examples":{"example_1":{"value":{"total_metrics":{"total_users":"150","total_messages":"4200","average_messages_per_user":"28.0","total_tokens":{"response_tokens":"12000","request_tokens":"8000"},"average_tokens_per_user":"133.33"},"active_metrics":{"active_users":"45","total_active_messages":"1200","average_messages_per_active_user":"26.67","total_active_tokens":{"response_tokens":"12000","request_tokens":"8000"},"average_tokens_per_active_user":"222.22"},"daily_message_counts":{"2025-07-20":120,"2025-07-21":95,"2025-07-22":150,"2025-07-23":200,"2025-07-24":180,"2025-07-25":130,"2025-07-26":140,"2025-07-27":160,"2025-07-28":170,"2025-07-29":190}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"user_report","x-auth-context":"tenant","x-required-permissions":[{"model":"chat_history_entries","action":"read","key":"chat_history_entries.read"},{"model":"users","action":"read","key":"users.read"}]}},"/api/v1/frontend/whitelists":{"post":{"tags":["v1/Core/frontend"],"summary":"Get agent whitelists","description":"Returns whitelist entries grouped by the requested agent IDs, including the tenant's email and phone details for whitelisted users when available.\n\nRequired permissions:\n- `agent_whitelist_entries.read`\n- `tenant_user_profiles.read`","operationId":"getFrontendWhitelists","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveWhitelistsBody","example":{"agent_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]},"properties":{"agent_ids":{"description":"List of agent IDs to retrieve whitelists for.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"minItems":1,"title":"Agent Ids","type":"array"}},"required":["agent_ids"],"title":"RetrieveWhitelistsBody","type":"object"},"examples":{"example_1":{"value":{"agent_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveWhitelistsResponse"},"examples":{"example_1":{"value":{"whitelists":[{"agent_id":"7442550215703679004","entries":[{"entry_id":"7442678451937742086","match_type":"email","match_value":"sprizzy@p-cation.de","user_id":"7442678451937742086","email":"sprizzy@p-cation.de","phone_number":"+491701234567"}]}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"whitelists","x-auth-context":"tenant","x-required-permissions":[{"model":"agent_whitelist_entries","action":"read","key":"agent_whitelist_entries.read"},{"model":"tenant_user_profiles","action":"read","key":"tenant_user_profiles.read"}]}},"/api/v1/frontend/chat/list":{"get":{"tags":["v1/Core/frontend"],"summary":"List chats","description":"Retrieve a list of all chats.\n\nRequired permissions:\n- `chats.read`","operationId":"listFrontendChats","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_all","in":"query","required":false,"schema":{"type":"boolean","description":"Include all chats, not just those with a platform.","examples":[true,false],"default":false,"title":"Include All"},"description":"Include all chats, not just those with a platform."},{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter chats by platform.","examples":["whatsapp","teams"],"title":"Platform"},"description":"Filter chats by platform."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChatsResponse"},"examples":{"example_1":{"value":{"chats":[{"chat_id":"7442550215703679004","platform":"Whatsapp","title":"Support Chat","last_activity":"2027-02-10T11:22:33Z","identifier":{"user_email":"musterassistent@p-cation.de","user_phone_number":"+4917611122233","whatsapp_verified_name":"Sales Business Name","whatsapp_phone_number":"+4915112349876"}}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"chats","x-auth-context":"tenant","x-required-permissions":[{"model":"chats","action":"read","key":"chats.read"}]}},"/api/v1/groups/":{"post":{"tags":["v1/Core/groups"],"summary":"Create group","description":"Create a new group for the current tenant.\n\nRequired permissions:\n- `groups.create`","operationId":"createGroup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupBody","example":{"description":"Support staff group.","name":"Support Team"},"properties":{"name":{"description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"],"title":"Name","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional group description.","examples":["Support staff group."],"title":"Description"}},"required":["name"],"title":"CreateGroupBody","type":"object"},"examples":{"example_1":{"value":{"name":"Support Team","description":"Support staff group."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","tenant_id":"7442551216804781021","name":"Support Team","description":"Support staff group."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"create","key":"groups.create"}]},"get":{"tags":["v1/Core/groups"],"summary":"List groups","description":"List visible groups for the current tenant.\n\nRequired permissions:\n- `groups.read`","operationId":"listGroups","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListGroupsResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442550215703679004","tenant_id":"7442551216804781021","name":"Support Team","description":"Support staff group."}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"groups","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"read","key":"groups.read"}]}},"/api/v1/groups/{group_id}":{"get":{"tags":["v1/Core/groups"],"summary":"Get group","description":"Get a group by ID.\n\nRequired permissions:\n- `groups.read`","operationId":"getGroup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetGroupResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","tenant_id":"7442551216804781021","name":"Support Team","description":"Support staff group."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"read","key":"groups.read"}]},"patch":{"tags":["v1/Core/groups"],"summary":"Update group","description":"Update a group by ID.\n\nRequired permissions:\n- `groups.update`","operationId":"updateGroup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroupBody","example":{"description":"Extended support staff group.","name":"Support Team"},"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional group description.","examples":["Extended support staff group."],"title":"Description"}},"title":"UpdateGroupBody","type":"object"},"examples":{"example_1":{"value":{"name":"Support Team","description":"Extended support staff group."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroupResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","tenant_id":"7442551216804781021","name":"Support Team","description":"Support staff group."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"update","key":"groups.update"}]},"delete":{"tags":["v1/Core/groups"],"summary":"Delete group","description":"Delete a group by ID.\n\nRequired permissions:\n- `groups.delete`","operationId":"deleteGroup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteGroupResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"delete","key":"groups.delete"}]}},"/api/v1/groups/{group_id}/members":{"get":{"tags":["v1/Core/groups"],"summary":"List group members","description":"List group memberships for a group.\n\nRequired permissions:\n- `group_memberships.read`","operationId":"listGroupMembers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListGroupMembersResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442678451937742086","group_id":"7442550215703679004","user_id":"7442551216804781021","tenant_id":"7443001845129083411","is_active":true}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group_members","x-auth-context":"tenant","x-required-permissions":[{"model":"group_memberships","action":"read","key":"group_memberships.read"}]},"post":{"tags":["v1/Core/groups"],"summary":"Add group member","description":"Add a tenant user to a group.\n\nRequired permissions:\n- `group_memberships.create`\n- `groups.update`","operationId":"addGroupMember","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddGroupMemberBody","example":{"user_id":"7442551216804781021"},"properties":{"user_id":{"description":"User ID to add.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"User Id","type":"integer"}},"required":["user_id"],"title":"AddGroupMemberBody","type":"object"},"examples":{"example_1":{"value":{"user_id":"7442551216804781021"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddGroupMemberResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group_member","x-auth-context":"tenant","x-required-permissions":[{"model":"group_memberships","action":"create","key":"group_memberships.create"},{"model":"groups","action":"update","key":"groups.update"}]}},"/api/v1/groups/{group_id}/members/{membership_id}":{"delete":{"tags":["v1/Core/groups"],"summary":"Remove group member","description":"Remove a tenant user from a group.\n\nRequired permissions:\n- `group_memberships.delete`\n- `groups.update`","operationId":"removeGroupMember","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"membership_id","in":"path","required":true,"schema":{"type":"integer","title":"Membership Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveGroupMemberResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group_member","x-auth-context":"tenant","x-required-permissions":[{"model":"group_memberships","action":"delete","key":"group_memberships.delete"},{"model":"groups","action":"update","key":"groups.update"}]}},"/api/v1/groups/{group_id}/roles":{"get":{"tags":["v1/Core/groups"],"summary":"List group roles","description":"List roles assigned to a group.\n\nRequired permissions:\n- `groups.read`","operationId":"listGroupRoles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListGroupRolesResponse"},"examples":{"example_1":{"value":{"items":[{"group_id":"7442550215703679004","role_id":"7442551216804781021"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group_roles","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"read","key":"groups.read"}]},"post":{"tags":["v1/Core/groups"],"summary":"Add group role","description":"Assign a role to a group.\n\nRequired permissions:\n- `groups.update`\n- `roles.update`","operationId":"addGroupRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddGroupRoleBody","example":{"role_id":"7442551216804781021"},"properties":{"role_id":{"description":"Role ID to assign to the group.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Role Id","type":"integer"}},"required":["role_id"],"title":"AddGroupRoleBody","type":"object"},"examples":{"example_1":{"value":{"role_id":"7442551216804781021"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddGroupRoleResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group_role","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"update","key":"groups.update"},{"model":"roles","action":"update","key":"roles.update"}]}},"/api/v1/groups/{group_id}/roles/{role_id}":{"delete":{"tags":["v1/Core/groups"],"summary":"Remove group role","description":"Remove a role assignment from a group.\n\nRequired permissions:\n- `groups.update`\n- `roles.update`","operationId":"removeGroupRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveGroupRoleResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"group_role","x-auth-context":"tenant","x-required-permissions":[{"model":"groups","action":"update","key":"groups.update"},{"model":"roles","action":"update","key":"roles.update"}]}},"/api/v1/integrations/whatsapp/phone-number/create":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Create a phone number","description":"Creates a new phone number entry and optionally auto-registers it.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.create`\n- `whatsapp_business_profiles.create`","operationId":"createPhoneNumber","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePhoneNumberBody","example":{"business_id":"12345678901234567890","code":"234632467","phone_number_id":"12345678901234567890","waba_id":"12345678901234567890"},"properties":{"waba_id":{"description":"WhatsApp business account ID","examples":["12345678901234567890"],"title":"Waba Id","type":"string"},"phone_number_id":{"description":"Phone number ID","examples":["12345678901234567890"],"title":"Phone Number Id","type":"string"},"business_id":{"description":"Business ID","examples":["12345678901234567890"],"title":"Business Id","type":"string"},"code":{"description":"Signup validation callback code","examples":["234632467"],"title":"Code","type":"string"}},"required":["waba_id","phone_number_id","business_id","code"],"title":"CreatePhoneNumberBody","type":"object"},"examples":{"example_1":{"value":{"waba_id":"12345678901234567890","phone_number_id":"12345678901234567890","business_id":"12345678901234567890","code":"234632467"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePhoneNumberResponse"},"examples":{"example_1":{"value":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE","message":"Phone number 12345678901234567890 created successfully!","status":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE"},"next_step":"Register the phone number (no PIN required)","pin":"123456","whatsapp_business_phone_number_id":"7442550215703679004"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"create","key":"whatsapp_business_phone_numbers.create"},{"model":"whatsapp_business_profiles","action":"create","key":"whatsapp_business_profiles.create"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/register":{"patch":{"tags":["v1/Integrations/whatsapp"],"summary":"Register a phone number","description":"Registers a WhatsApp business phone number.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`","operationId":"registerPhoneNumber","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPhoneNumberBody","example":{"pin":"123456"},"properties":{"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pin used for registration","examples":["123456"],"title":"Pin"}},"title":"RegisterPhoneNumberBody","type":"object"},"examples":{"example_1":{"value":{"pin":"123456"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPhoneNumberResponse"},"examples":{"example_1":{"value":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE","message":"Phone number 12345678901234567890 created successfully!","status":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE"},"next_step":"Register the phone number (no PIN required)","pin":"123456"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/deregister":{"delete":{"tags":["v1/Integrations/whatsapp"],"summary":"Deregister a phone number","description":"Deregisters a WhatsApp business phone number.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.delete`\n- `whatsapp_business_profiles.delete`","operationId":"deregisterPhoneNumber","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"delete","key":"whatsapp_business_phone_numbers.delete"},{"model":"whatsapp_business_profiles","action":"delete","key":"whatsapp_business_profiles.delete"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/pin/update":{"patch":{"tags":["v1/Integrations/whatsapp"],"summary":"Update a phone number pin","description":"Updates the two-step verification PIN for a phone number.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`","operationId":"updatePhoneNumberPin","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneNumberPinBody","example":{"pin":"654321"},"properties":{"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pin used for registration","examples":["654321"],"title":"Pin"}},"title":"UpdatePhoneNumberPinBody","type":"object"},"examples":{"example_1":{"value":{"pin":"654321"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneNumberPinResponse"},"examples":{"example_1":{"value":{"message":"PIN for phone 7234230123774234 updated successfully.","pin":"654321"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/status/update":{"patch":{"tags":["v1/Integrations/whatsapp"],"summary":"Manual validate for phone number status","description":"Validates and updates the status of a WhatsApp business phone number.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`\n- `whatsapp_business_profiles.update`","operationId":"validatePhoneNumberStatus","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidatePhoneNumberStatusResponse"},"examples":{"example_1":{"value":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"},{"model":"whatsapp_business_profiles","action":"update","key":"whatsapp_business_profiles.update"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/request-code":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Request a verification code for a phone number","description":"Requests a verification code from Meta for a WhatsApp business phone number.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`","operationId":"requestPhoneNumberCode","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestPhoneNumberCodeBody","example":{"code_method":"SMS","language":"en_US"},"properties":{"code_method":{"description":"Method to receive the verification code","enum":["SMS","VOICE"],"examples":["SMS","VOICE"],"title":"Code Method","type":"string"},"language":{"default":"en_US","description":"Language for the verification code (e.g., en_US, de)","examples":["en_US","de"],"title":"Language","type":"string"}},"required":["code_method"],"title":"RequestPhoneNumberCodeBody","type":"object"},"examples":{"example_1":{"value":{"code_method":"SMS","language":"en_US"}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/verify-code":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Verify a code for a phone number","description":"Verifies a code received from Meta for a WhatsApp business phone number.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`","operationId":"verifyPhoneNumberCode","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPhoneNumberCodeBody","example":{"code":"123456"},"properties":{"code":{"description":"Verification code received from Meta","examples":["123456"],"title":"Code","type":"string"}},"required":["code"],"title":"VerifyPhoneNumberCodeBody","type":"object"},"examples":{"example_1":{"value":{"code":"123456"}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/update":{"patch":{"tags":["v1/Integrations/whatsapp"],"summary":"Update WhatsApp Business Profile","description":"Update the business profile of a WhatsApp account.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`\n- `whatsapp_business_profiles.update`","operationId":"updateWhatsAppBusinessProfile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UpdateWhatsAppBusinessProfileBody","example":{"about":"Customer support for Sprizzy.","address":"Musterstrasse 1, 50667 Cologne","description":"Sprizzy customer service team.","display_name":"Sprizzy Support","email":"sprizzy@p-cation.de","industry":"PROF_SERVICES","pin":"123456","profile_picture":"agent-profile.png","websites":["https://sprizzy.de"]},"properties":{"about":{"anyOf":[{"maxLength":139,"type":"string"},{"type":"null"}],"description":"The 'About' text of the business profile.","examples":["Customer support for Sprizzy."],"title":"About"},"address":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"description":"Address of the business.","examples":["Musterstrasse 1, 50667 Cologne"],"title":"Address"},"description":{"anyOf":[{"maxLength":512,"type":"string"},{"type":"null"}],"description":"Description of the business.","examples":["Sprizzy customer service team."],"title":"Description"},"email":{"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"description":"Email of the business.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"],"title":"Email"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Industry of the business.","examples":["PROF_SERVICES"],"title":"Industry"},"websites":{"anyOf":[{"items":{"type":"string"},"maxItems":2,"type":"array"},{"type":"null"}],"description":"List of websites for the business. Send one empty value to remove all websites.","examples":[["https://sprizzy.de"]],"title":"Websites"},"profile_picture":{"title":"Profile Picture","description":"Profile picture to upload.","examples":["agent-profile.png",null],"type":"string","format":"binary"},"display_name":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Name displayed through WhatsApp.","examples":["Sprizzy Support"],"title":"Display Name"},"pin":{"anyOf":[{"pattern":"^\\d{6}$","type":"string"},{"type":"null"}],"description":"Six-digit PIN used during registration of the phone number.","examples":["123456"],"title":"Pin"}},"title":"UpdateWhatsAppBusinessProfileBody","type":"object"},"examples":{"example_1":{"value":{"about":"Customer support for Sprizzy.","address":"Musterstrasse 1, 50667 Cologne","description":"Sprizzy customer service team.","email":"sprizzy@p-cation.de","industry":"PROF_SERVICES","websites":["https://sprizzy.de"],"profile_picture":"agent-profile.png","display_name":"Sprizzy Support","pin":"123456"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsAppBusinessProfileResponse"},"examples":{"example_1":{"value":{"success":true,"message":"Business profile for WhatsApp business phone number 7442550215703679004 updated successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"},{"model":"whatsapp_business_profiles","action":"update","key":"whatsapp_business_profiles.update"}]}},"/api/v1/integrations/whatsapp/phone-number/sync":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Sync WhatsApp Business Profiles","description":"Fetches WhatsApp Business Profiles from Meta, treats Meta as the source of truth, and reconciles local records accordingly.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`\n- `whatsapp_business_profiles.update`","operationId":"syncWhatsAppBusinessProfiles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncWhatsAppBusinessProfilesBody","example":{"whatsapp_business_phone_number_ids":["7442550215703679137","7442550215703679004"]},"properties":{"whatsapp_business_phone_number_ids":{"description":"Identifiers of the WhatsApp business phone numbers to sync.","examples":[[7442550215703679004,7442550215703679137]],"items":{"type":"integer"},"minItems":1,"title":"Whatsapp Business Phone Number Ids","type":"array","uniqueItems":true}},"required":["whatsapp_business_phone_number_ids"],"title":"SyncWhatsAppBusinessProfilesBody","type":"object"},"examples":{"example_1":{"value":{"whatsapp_business_phone_number_ids":["7442550215703679137","7442550215703679004"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncWhatsAppBusinessProfilesResponse"},"examples":{"example_1":{"value":{"success":[{"whatsapp_business_phone_number_id":"7442550215703679004","whatsapp_business_profile_id":"7442551216804781021","updated_fields":["status","whatsapp_about","whatsapp_email"],"message":"No profile changes detected; local data is already in sync with Meta."}],"failed":["<failed>"],"message":"1 synced, 0 failed."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"},{"model":"whatsapp_business_profiles","action":"update","key":"whatsapp_business_profiles.update"}]}},"/api/v1/integrations/whatsapp/phone-number/{whatsapp_business_phone_number_id}/chat":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Send a message to a WhatsApp user","description":"Sends a message to a WhatsApp user and records the chat history.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.read`\n- `users.read`\n- `chats.update`\n- `chat_history_entries.create`\n- `chat_history_entries.update`","operationId":"sendWhatsAppMessage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWhatsAppMessageBody","example":{"message":"Hello, how can I help you?","target":["491701234567","4917611122233","4915112349876","492211234560"]},"properties":{"target":{"anyOf":[{"type":"string"},{"type":"integer"}],"description":"Target phone number or user_id.","examples":[["491701234567","4917611122233","4915112349876","492211234560"],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"title":"Target"},"message":{"description":"Message to send.","examples":["Hello, how can I help you?"],"maxLength":1000,"title":"Message","type":"string"}},"required":["target","message"],"title":"SendWhatsAppMessageBody","type":"object"},"examples":{"example_1":{"value":{"target":["491701234567","4917611122233","4915112349876","492211234560"],"message":"Hello, how can I help you?"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWhatsAppMessageResponse"},"examples":{"example_1":{"value":{"message_status":"sent","history_id":"7442678451937742086"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"read","key":"whatsapp_business_phone_numbers.read"},{"model":"users","action":"read","key":"users.read"},{"model":"chats","action":"update","key":"chats.update"},{"model":"chat_history_entries","action":"create","key":"chat_history_entries.create"},{"model":"chat_history_entries","action":"update","key":"chat_history_entries.update"}]}},"/api/v1/integrations/whatsapp/agent-reply":{"patch":{"tags":["v1/Integrations/whatsapp"],"summary":"Enable/disable auto agent reply for specified WhatsApp chats","description":"Enables or disables automatic agent replies for specified WhatsApp chats.\n\nRequired permissions:\n- `chats.update`","operationId":"updateWhatsappChatAgentReply","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsappChatAgentReplyBody","example":{"disable_agent_reply":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"enable_agent_reply":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]},"properties":{"enable_agent_reply":{"default":[],"description":"List of chat_ids to enable auto agent reply for.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"title":"Enable Agent Reply","type":"array"},"disable_agent_reply":{"default":[],"description":"List of chat_ids to disable auto agent reply for.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]],"items":{"type":"integer"},"title":"Disable Agent Reply","type":"array"}},"title":"UpdateWhatsappChatAgentReplyBody","type":"object"},"examples":{"example_1":{"value":{"enable_agent_reply":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"disable_agent_reply":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsappChatAgentReplyResponse"},"examples":{"example_1":{"value":{"result":{"7442551216804781021":"enabled","7442551216804781198":"disabled","7442551216804781344":"not found"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"chats","action":"update","key":"chats.update"}]}},"/api/v1/integrations/whatsapp/first-contact/{whatsapp_business_phone_number_id}/retrieve":{"get":{"tags":["v1/Integrations/whatsapp"],"summary":"Get first contact template","description":"Retrieve the first contact template.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.read`","operationId":"getFirstContactTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirstContactMessage"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"first_contact_template","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"read","key":"whatsapp_business_phone_numbers.read"}]}},"/api/v1/integrations/whatsapp/first-contact/{whatsapp_business_phone_number_id}/create":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Create first contact template","description":"Create the first contact template.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`","operationId":"createFirstContactTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberFirstContactTemplateBody","$defs":{"WhatsAppBusinessPhoneNumberFirstContactTemplateButton":{"properties":{"title":{"description":"Button title shown in the first-contact message.","examples":["Open website"],"maxLength":80,"minLength":1,"title":"Title","type":"string"},"url":{"description":"Button destination URL.","examples":["https://example.com"],"format":"uri","maxLength":2083,"minLength":1,"title":"Url","type":"string"}},"required":["title","url"],"title":"WhatsAppBusinessPhoneNumberFirstContactTemplateButton","type":"object"}},"example":{"buttons":[{"title":"Open website","url":"https://example.com"}],"footer":"LIVOI support","imageUrl":"https://example.com/header.png","text":"Hi {user_name}, how can we help?"},"properties":{"text":{"description":"Message text sent to users on first contact.","examples":["Hi {user_name}, how can we help?"],"maxLength":1024,"minLength":1,"title":"Text","type":"string"},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional header image URL.","examples":["https://example.com/header.png"],"title":"Imageurl"},"buttons":{"anyOf":[{"items":{"$ref":"#/$defs/WhatsAppBusinessPhoneNumberFirstContactTemplateButton"},"type":"array"},{"type":"null"}],"description":"CTA buttons displayed below the first-contact message.","examples":[[{"title":"Open website","url":"https://example.com"}]],"title":"Buttons"},"footer":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"description":"Optional message footer.","examples":["LIVOI support"],"title":"Footer"}},"required":["text"],"title":"WhatsAppBusinessPhoneNumberFirstContactTemplateBody","type":"object"},"examples":{"example_1":{"value":{"text":"Hi {user_name}, how can we help?","imageUrl":"https://example.com/header.png","buttons":[{"title":"Open website","url":"https://example.com"}],"footer":"LIVOI support"}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"first_contact_template","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"}]}},"/api/v1/integrations/whatsapp/first-contact/{whatsapp_business_phone_number_id}/update":{"patch":{"tags":["v1/Integrations/whatsapp"],"summary":"Update first contact template","description":"Update the first contact template.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`","operationId":"updateFirstContactTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberFirstContactTemplateUpdateBody","$defs":{"WhatsAppBusinessPhoneNumberFirstContactTemplateButton":{"properties":{"title":{"description":"Button title shown in the first-contact message.","examples":["Open website"],"maxLength":80,"minLength":1,"title":"Title","type":"string"},"url":{"description":"Button destination URL.","examples":["https://example.com"],"format":"uri","maxLength":2083,"minLength":1,"title":"Url","type":"string"}},"required":["title","url"],"title":"WhatsAppBusinessPhoneNumberFirstContactTemplateButton","type":"object"}},"example":{"buttons":[{"title":"Open website","url":"https://example.com"}],"footer":"LIVOI support","imageUrl":"https://example.com/header.png","text":"Hi {user_name}, thanks for reaching out. How can we help?"},"properties":{"text":{"anyOf":[{"maxLength":1024,"minLength":1,"type":"string"},{"type":"null"}],"description":"Message text sent to users on first contact.","examples":["Hi {user_name}, thanks for reaching out. How can we help?"],"title":"Text"},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional header image URL.","examples":["https://example.com/header.png"],"title":"Imageurl"},"buttons":{"anyOf":[{"items":{"$ref":"#/$defs/WhatsAppBusinessPhoneNumberFirstContactTemplateButton"},"type":"array"},{"type":"null"}],"description":"CTA buttons displayed below the first-contact message.","examples":[[{"title":"Open website","url":"https://example.com"}]],"title":"Buttons"},"footer":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"description":"Optional message footer.","examples":["LIVOI support"],"title":"Footer"}},"title":"WhatsAppBusinessPhoneNumberFirstContactTemplateUpdateBody","type":"object"},"examples":{"example_1":{"value":{"text":"Hi {user_name}, thanks for reaching out. How can we help?","imageUrl":"https://example.com/header.png","buttons":[{"title":"Open website","url":"https://example.com"}],"footer":"LIVOI support"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirstContactMessage"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"first_contact_template","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"}]}},"/api/v1/integrations/whatsapp/first-contact/{whatsapp_business_phone_number_id}/delete":{"delete":{"tags":["v1/Integrations/whatsapp"],"summary":"Delete first contact template","description":"Delete the first contact template.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.update`","operationId":"deleteFirstContactTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"first_contact_template","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"update","key":"whatsapp_business_phone_numbers.update"}]}},"/api/v1/integrations/whatsapp/template/{whatsapp_business_profile_id}/create":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Create WhatsApp template","description":"Create a WhatsApp message template.\n\nRequired permissions:\n- `whatsapp_templates.create`","operationId":"createWhatsAppTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberMessageTemplateBody","$defs":{"ParamFormat":{"description":"The type of parameter formatting the HEADER and BODY components of the template will use.\n\nAttributes:\n    POSITIONAL: The component uses positional parameters, e.g. ``{{1}}``, ``{{2}}``, etc.\n    NAMED: The component uses named parameters, e.g. ``{{param_name}}``.","enum":["POSITIONAL","NAMED","UNKNOWN"],"title":"ParamFormat","type":"string"},"TemplateCategory":{"description":"Template category.\n\n`'Template Categorization' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines#template-categorization>`_\n\nAttributes:\n    AUTHENTICATION: Enable businesses to verify a user’s identity, potentially at various steps of the customer journey. See `Authentication templates <https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates>`_ for more details.\n    MARKETING: Enable businesses to achieve a wide range of goals, from generating awareness to driving sales and retargeting customers. See `Marketing templates <https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/marketing-templates>`_ for more details.\n    UTILITY: Enable businesses to follow up on user actions or requests, since these messages are typically triggered by user actions. See `Utility templates <https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/utility-templates>`_ for more details.","enum":["AUTHENTICATION","MARKETING","UTILITY","UNKNOWN"],"title":"TemplateCategory","type":"string"},"TemplateLanguage":{"description":"Template language and locale code.\n\n`'Template language and locale code' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages>`_","enum":["None","af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","ar_SA","az","bn","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","en","en_GB","en_US","en_AU","en_CA","en_IN","et","fil","fi","fr","fr_CA","fr_BE","ka","de","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","sk","sl","es","es_AR","es_ES","es_MX","es_CL","es_CO","es_PE","es_VE","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu","UNKNOWN"],"title":"TemplateLanguage","type":"string"},"WhatsAppBusinessPhoneNumberMessageTemplateComponentButton":{"properties":{"type":{"description":"WhatsApp template component type.","examples":["BODY"],"minLength":1,"title":"Type","type":"string"},"text":{"description":"Template component text.","examples":["Hello {{1}}, your order is ready."],"minLength":1,"title":"Text","type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL for URL buttons.","examples":["https://example.com/orders/{{1}}"],"title":"Url"}},"required":["type","text"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentButton","type":"object"},"WhatsAppBusinessPhoneNumberMessageTemplateComponentText":{"properties":{"type":{"description":"WhatsApp template component type.","examples":["BODY"],"minLength":1,"title":"Type","type":"string"},"text":{"description":"Template component text.","examples":["Hello {{1}}, your order is ready."],"minLength":1,"title":"Text","type":"string"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"description":"Template parameters used while formatting component examples.","examples":[{"1":"Mia"}],"title":"Params"}},"required":["type","text"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentText","type":"object"}},"example":{"category":"UTILITY","components":[{"params":{"1":"Mia"},"text":"Hello {{1}}, your order is ready.","type":"BODY"}],"language":"de","message_send_ttl_seconds":3600,"name":"order_ready","param_format":"POSITIONAL"},"properties":{"components":{"description":"WhatsApp template components.","examples":[[{"params":{"1":"Mia"},"text":"Hello {{1}}, your order is ready.","type":"BODY"}]],"items":{"anyOf":[{"$ref":"#/$defs/WhatsAppBusinessPhoneNumberMessageTemplateComponentText"},{"$ref":"#/$defs/WhatsAppBusinessPhoneNumberMessageTemplateComponentButton"}]},"minItems":1,"title":"Components","type":"array"},"name":{"description":"Meta template name. Lowercase letters, numbers, and underscores only.","examples":["order_ready"],"maxLength":512,"minLength":1,"pattern":"^[a-z0-9_]+$","title":"Name","type":"string"},"language":{"$ref":"#/$defs/TemplateLanguage","default":"de","description":"Template language.","examples":["de"]},"category":{"$ref":"#/$defs/TemplateCategory","description":"Meta template category.","examples":["UTILITY"]},"param_format":{"$ref":"#/$defs/ParamFormat","default":"POSITIONAL","description":"Template parameter format.","examples":["POSITIONAL"]},"message_send_ttl_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional Meta message send TTL in seconds.","examples":[3600],"title":"Message Send Ttl Seconds"}},"required":["components","name","category"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateBody","type":"object"},"examples":{"example_1":{"value":{"components":[{"type":"BODY","text":"Hello {{1}}, your order is ready.","params":{"1":"Mia"}}],"name":"order_ready","language":"de","category":"UTILITY","param_format":"POSITIONAL","message_send_ttl_seconds":3600}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWhatsAppTemplateResponse"},"examples":{"example_1":{"value":{"template_id":"7442678451937742086","whatsapp_template_id":"123456789012345","template_status":"PENDING","template_category":"UTILITY"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"whatsapp_template","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_templates","action":"create","key":"whatsapp_templates.create"}]}},"/api/v1/integrations/whatsapp/template/{whatsapp_business_profile_id}/update":{"patch":{"tags":["v1/Integrations/whatsapp"],"summary":"Update WhatsApp template","description":"Update a WhatsApp message template.\n\nRequired permissions:\n- `whatsapp_templates.update`","operationId":"updateWhatsAppTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsAppTemplateBody","$defs":{"ParamFormat":{"description":"The type of parameter formatting the HEADER and BODY components of the template will use.\n\nAttributes:\n    POSITIONAL: The component uses positional parameters, e.g. ``{{1}}``, ``{{2}}``, etc.\n    NAMED: The component uses named parameters, e.g. ``{{param_name}}``.","enum":["POSITIONAL","NAMED","UNKNOWN"],"title":"ParamFormat","type":"string"},"TemplateCategory":{"description":"Template category.\n\n`'Template Categorization' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines#template-categorization>`_\n\nAttributes:\n    AUTHENTICATION: Enable businesses to verify a user’s identity, potentially at various steps of the customer journey. See `Authentication templates <https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates>`_ for more details.\n    MARKETING: Enable businesses to achieve a wide range of goals, from generating awareness to driving sales and retargeting customers. See `Marketing templates <https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/marketing-templates>`_ for more details.\n    UTILITY: Enable businesses to follow up on user actions or requests, since these messages are typically triggered by user actions. See `Utility templates <https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/utility-templates>`_ for more details.","enum":["AUTHENTICATION","MARKETING","UTILITY","UNKNOWN"],"title":"TemplateCategory","type":"string"},"WhatsAppBusinessPhoneNumberMessageTemplateComponentButton":{"properties":{"type":{"description":"WhatsApp template component type.","examples":["BODY"],"minLength":1,"title":"Type","type":"string"},"text":{"description":"Template component text.","examples":["Hello {{1}}, your order is ready."],"minLength":1,"title":"Text","type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL for URL buttons.","examples":["https://example.com/orders/{{1}}"],"title":"Url"}},"required":["type","text"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentButton","type":"object"},"WhatsAppBusinessPhoneNumberMessageTemplateComponentExpand":{"properties":{"components":{"description":"WhatsApp template components.","examples":[[{"params":{"1":"Mia"},"text":"Hello {{1}}, your order is ready.","type":"BODY"}]],"items":{"anyOf":[{"$ref":"#/$defs/WhatsAppBusinessPhoneNumberMessageTemplateComponentText"},{"$ref":"#/$defs/WhatsAppBusinessPhoneNumberMessageTemplateComponentButton"}]},"minItems":1,"title":"Components","type":"array"}},"required":["components"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentExpand","type":"object"},"WhatsAppBusinessPhoneNumberMessageTemplateComponentText":{"properties":{"type":{"description":"WhatsApp template component type.","examples":["BODY"],"minLength":1,"title":"Type","type":"string"},"text":{"description":"Template component text.","examples":["Hello {{1}}, your order is ready."],"minLength":1,"title":"Text","type":"string"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"description":"Template parameters used while formatting component examples.","examples":[{"1":"Mia"}],"title":"Params"}},"required":["type","text"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentText","type":"object"}},"example":{"new_category":"UTILITY","new_components":{"components":[{"params":{"1":"Mia"},"text":"Hello {{1}}","type":"BODY"}]},"new_message_send_ttl_seconds":3600,"new_param_format":"POSITIONAL","template_id":"7442678451937742086"},"properties":{"template_id":{"description":"Local template ID to update.","examples":[7442678451937742086],"title":"Template Id","type":"integer"},"new_category":{"anyOf":[{"$ref":"#/$defs/TemplateCategory"},{"type":"null"}],"description":"Updated Meta template category.","examples":["UTILITY"]},"new_param_format":{"anyOf":[{"$ref":"#/$defs/ParamFormat"},{"type":"null"}],"description":"Updated template parameter format.","examples":["POSITIONAL"]},"new_message_send_ttl_seconds":{"anyOf":[{"exclusiveMinimum":0,"type":"integer"},{"type":"null"}],"description":"Updated message send TTL in seconds.","examples":[3600],"title":"New Message Send Ttl Seconds"},"new_components":{"anyOf":[{"$ref":"#/$defs/WhatsAppBusinessPhoneNumberMessageTemplateComponentExpand"},{"type":"null"}],"description":"Updated WhatsApp template components.","examples":[{"components":[{"params":{"1":"Mia"},"text":"Hello {{1}}","type":"BODY"}]}]}},"required":["template_id"],"title":"UpdateWhatsAppTemplateBody","type":"object"},"examples":{"example_1":{"value":{"template_id":"7442678451937742086","new_category":"UTILITY","new_param_format":"POSITIONAL","new_message_send_ttl_seconds":3600,"new_components":{"components":[{"type":"BODY","text":"Hello {{1}}","params":{"1":"Mia"}}]}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsAppTemplateResponse"},"examples":{"example_1":{"value":{"template_id":"7442678451937742086","template_details":{"status":"APPROVED"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"whatsapp_template","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_templates","action":"update","key":"whatsapp_templates.update"}]}},"/api/v1/integrations/whatsapp/template/{whatsapp_business_profile_id}/sync":{"post":{"tags":["v1/Integrations/whatsapp"],"summary":"Sync WhatsApp templates","description":"Sync WhatsApp message templates from Meta.\n\nRequired permissions:\n- `whatsapp_templates.update`","operationId":"syncWhatsAppTemplates","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncWhatsAppTemplatesResponse"},"examples":{"example_1":{"value":{"whatsapp_business_profile_id":"7442551216804781021","meta_count":12,"created_count":2,"deleted_count":1,"updated_count":9}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"whatsapp_templates","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_templates","action":"update","key":"whatsapp_templates.update"}]}},"/api/v1/integrations/whatsapp/template/{whatsapp_business_profile_id}/delete":{"delete":{"tags":["v1/Integrations/whatsapp"],"summary":"Delete WhatsApp templates","description":"Delete WhatsApp message templates.\n\nRequired permissions:\n- `whatsapp_templates.delete`","operationId":"deleteWhatsAppTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"whatsapp_business_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Whatsapp Business Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWhatsAppTemplateBody","example":{"template_ids":["7442678451937742086","7442678451937742214"]},"properties":{"template_ids":{"description":"Local template IDs to delete.","examples":[[7442678451937742086,7442678451937742214]],"items":{"type":"integer"},"minItems":1,"title":"Template Ids","type":"array","uniqueItems":true}},"required":["template_ids"],"title":"DeleteWhatsAppTemplateBody","type":"object"},"examples":{"example_1":{"value":{"template_ids":["7442678451937742086","7442678451937742214"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWhatsAppTemplateResponse"},"examples":{"example_1":{"value":{"requested_count":1,"deleted_ids":["7442678451937742086"],"deleted_count":1,"failed_ids":[{"template_id":"7442678451937742086","error_message":"Template is still pending review."}],"failed_count":0}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"whatsapp_templates","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_templates","action":"delete","key":"whatsapp_templates.delete"}]}},"/api/v1/integrations/whatsapp/template/{sending_phone_number_id}/send":{"post":{"tags":["v1/Integrations/announcement"],"summary":"Send template","description":"Send a stored WhatsApp template to recipients resolved from phone numbers, users, labels, and with optional runtime params.\n\nRequired permissions:\n- `whatsapp_business_phone_numbers.read`\n- `whatsapp_templates.read`\n- `chat_history_entries.create`","operationId":"sendTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sending_phone_number_id","in":"path","required":true,"schema":{"type":"integer","title":"Sending Phone Number Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTemplateBody","$defs":{"AuthenticationBodyParam":{"additionalProperties":false,"properties":{"type":{"const":"AUTHENTICATION_BODY","description":"Runtime authentication body parameter type.","examples":["AUTHENTICATION_BODY"],"title":"Type","type":"string"},"otp":{"description":"OTP value for the authentication body.","examples":["0220292","94604798"],"minLength":1,"title":"Otp","type":"string"}},"required":["type","otp"],"title":"AuthenticationBodyParam","type":"object"},"BodyTextParam":{"additionalProperties":false,"properties":{"type":{"const":"BODY_TEXT","description":"Runtime body text parameter type.","examples":["BODY_TEXT"],"title":"Type","type":"string"},"values":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"discriminator":{"mapping":{"CURRENCY":"#/$defs/CurrencyTextValue","DATE_TIME":"#/$defs/DateTimeTextValue"},"propertyName":"type"},"oneOf":[{"$ref":"#/$defs/CurrencyTextValue"},{"$ref":"#/$defs/DateTimeTextValue"}]}]},"type":"array"},{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"discriminator":{"mapping":{"CURRENCY":"#/$defs/CurrencyTextValue","DATE_TIME":"#/$defs/DateTimeTextValue"},"propertyName":"type"},"oneOf":[{"$ref":"#/$defs/CurrencyTextValue"},{"$ref":"#/$defs/DateTimeTextValue"}]}]},"type":"object"}],"description":"Text parameter values. Use an array for positional templates and an object for named templates.","examples":[["Max","Tuesday"],{"appointment_day":"Tuesday","customer_name":"Max"}],"title":"Values"}},"required":["type","values"],"title":"BodyTextParam","type":"object"},"CarouselParam":{"additionalProperties":false,"properties":{"type":{"const":"CAROUSEL","description":"Runtime carousel parameter type.","examples":["CAROUSEL"],"title":"Type","type":"string"},"cards":{"description":"Carousel card params. Each card must contain its own indexed component params.","examples":[[{"index":0,"params":[{"type":"HEADER_TEXT","values":["Offer 1"]},{"type":"BODY_TEXT","values":["Max","20% discount"]}]},{"index":1,"params":[{"type":"HEADER_TEXT","values":["Offer 2"]},{"index":0,"type":"URL","url_variable":"product/sku-2001"}]}]],"items":{"$ref":"#/$defs/TemplateSendCarouselCard"},"minItems":1,"title":"Cards","type":"array"}},"required":["type","cards"],"title":"CarouselParam","type":"object"},"CatalogParam":{"additionalProperties":false,"properties":{"type":{"const":"CATALOG","description":"Runtime catalog button parameter type.","examples":["CATALOG"],"title":"Type","type":"string"},"index":{"description":"Zero-based button index.","examples":[0,1,2],"minimum":0,"title":"Index","type":"integer"},"thumbnail_product_sku":{"description":"Thumbnail product SKU for catalog buttons.","examples":["SKU-1001","SKU-2001"],"minLength":1,"title":"Thumbnail Product Sku","type":"string"}},"required":["type","index","thumbnail_product_sku"],"title":"CatalogParam","type":"object"},"CopyCodeOTPParam":{"additionalProperties":false,"properties":{"type":{"const":"COPY_CODE_OTP","description":"Runtime copy-code OTP button parameter type.","examples":["COPY_CODE_OTP"],"title":"Type","type":"string"},"otp":{"description":"OTP value for copy-code OTP buttons.","examples":["576146","942147"],"minLength":1,"title":"Otp","type":"string"}},"required":["type","otp"],"title":"CopyCodeOTPParam","type":"object"},"CopyCodeParam":{"additionalProperties":false,"properties":{"type":{"const":"COPY_CODE","description":"Runtime copy-code button parameter type.","examples":["COPY_CODE"],"title":"Type","type":"string"},"index":{"description":"Zero-based button index.","examples":[0,1,2],"minimum":0,"title":"Index","type":"integer"},"coupon_code":{"description":"Coupon code value for copy-code buttons.","examples":["SPRING2026","WELCOME10"],"minLength":1,"title":"Coupon Code","type":"string"}},"required":["type","index","coupon_code"],"title":"CopyCodeParam","type":"object"},"CurrencyTextValue":{"additionalProperties":false,"properties":{"type":{"const":"CURRENCY","description":"Structured currency text value type.","examples":["CURRENCY"],"title":"Type","type":"string"},"fallback_value":{"description":"Human-readable fallback value for currency template params.","examples":["49,90 EUR","129,90 USD"],"minLength":1,"title":"Fallback Value","type":"string"},"code":{"description":"ISO currency code.","examples":["EUR","USD"],"minLength":1,"title":"Code","type":"string"},"amount_1000":{"description":"Amount in thousandths used by WhatsApp currency params.","examples":[49900,129900],"title":"Amount 1000","type":"integer"}},"required":["type","fallback_value","code","amount_1000"],"title":"CurrencyTextValue","type":"object"},"DateTimeTextValue":{"additionalProperties":false,"properties":{"type":{"const":"DATE_TIME","description":"Structured date-time text value type.","examples":["DATE_TIME"],"title":"Type","type":"string"},"fallback_value":{"description":"Fallback text shown when the client cannot localize the date/time value.","examples":["Tuesday","2026-05-13 14:30"],"minLength":1,"title":"Fallback Value","type":"string"}},"required":["type","fallback_value"],"title":"DateTimeTextValue","type":"object"},"FlowParam":{"additionalProperties":false,"properties":{"type":{"const":"FLOW","description":"Runtime flow button parameter type.","examples":["FLOW"],"title":"Type","type":"string"},"index":{"description":"Zero-based button index.","examples":[0,1,2],"minimum":0,"title":"Index","type":"integer"},"flow_token":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Flow token for flow buttons.","examples":["flow-session-123","flow-session-456"],"title":"Flow Token"},"flow_action_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Flow action payload for flow buttons.","examples":[{"cart_id":"cart-123","step":"checkout"},{"step":"support","ticket_id":"ticket-987"}],"title":"Flow Action Data"}},"required":["type","index"],"title":"FlowParam","type":"object"},"HeaderDocumentParam":{"additionalProperties":false,"properties":{"type":{"const":"HEADER_DOCUMENT","description":"Runtime document header parameter type.","examples":["HEADER_DOCUMENT"],"title":"Type","type":"string"},"document":{"anyOf":[{"type":"string"},{"type":"integer"}],"description":"Document link or media ID for a document header param.","examples":["https://cdn.example.com/contract.pdf",[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"title":"Document"},"filename":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Optional filename for document header params.","examples":["contract.pdf","pricing-overview.pdf"],"title":"Filename"},"mime_type":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Optional MIME type for media header params.","examples":["application/pdf"],"title":"Mime Type"}},"required":["type","document"],"title":"HeaderDocumentParam","type":"object"},"HeaderGIFParam":{"additionalProperties":false,"properties":{"type":{"const":"HEADER_GIF","description":"Runtime GIF header parameter type.","examples":["HEADER_GIF"],"title":"Type","type":"string"},"gif":{"anyOf":[{"type":"string"},{"type":"integer"}],"description":"GIF link or media ID for a GIF header param.","examples":["https://cdn.example.com/celebration.gif",[744128060820239091]],"title":"Gif"},"mime_type":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Optional MIME type for media header params.","examples":["image/gif"],"title":"Mime Type"}},"required":["type","gif"],"title":"HeaderGIFParam","type":"object"},"HeaderImageParam":{"additionalProperties":false,"properties":{"type":{"const":"HEADER_IMAGE","description":"Runtime image header parameter type.","examples":["HEADER_IMAGE"],"title":"Type","type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"integer"}],"description":"Image link or media ID for an image header param.","examples":["https://cdn.example.com/banner.jpg",[744128060820239091]],"title":"Image"},"mime_type":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Optional MIME type for media header params.","examples":["image/jpeg","image/png"],"title":"Mime Type"}},"required":["type","image"],"title":"HeaderImageParam","type":"object"},"HeaderLocationParam":{"additionalProperties":false,"properties":{"type":{"const":"HEADER_LOCATION","description":"Runtime location header parameter type.","examples":["HEADER_LOCATION"],"title":"Type","type":"string"},"lat":{"description":"Latitude for header location params.","examples":[51.39462700207981],"title":"Lat","type":"number"},"lon":{"description":"Longitude for header location params.","examples":[8.136012551231019],"title":"Lon","type":"number"},"name":{"description":"Display name for header location params.","examples":[["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]],"minLength":1,"title":"Name","type":"string"},"address":{"description":"Display address for header location params.","examples":["KirchstraÃŸe 44, 59823 Arnsberg"],"minLength":1,"title":"Address","type":"string"}},"required":["type","lat","lon","name","address"],"title":"HeaderLocationParam","type":"object"},"HeaderProductParam":{"additionalProperties":false,"properties":{"type":{"const":"HEADER_PRODUCT","description":"Runtime product header parameter type.","examples":["HEADER_PRODUCT"],"title":"Type","type":"string"},"catalog_id":{"description":"Catalog ID for header product params.","examples":[744128060820239091],"minLength":1,"title":"Catalog Id","type":"string"},"sku":{"description":"Product retailer ID for header product params.","examples":["SKU-1001","SKU-2001"],"minLength":1,"title":"Sku","type":"string"}},"required":["type","catalog_id","sku"],"title":"HeaderProductParam","type":"object"},"HeaderTextParam":{"additionalProperties":false,"properties":{"type":{"const":"HEADER_TEXT","description":"Runtime header text parameter type.","examples":["HEADER_TEXT"],"title":"Type","type":"string"},"values":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"discriminator":{"mapping":{"CURRENCY":"#/$defs/CurrencyTextValue","DATE_TIME":"#/$defs/DateTimeTextValue"},"propertyName":"type"},"oneOf":[{"$ref":"#/$defs/CurrencyTextValue"},{"$ref":"#/$defs/DateTimeTextValue"}]}]},"type":"array"},{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"discriminator":{"mapping":{"CURRENCY":"#/$defs/CurrencyTextValue","DATE_TIME":"#/$defs/DateTimeTextValue"},"propertyName":"type"},"oneOf":[{"$ref":"#/$defs/CurrencyTextValue"},{"$ref":"#/$defs/DateTimeTextValue"}]}]},"type":"object"}],"description":"Text parameter values. Use an array for positional templates and an object for named templates.","examples":[["Max","Tuesday"],{"appointment_day":"Tuesday","customer_name":"Max"}],"title":"Values"}},"required":["type","values"],"title":"HeaderTextParam","type":"object"},"HeaderVideoParam":{"additionalProperties":false,"properties":{"type":{"const":"HEADER_VIDEO","description":"Runtime video header parameter type.","examples":["HEADER_VIDEO"],"title":"Type","type":"string"},"video":{"anyOf":[{"type":"string"},{"type":"integer"}],"description":"Video link or media ID for a video header param.","examples":["https://cdn.example.com/intro.mp4",[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]],"title":"Video"},"mime_type":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}],"description":"Optional MIME type for media header params.","examples":["video/mp4","video/webm"],"title":"Mime Type"}},"required":["type","video"],"title":"HeaderVideoParam","type":"object"},"LimitedTimeOfferParam":{"additionalProperties":false,"properties":{"type":{"const":"LIMITED_TIME_OFFER","description":"Runtime limited-time-offer parameter type.","examples":["LIMITED_TIME_OFFER"],"title":"Type","type":"string"},"expiration_time":{"description":"Expiration timestamp for limited-time-offer params.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"],"format":"date-time","title":"Expiration Time","type":"string"}},"required":["type","expiration_time"],"title":"LimitedTimeOfferParam","type":"object"},"MPMParam":{"additionalProperties":false,"properties":{"type":{"const":"MPM","description":"Runtime multi-product button parameter type.","examples":["MPM"],"title":"Type","type":"string"},"index":{"description":"Zero-based button index.","examples":[0,1,2],"minimum":0,"title":"Index","type":"integer"},"thumbnail_product_sku":{"description":"Thumbnail product SKU for MPM buttons.","examples":["SKU-1001","SKU-2001"],"minLength":1,"title":"Thumbnail Product Sku","type":"string"},"product_sections":{"description":"MPM button product sections.","examples":[[{"skus":["SKU-1001","SKU-1002"],"title":"Recommended products"},{"skus":["SKU-2001"],"title":"Top sellers"}]],"items":{"$ref":"#/$defs/TemplateSendProductSection"},"minItems":1,"title":"Product Sections","type":"array"}},"required":["type","index","thumbnail_product_sku","product_sections"],"title":"MPMParam","type":"object"},"OTPParam":{"additionalProperties":false,"properties":{"type":{"const":"OTP","description":"Runtime generic OTP button parameter type.","examples":["OTP"],"title":"Type","type":"string"},"otp":{"description":"OTP value for the authentication body.","examples":["0220292","94604798"],"minLength":1,"title":"Otp","type":"string"}},"required":["type","otp"],"title":"OTPParam","type":"object"},"OneTapOTPParam":{"additionalProperties":false,"properties":{"type":{"const":"ONE_TAP_OTP","description":"Runtime one-tap OTP button parameter type.","examples":["ONE_TAP_OTP"],"title":"Type","type":"string"},"otp":{"description":"OTP value for one-tap OTP buttons.","examples":["576146","942147"],"minLength":1,"title":"Otp","type":"string"}},"required":["type","otp"],"title":"OneTapOTPParam","type":"object"},"QuickReplyParam":{"additionalProperties":false,"properties":{"type":{"const":"QUICK_REPLY","description":"Runtime quick reply button parameter type.","examples":["QUICK_REPLY"],"title":"Type","type":"string"},"index":{"description":"Zero-based button index.","examples":[0,1,2],"minimum":0,"title":"Index","type":"integer"},"callback_data":{"description":"Callback payload for quick reply buttons.","examples":["confirm_appointment","open_support_ticket"],"minLength":1,"title":"Callback Data","type":"string"}},"required":["type","index","callback_data"],"title":"QuickReplyParam","type":"object"},"TemplateLanguage":{"description":"Template language and locale code.\n\n`'Template language and locale code' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages>`_","enum":["None","af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","ar_SA","az","bn","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","en","en_GB","en_US","en_AU","en_CA","en_IN","et","fil","fi","fr","fr_CA","fr_BE","ka","de","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","sk","sl","es","es_AR","es_ES","es_MX","es_CL","es_CO","es_PE","es_VE","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu","UNKNOWN"],"title":"TemplateLanguage","type":"string"},"TemplateSendCarouselCard":{"additionalProperties":false,"example":{"index":0,"params":[{"type":"HEADER_TEXT","values":["Offer 1"]},{"type":"BODY_TEXT","values":["Max","20% discount"]}]},"properties":{"index":{"description":"Zero-based carousel card index.","examples":[0,1],"minimum":0,"title":"Index","type":"integer"},"params":{"description":"Runtime params for the carousel card components.","examples":[[{"type":"HEADER_TEXT","values":["Offer 1"]},{"type":"BODY_TEXT","values":["Max","20% discount"]}],[{"type":"HEADER_TEXT","values":["Offer 2"]},{"index":0,"type":"URL","url_variable":"product/sku-2001"}]],"items":{"discriminator":{"mapping":{"AUTHENTICATION_BODY":"#/$defs/AuthenticationBodyParam","BODY_TEXT":"#/$defs/BodyTextParam","CAROUSEL":"#/$defs/CarouselParam","CATALOG":"#/$defs/CatalogParam","COPY_CODE":"#/$defs/CopyCodeParam","COPY_CODE_OTP":"#/$defs/CopyCodeOTPParam","FLOW":"#/$defs/FlowParam","HEADER_DOCUMENT":"#/$defs/HeaderDocumentParam","HEADER_GIF":"#/$defs/HeaderGIFParam","HEADER_IMAGE":"#/$defs/HeaderImageParam","HEADER_LOCATION":"#/$defs/HeaderLocationParam","HEADER_PRODUCT":"#/$defs/HeaderProductParam","HEADER_TEXT":"#/$defs/HeaderTextParam","HEADER_VIDEO":"#/$defs/HeaderVideoParam","LIMITED_TIME_OFFER":"#/$defs/LimitedTimeOfferParam","MPM":"#/$defs/MPMParam","ONE_TAP_OTP":"#/$defs/OneTapOTPParam","OTP":"#/$defs/OTPParam","QUICK_REPLY":"#/$defs/QuickReplyParam","URL":"#/$defs/URLParam","ZERO_TAP_OTP":"#/$defs/ZeroTapOTPParam"},"propertyName":"type"},"oneOf":[{"$ref":"#/$defs/BodyTextParam"},{"$ref":"#/$defs/HeaderTextParam"},{"$ref":"#/$defs/AuthenticationBodyParam"},{"$ref":"#/$defs/HeaderImageParam"},{"$ref":"#/$defs/HeaderVideoParam"},{"$ref":"#/$defs/HeaderGIFParam"},{"$ref":"#/$defs/HeaderDocumentParam"},{"$ref":"#/$defs/HeaderLocationParam"},{"$ref":"#/$defs/HeaderProductParam"},{"$ref":"#/$defs/QuickReplyParam"},{"$ref":"#/$defs/URLParam"},{"$ref":"#/$defs/CopyCodeParam"},{"$ref":"#/$defs/FlowParam"},{"$ref":"#/$defs/CatalogParam"},{"$ref":"#/$defs/MPMParam"},{"$ref":"#/$defs/OTPParam"},{"$ref":"#/$defs/OneTapOTPParam"},{"$ref":"#/$defs/ZeroTapOTPParam"},{"$ref":"#/$defs/CopyCodeOTPParam"},{"$ref":"#/$defs/LimitedTimeOfferParam"},{"$ref":"#/$defs/CarouselParam"}]},"minItems":1,"title":"Params","type":"array"}},"required":["index","params"],"title":"TemplateSendCarouselCard","type":"object"},"TemplateSendProductSection":{"additionalProperties":false,"example":{"skus":["SKU-1001","SKU-1002"],"title":"Recommended products"},"properties":{"title":{"description":"Title of the MPM product section.","examples":["Recommended products","Top sellers"],"minLength":1,"title":"Title","type":"string"},"skus":{"description":"Product retailer IDs for the MPM section.","examples":[["SKU-1001","SKU-1002"],["SKU-2001"]],"items":{"type":"string"},"minItems":1,"title":"Skus","type":"array"}},"required":["title","skus"],"title":"TemplateSendProductSection","type":"object"},"URLParam":{"additionalProperties":false,"properties":{"type":{"const":"URL","description":"Runtime URL button parameter type.","examples":["URL"],"title":"Type","type":"string"},"index":{"description":"Zero-based button index.","examples":[0,1,2],"minimum":0,"title":"Index","type":"integer"},"url_variable":{"description":"URL suffix variable for URL buttons.","examples":["appointment/123","products/sku-2001"],"minLength":1,"title":"Url Variable","type":"string"}},"required":["type","index","url_variable"],"title":"URLParam","type":"object"},"ZeroTapOTPParam":{"additionalProperties":false,"properties":{"type":{"const":"ZERO_TAP_OTP","description":"Runtime zero-tap OTP button parameter type.","examples":["ZERO_TAP_OTP"],"title":"Type","type":"string"},"otp":{"description":"OTP value for zero-tap OTP buttons.","examples":["576146","942147"],"minLength":1,"title":"Otp","type":"string"}},"required":["type","otp"],"title":"ZeroTapOTPParam","type":"object"}},"example":{"label_ids":["7442550215703679284"],"language_code":"de","only_related_chats":true,"params":[{"type":"HEADER_TEXT","values":["LIVOI"]},{"type":"BODY_TEXT","values":["Max",{"fallback_value":"Tuesday","type":"DATE_TIME"}]},{"index":0,"type":"URL","url_variable":"appointment/123"}],"phone_numbers":["+491701234567"],"template_id":"7442550215703679137","user_ids":["744128060820239091"]},"properties":{"template_id":{"description":"Identifier of the stored WhatsApp template to send.","examples":[7442550215703679137],"title":"Template Id","type":"integer"},"language_code":{"anyOf":[{"$ref":"#/$defs/TemplateLanguage"},{"type":"null"}],"description":"Optional template language override. Defaults to the stored template language when omitted.","examples":["de","en"]},"phone_numbers":{"description":"Explicit recipient phone numbers.","examples":[["+491701234567"],["+491701234567","+4917611122233"]],"items":{"type":"string"},"title":"Phone Numbers","type":"array"},"user_ids":{"description":"Recipient user IDs. Their phone numbers from this tenant's user profiles are merged into the recipient list.","examples":[[744128060820239091],[7442550215703679004,7442550215703679137]],"items":{"type":"integer"},"title":"User Ids","type":"array"},"label_ids":{"description":"Recipient label IDs. Chats with these labels will be resolved to users and then to phone numbers.","examples":[[7442550215703679284],[7442550215703679284,7442550215703679412]],"items":{"type":"integer"},"title":"Label Ids","type":"array"},"only_related_chats":{"default":false,"description":"When true, label-based chat resolution only uses chats related to the selected sending phone number.","examples":[true,false],"title":"Only Related Chats","type":"boolean"},"params":{"anyOf":[{"items":{"discriminator":{"mapping":{"AUTHENTICATION_BODY":"#/$defs/AuthenticationBodyParam","BODY_TEXT":"#/$defs/BodyTextParam","CAROUSEL":"#/$defs/CarouselParam","CATALOG":"#/$defs/CatalogParam","COPY_CODE":"#/$defs/CopyCodeParam","COPY_CODE_OTP":"#/$defs/CopyCodeOTPParam","FLOW":"#/$defs/FlowParam","HEADER_DOCUMENT":"#/$defs/HeaderDocumentParam","HEADER_GIF":"#/$defs/HeaderGIFParam","HEADER_IMAGE":"#/$defs/HeaderImageParam","HEADER_LOCATION":"#/$defs/HeaderLocationParam","HEADER_PRODUCT":"#/$defs/HeaderProductParam","HEADER_TEXT":"#/$defs/HeaderTextParam","HEADER_VIDEO":"#/$defs/HeaderVideoParam","LIMITED_TIME_OFFER":"#/$defs/LimitedTimeOfferParam","MPM":"#/$defs/MPMParam","ONE_TAP_OTP":"#/$defs/OneTapOTPParam","OTP":"#/$defs/OTPParam","QUICK_REPLY":"#/$defs/QuickReplyParam","URL":"#/$defs/URLParam","ZERO_TAP_OTP":"#/$defs/ZeroTapOTPParam"},"propertyName":"type"},"oneOf":[{"$ref":"#/$defs/BodyTextParam"},{"$ref":"#/$defs/HeaderTextParam"},{"$ref":"#/$defs/AuthenticationBodyParam"},{"$ref":"#/$defs/HeaderImageParam"},{"$ref":"#/$defs/HeaderVideoParam"},{"$ref":"#/$defs/HeaderGIFParam"},{"$ref":"#/$defs/HeaderDocumentParam"},{"$ref":"#/$defs/HeaderLocationParam"},{"$ref":"#/$defs/HeaderProductParam"},{"$ref":"#/$defs/QuickReplyParam"},{"$ref":"#/$defs/URLParam"},{"$ref":"#/$defs/CopyCodeParam"},{"$ref":"#/$defs/FlowParam"},{"$ref":"#/$defs/CatalogParam"},{"$ref":"#/$defs/MPMParam"},{"$ref":"#/$defs/OTPParam"},{"$ref":"#/$defs/OneTapOTPParam"},{"$ref":"#/$defs/ZeroTapOTPParam"},{"$ref":"#/$defs/CopyCodeOTPParam"},{"$ref":"#/$defs/LimitedTimeOfferParam"},{"$ref":"#/$defs/CarouselParam"}]},"type":"array"},{"type":"null"}],"description":"Runtime params for the stored template components. The same params are applied to every resolved recipient.","examples":[[{"type":"HEADER_TEXT","values":["LIVOI"]},{"type":"BODY_TEXT","values":["Max",{"fallback_value":"Tuesday","type":"DATE_TIME"}]},{"index":0,"type":"URL","url_variable":"appointment/123"}],[{"type":"BODY_TEXT","values":["Max",{"fallback_value":"Tuesday","type":"DATE_TIME"}]}],[{"callback_data":"confirm_appointment","index":0,"type":"QUICK_REPLY"}]],"title":"Params"}},"required":["template_id"],"title":"SendTemplateBody","type":"object"},"examples":{"example_1":{"value":{"template_id":"7442550215703679137","language_code":"de","phone_numbers":["+491701234567"],"user_ids":["744128060820239091"],"label_ids":["7442550215703679284"],"only_related_chats":true,"params":[{"type":"HEADER_TEXT","values":["LIVOI"]},{"type":"BODY_TEXT","values":["Max",{"type":"DATE_TIME","fallback_value":"Tuesday"}]},{"type":"URL","index":0,"url_variable":"appointment/123"}]}},"example_2":{"value":{"template_id":"7442550215703679137","language_code":"en","phone_numbers":["+491701234567","+4917611122233"],"user_ids":["7442550215703679004","7442550215703679137"],"label_ids":["7442550215703679284","7442550215703679412"],"only_related_chats":false,"params":[{"type":"BODY_TEXT","values":["Max",{"type":"DATE_TIME","fallback_value":"Tuesday"}]}]}},"example_3":{"value":{"template_id":"7442550215703679137","language_code":"de","phone_numbers":["+491701234567"],"user_ids":["744128060820239091"],"label_ids":["7442550215703679284"],"only_related_chats":true,"params":[{"type":"QUICK_REPLY","index":0,"callback_data":"confirm_appointment"}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTemplateResponse"},"examples":{"example_1":{"value":{"sent_to":["+491701234567","+4917611122233"],"results":[{"recipient":"+491701234567","outcome":"accepted"}],"delivery_status":"delivered"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"whatsapp_announcement","x-auth-context":"tenant","x-required-permissions":[{"model":"whatsapp_business_phone_numbers","action":"read","key":"whatsapp_business_phone_numbers.read"},{"model":"whatsapp_templates","action":"read","key":"whatsapp_templates.read"},{"model":"chat_history_entries","action":"create","key":"chat_history_entries.create"}]}},"/api/v1/integrations/datev/profiles":{"post":{"tags":["v1/Integrations/datev"],"summary":"Create a DATEV profile (exchange code for tokens)","description":"Exchanges an authorization code for tokens and creates a new DATEV profile.\n\nRequired permissions:\n- `datev_profiles.create`","operationId":"createDatevProfile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatevProfileBody","example":{"code":"abc123","code_verifier":"someRandomVerifier","profile_name":"Steuerberater","redirect_uri":"http://localhost"},"properties":{"code":{"description":"Authorization code from DATEV redirect","examples":["abc123"],"title":"Code","type":"string"},"code_verifier":{"description":"PKCE code_verifier used in the authorization request","examples":["someRandomVerifier"],"title":"Code Verifier","type":"string"},"redirect_uri":{"description":"Redirect URI used in the authorization request","examples":["http://localhost"],"title":"Redirect Uri","type":"string"},"profile_name":{"default":"","description":"Optional display name for this DATEV profile empty by default","examples":["Steuerberater"],"title":"Profile Name","type":"string"}},"required":["code","code_verifier","redirect_uri"],"title":"CreateDatevProfileBody","type":"object"},"examples":{"example_1":{"value":{"code":"abc123","code_verifier":"someRandomVerifier","redirect_uri":"http://localhost","profile_name":"Steuerberater"}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatevProfileResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","name":"Steuerberater","created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","refresh_at":"2026-03-13T09:00:00+00:00","message":"DATEV profile created successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"create","key":"datev_profiles.create"}]},"get":{"tags":["v1/Integrations/datev"],"summary":"List DATEV profiles for current scope","description":"Lists DATEV profiles accessible to the current user.\n\nRequired permissions:\n- `datev_profiles.read`\n- `agents.read`","operationId":"listDatevProfiles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatevProfilesResponse"},"examples":{"example_1":{"value":{"profiles":[{"id":"7442550215703679004","name":"Steuerberater","created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","refresh_at":"2026-03-13T09:00:00+00:00","revoked":false,"tokens_expired":false,"assigned_agent_ids":["7442551216804781198"],"assigned_agent_count":1}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"read","key":"datev_profiles.read"},{"model":"agents","action":"read","key":"agents.read"}]},"delete":{"tags":["v1/Integrations/datev"],"summary":"Delete a DATEV profile","description":"Deletes one or more DATEV profiles and their associated data.\n\nRequired permissions:\n- `datev_profiles.delete`\n- `datev_invoice_previews.delete`\n- `datev_invoice_registry.delete`","operationId":"deleteDatevProfile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteDatevProfileBody","example":{"datev_profile_ids":["7442550215703679137"]},"properties":{"datev_profile_ids":{"description":"DATEV profile IDs","examples":[[7442550215703679137]],"items":{"type":"integer"},"title":"Datev Profile Ids","type":"array"}},"required":["datev_profile_ids"],"title":"DeleteDatevProfileBody","type":"object"},"examples":{"example_1":{"value":{"datev_profile_ids":["7442550215703679137"]}}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteDatevProfileResponse"},"examples":{"example_1":{"value":{"message":"DATEV profiles deleted successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"delete","key":"datev_profiles.delete"},{"model":"datev_invoice_previews","action":"delete","key":"datev_invoice_previews.delete"},{"model":"datev_invoice_registry","action":"delete","key":"datev_invoice_registry.delete"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/reconnect":{"post":{"tags":["v1/Integrations/datev"],"summary":"Reconnect an existing DATEV profile (exchange code for tokens)","description":"Exchanges an authorization code for tokens and updates an existing DATEV profile.\n\nRequired permissions:\n- `datev_profiles.update`","operationId":"reconnectDatevProfile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectDatevProfileBody","example":{"code":"abc123","code_verifier":"someRandomVerifier","profile_name":"Steuerberater","redirect_uri":"http://localhost"},"properties":{"code":{"description":"Authorization code from DATEV redirect","examples":["abc123"],"title":"Code","type":"string"},"code_verifier":{"description":"PKCE code_verifier used in the authorization request","examples":["someRandomVerifier"],"title":"Code Verifier","type":"string"},"redirect_uri":{"description":"Redirect URI used in the authorization request","examples":["http://localhost"],"title":"Redirect Uri","type":"string"},"profile_name":{"default":"","description":"Optional profile name update during reconnect","examples":["Steuerberater"],"title":"Profile Name","type":"string"}},"required":["code","code_verifier","redirect_uri"],"title":"ReconnectDatevProfileBody","type":"object"},"examples":{"example_1":{"value":{"code":"abc123","code_verifier":"someRandomVerifier","redirect_uri":"http://localhost","profile_name":"Steuerberater"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectDatevProfileResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","name":"Steuerberater","created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","refresh_at":"2026-03-13T09:00:00+00:00","message":"DATEV profile reconnected successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"update","key":"datev_profiles.update"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/revoke":{"post":{"tags":["v1/Integrations/datev"],"summary":"Revoke access for a DATEV profile","description":"Revokes the access and refresh tokens for a DATEV profile.\n\nRequired permissions:\n- `datev_profiles.update`","operationId":"revokeDatevProfileAccess","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeDatevProfileAccessResponse"},"examples":{"example_1":{"value":{"message":"DATEV profile access revoked successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"update","key":"datev_profiles.update"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/refresh":{"patch":{"tags":["v1/Integrations/datev"],"summary":"Refresh DATEV tokens for a profile","description":"Refreshes the OAuth tokens for a DATEV profile.\n\nRequired permissions:\n- `datev_profiles.update`","operationId":"refreshDatevProfileTokens","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshDatevProfileTokensResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","name":"Steuerberater","created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","refresh_at":"2026-03-13T09:00:00+00:00","message":"DATEV tokens refreshed successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"update","key":"datev_profiles.update"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/invoice-defaults":{"patch":{"tags":["v1/Integrations/datev"],"summary":"Update DATEV invoice default attributes for a profile","description":"Updates profile defaults. With replace=false, payload is applied as merge patch (`null` removes keys and empty nested objects are pruned).\n\nRequired permissions:\n- `datev_profiles.update`","operationId":"updateDatevProfileInvoiceDefaults","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatevProfileInvoiceDefaultsBody","$defs":{"DatevInvoiceDefaultsAddress":{"properties":{"street":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller street address.","title":"Street"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller postal code.","title":"Postal Code"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller city.","title":"City"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller ISO country code (e.g. DE).","title":"Country Code"}},"title":"DatevInvoiceDefaultsAddress","type":"object"},"DatevInvoiceDefaultsContact":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller contact name.","title":"Name"},"telephone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller contact phone number.","title":"Telephone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller contact email address.","title":"Email"}},"title":"DatevInvoiceDefaultsContact","type":"object"},"DatevInvoiceDefaultsEndpoint":{"properties":{"value":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller electronic endpoint value (e.g. email).","title":"Value"},"scheme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Endpoint scheme ID (e.g. \"EM\").","title":"Scheme Id"}},"title":"DatevInvoiceDefaultsEndpoint","type":"object"},"DatevInvoiceDefaultsPatch":{"example":{"seller":{"address":{},"contact":{},"endpoint":{}}},"properties":{"currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Default currency code (e.g. \"EUR\").","title":"Currency Code"},"invoice_type_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Default invoice type code (e.g. \"380\").","title":"Invoice Type Code"},"customization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Default customization ID.","title":"Customization Id"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Default profile ID.","title":"Profile Id"},"payment_means_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Default payment means code (e.g. \"58\").","title":"Payment Means Code"},"payee_iban":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Default payee IBAN.","title":"Payee Iban"},"due_days":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"description":"Default due date offset in days.","title":"Due Days"},"seller":{"anyOf":[{"$ref":"#/$defs/DatevInvoiceDefaultsSeller"},{"type":"null"}],"description":"Default seller object."}},"title":"DatevInvoiceDefaultsPatch","type":"object"},"DatevInvoiceDefaultsSeller":{"example":{"address":{},"contact":{},"endpoint":{}},"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller company/legal name.","title":"Name"},"vat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller VAT ID.","title":"Vat Id"},"tax_registration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller tax registration ID.","title":"Tax Registration Id"},"legal_registration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller legal registration ID.","title":"Legal Registration Id"},"identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Seller identifier.","title":"Identifier"},"endpoint":{"anyOf":[{"$ref":"#/$defs/DatevInvoiceDefaultsEndpoint"},{"type":"null"}],"description":"Seller endpoint defaults."},"address":{"anyOf":[{"$ref":"#/$defs/DatevInvoiceDefaultsAddress"},{"type":"null"}],"description":"Seller address defaults."},"contact":{"anyOf":[{"$ref":"#/$defs/DatevInvoiceDefaultsContact"},{"type":"null"}],"description":"Seller contact defaults."}},"title":"DatevInvoiceDefaultsSeller","type":"object"}},"example":{"defaults":{"seller":{"address":{},"contact":{},"endpoint":{}}}},"properties":{"defaults":{"anyOf":[{"$ref":"#/$defs/DatevInvoiceDefaultsPatch"},{"type":"null"}],"description":"Merge-patch payload for DATEV invoice defaults. `null` removes keys; empty nested objects are pruned."},"invoice_number_format":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"description":"Invoice number format (max 64 chars) with placeholders: {yy} or {yyyy} and exactly one {nr} or {nr:<number>} (where <number> can be between 1 and 16). {nr} defaults to width 4.","title":"Invoice Number Format"},"invoice_number_counter":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"description":"Optional manual override of next invoice number counter (>= 1).","title":"Invoice Number Counter"},"replace":{"default":false,"description":"If true, replace all current defaults with the provided defaults object. If false, apply merge-patch semantics from `defaults`.","title":"Replace","type":"boolean"}},"title":"UpdateDatevProfileInvoiceDefaultsBody","type":"object"},"examples":{"example_1":{"value":{"defaults":{"seller":{"endpoint":{},"address":{},"contact":{}}}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatevProfileInvoiceDefaultsResponse"},"examples":{"example_1":{"value":{"message":"DATEV invoice defaults updated successfully.","id":"7442550215703679004","invoice_defaults":{"currency_code":"EUR","payment_means_code":"58","payee_iban":"DE02120300000000202051","due_days":14,"seller":{"name":"LIVOI GmbH","contact":{"email":"billing@livoi.de"}}},"invoice_number_format":"RE-{yyyy}-{nr:4}","invoice_number_counter":1,"invoice_number_counter_year":2026}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"update","key":"datev_profiles.update"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/traffiqx/{traffiqx_id}/inbox":{"get":{"tags":["v1/Integrations/datev"],"summary":"List TRAFFIQX inbox document IDs","description":"Lists TRAFFIQX inbox document IDs for a DATEV profile and client.\n\nRequired permissions:\n- `datev_profiles.read`","operationId":"listDatevInboxDocuments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"traffiqx_id","in":"path","required":true,"schema":{"type":"string","minLength":13,"maxLength":15,"title":"Traffiqx Id"}},{"name":"downloaded","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by download status (true = downloaded, false = not downloaded).","title":"Downloaded"},"description":"Filter by download status (true = downloaded, false = not downloaded)."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatevInboxDocumentsResponse"},"examples":{"example_1":{"value":{"inbox_document_ids":["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","f02bb6a2-7a2f-4c9e-91c9-1d4a2b6f3c10"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/traffiqx/{traffiqx_id}/inbox/{document_id}":{"get":{"tags":["v1/Integrations/datev"],"summary":"Download a TRAFFIQX inbox document","description":"Downloads a TRAFFIQX inbox document as a binary stream.\n\nRequired permissions:\n- `datev_profiles.read`","operationId":"downloadDatevInboxDocument","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"traffiqx_id","in":"path","required":true,"schema":{"type":"string","minLength":13,"maxLength":15,"title":"Traffiqx Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Accept header forwarded to TRAFFIQX (e.g. application/zip).","default":"application/zip","title":"Accept"},"description":"Accept header forwarded to TRAFFIQX (e.g. application/zip)."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"File response.","content":{"application/json":{"schema":{}},"application/zip":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-file-response":{"media_types":["application/zip","application/octet-stream"]},"x-required-permissions":[{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/traffiqx/{traffiqx_id}/outbox":{"get":{"tags":["v1/Integrations/datev"],"summary":"List TRAFFIQX outbox document IDs","description":"Lists TRAFFIQX outbox document IDs for a DATEV profile and client.\n\nRequired permissions:\n- `datev_profiles.read`","operationId":"listDatevOutboxDocuments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"traffiqx_id","in":"path","required":true,"schema":{"type":"string","minLength":13,"maxLength":15,"title":"Traffiqx Id"}},{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Accept header forwarded to TRAFFIQX (e.g. application/json).","default":"application/json","title":"Accept"},"description":"Accept header forwarded to TRAFFIQX (e.g. application/json)."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatevOutboxDocumentsResponse"},"examples":{"example_1":{"value":{"outbox_document_ids":["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","f02bb6a2-7a2f-4c9e-91c9-1d4a2b6f3c10"],"outbox_documents":[{"document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","status":"SENT"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/traffiqx/{traffiqx_id}/outbox/{document_id}":{"get":{"tags":["v1/Integrations/datev"],"summary":"Download a TRAFFIQX outbox document","description":"Downloads a TRAFFIQX outbox document as a binary stream.\n\nRequired permissions:\n- `datev_profiles.read`","operationId":"downloadDatevOutboxDocument","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"traffiqx_id","in":"path","required":true,"schema":{"type":"string","minLength":13,"maxLength":15,"title":"Traffiqx Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Accept header forwarded to TRAFFIQX (e.g. application/zip).","default":"application/zip","title":"Accept"},"description":"Accept header forwarded to TRAFFIQX (e.g. application/zip)."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"File response.","content":{"application/json":{"schema":{}},"application/zip":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-file-response":{"media_types":["application/zip","application/octet-stream"]},"x-required-permissions":[{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/traffiqx/{traffiqx_id}/outbox/{document_id}/status":{"get":{"tags":["v1/Integrations/datev"],"summary":"Get TRAFFIQX outbox document status","description":"Gets the current TRAFFIQX outbox document status.\n\nRequired permissions:\n- `datev_profiles.read`","operationId":"getDatevOutboxDocumentStatus","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"traffiqx_id","in":"path","required":true,"schema":{"type":"string","minLength":13,"maxLength":15,"title":"Traffiqx Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDatevOutboxDocumentStatusResponse"},"examples":{"example_1":{"value":{"document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","status":"sent","is_terminal":true,"checked_at":"2026-02-20T10:35:00+00:00","raw":{"status":"sent"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/profiles/{datev_profile_id}/traffiqx/{traffiqx_id}/outbox/{document_id}/status/wait":{"get":{"tags":["v1/Integrations/datev"],"summary":"Wait for TRAFFIQX outbox document status","description":"Polls the TRAFFIQX outbox document status until terminal or timeout.\n\nRequired permissions:\n- `datev_profiles.read`","operationId":"waitForDatevOutboxDocumentStatus","security":[{"HTTPBearer":[]}],"parameters":[{"name":"datev_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Datev Profile Id"}},{"name":"traffiqx_id","in":"path","required":true,"schema":{"type":"string","minLength":13,"maxLength":15,"title":"Traffiqx Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"max_wait_seconds","in":"query","required":false,"schema":{"type":"integer","maximum":600,"minimum":5,"description":"Maximum total wait time in seconds before returning the latest known status.","default":60,"title":"Max Wait Seconds"},"description":"Maximum total wait time in seconds before returning the latest known status."},{"name":"initial_interval_seconds","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":1,"description":"Initial polling interval in seconds.","default":2,"title":"Initial Interval Seconds"},"description":"Initial polling interval in seconds."},{"name":"max_interval_seconds","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":1,"description":"Maximum polling interval in seconds for exponential backoff.","default":15,"title":"Max Interval Seconds"},"description":"Maximum polling interval in seconds for exponential backoff."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitForDatevOutboxDocumentStatusResponse"},"examples":{"example_1":{"value":{"document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","status":"sent","is_terminal":true,"timed_out":false,"attempts":3,"waited_seconds":9,"checked_at":"2026-02-20T10:41:09+00:00","raw":{"status":"sent"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/invoice-previews":{"get":{"tags":["v1/Integrations/datev"],"summary":"List DATEV invoice previews for current scope","description":"Lists DATEV invoice previews accessible to the current user.\n\nRequired permissions:\n- `datev_invoice_previews.read`\n- `datev_profiles.read`","operationId":"listDatevInvoicePreviews","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","upload_failed"],"type":"string"},{"type":"null"}],"description":"Optional status filter for active previews.","title":"Status"},"description":"Optional status filter for active previews."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Maximum previews returned.","default":100,"title":"Limit"},"description":"Maximum previews returned."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatevInvoicePreviewsResponse"},"examples":{"example_1":{"value":{"previews":[{"id":"7442551216804781021","datev_profile_id":"7442550215703679004","invoice_number":"RE-2026-001","traffiqx_id":"1234567890123","status":"pending","created_at":"2026-02-10T12:00:00+00:00","updated_at":"2026-02-10T12:00:00+00:00"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_invoice_previews","action":"read","key":"datev_invoice_previews.read"},{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/invoice-previews/{preview_id}":{"get":{"tags":["v1/Integrations/datev"],"summary":"Get DATEV invoice preview details","description":"Gets the details of a specific DATEV invoice preview.\n\nRequired permissions:\n- `datev_invoice_previews.read`\n- `datev_profiles.read`","operationId":"getDatevInvoicePreview","security":[{"HTTPBearer":[]}],"parameters":[{"name":"preview_id","in":"path","required":true,"schema":{"type":"integer","title":"Preview Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDatevInvoicePreviewResponse"},"examples":{"example_1":{"value":{"preview":{"id":"7442551216804781021","datev_profile_id":"7442550215703679004","invoice_number":"RE-2026-001","traffiqx_id":"1234567890123","status":"pending","created_at":"2026-02-10T12:00:00+00:00","updated_at":"2026-02-10T12:00:00+00:00","totals":{"net_total":"100.00","tax_total":"19.00","gross_total":"119.00","currency":"EUR"},"xml_content":"<?xml version=\"1.0\" encoding=\"utf-8\"?>"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_invoice_previews","action":"read","key":"datev_invoice_previews.read"},{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]},"delete":{"tags":["v1/Integrations/datev"],"summary":"Delete a DATEV invoice preview","description":"Deletes a DATEV invoice preview and records a deletion event in the registry.\n\nRequired permissions:\n- `datev_invoice_previews.delete`\n- `datev_invoice_registry.create`","operationId":"deleteDatevInvoicePreview","security":[{"HTTPBearer":[]}],"parameters":[{"name":"preview_id","in":"path","required":true,"schema":{"type":"integer","title":"Preview Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteDatevInvoicePreviewResponse"},"examples":{"example_1":{"value":{"message":"DATEV invoice preview deleted successfully.","preview_id":"7442551216804781021","status":"deleted","deleted_at":"2026-02-10T12:10:00+00:00"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_invoice_previews","action":"delete","key":"datev_invoice_previews.delete"},{"model":"datev_invoice_registry","action":"create","key":"datev_invoice_registry.create"}]}},"/api/v1/integrations/datev/invoice-previews/{preview_id}/confirm-upload":{"post":{"tags":["v1/Integrations/datev"],"summary":"Confirm upload of a DATEV invoice preview to TRAFFIQX","description":"Confirms and executes the upload of a DATEV invoice preview to TRAFFIQX.\n\nRequired permissions:\n- `datev_invoice_previews.update`\n- `datev_invoice_previews.delete`\n- `datev_invoice_registry.create`\n- `datev_profiles.update`","operationId":"confirmDatevInvoicePreviewUpload","security":[{"HTTPBearer":[]}],"parameters":[{"name":"preview_id","in":"path","required":true,"schema":{"type":"integer","title":"Preview Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmDatevInvoicePreviewUploadResponse"},"examples":{"example_1":{"value":{"message":"DATEV invoice preview uploaded successfully.","preview_id":"7442551216804781021","registry_id":"7442678451937742086","status":"uploaded","upload_document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","upload_href":"/platform/v1/traffiqx-clients/1234567890123/outbox-documents/b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","uploaded_at":"2026-02-10T12:05:00+00:00"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_invoice_previews","action":"update","key":"datev_invoice_previews.update"},{"model":"datev_invoice_previews","action":"delete","key":"datev_invoice_previews.delete"},{"model":"datev_invoice_registry","action":"create","key":"datev_invoice_registry.create"},{"model":"datev_profiles","action":"update","key":"datev_profiles.update"}]}},"/api/v1/integrations/datev/invoice-registry/{registry_id}/archive-url":{"get":{"tags":["v1/Integrations/datev"],"summary":"Get presigned URL for archived DATEV outgoing invoice JSON","description":"Gets a presigned URL for an archived DATEV outgoing invoice JSON object.\n\nRequired permissions:\n- `datev_invoice_registry.read`\n- `datev_profiles.read`","operationId":"getDatevInvoiceRegistryArchiveUrl","security":[{"HTTPBearer":[]}],"parameters":[{"name":"registry_id","in":"path","required":true,"schema":{"type":"integer","title":"Registry Id"}},{"name":"expires_in_seconds","in":"query","required":false,"schema":{"type":"integer","maximum":3600,"minimum":30,"description":"Presigned URL lifetime in seconds.","default":300,"title":"Expires In Seconds"},"description":"Presigned URL lifetime in seconds."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDatevInvoiceRegistryArchiveUrlResponse"},"examples":{"example_1":{"value":{"registry_id":"7442678451937742086","archive_url":"https://storage.example.com/bucket/...signature...","expires_at":"2026-02-24T15:05:00+00:00","archive_content_encoding":"json"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_invoice_registry","action":"read","key":"datev_invoice_registry.read"},{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/datev/invoice-registry/archives/bulk":{"post":{"tags":["v1/Integrations/datev"],"summary":"Get archived DATEV outgoing invoice JSON in bulk","description":"Retrieves archived DATEV outgoing invoice JSON payloads in bulk.\n\nRequired permissions:\n- `datev_invoice_registry.read`\n- `datev_profiles.read`","operationId":"getDatevInvoiceRegistryArchivesBulk","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDatevInvoiceRegistryArchivesBulkBody","example":{"registry_ids":["7442678451937742086","7442678451937742214"]},"properties":{"registry_ids":{"description":"DATEV invoice registry IDs to resolve in bulk.","examples":[[7442678451937742086,7442678451937742214]],"items":{"type":"integer"},"maxItems":100,"minItems":1,"title":"Registry Ids","type":"array"}},"required":["registry_ids"],"title":"GetDatevInvoiceRegistryArchivesBulkBody","type":"object"},"examples":{"example_1":{"value":{"registry_ids":["7442678451937742086","7442678451937742214"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDatevInvoiceRegistryArchivesBulkResponse"},"examples":{"example_1":{"value":{"requested_count":3,"success_count":2,"error_count":1,"partial":true,"items":[{"registry_id":"7442678451937742214","status":"ok","archive_json":{"invoice_number":"RE-2026-001"},"archive_content_encoding":"json","archive_size_bytes":128}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-required-permissions":[{"model":"datev_invoice_registry","action":"read","key":"datev_invoice_registry.read"},{"model":"datev_profiles","action":"read","key":"datev_profiles.read"}]}},"/api/v1/integrations/auth/identities":{"get":{"tags":["v1/Integrations/auth"],"summary":"List integration identities","description":"List the authenticated user's reusable integration identities without returning credentials.","operationId":"listIntegrationIdentities","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListIntegrationIdentitiesResponse"},"examples":{"example_1":{"value":{"identities":[{"integration_identity_id":"<integration_identity_id>","provider":"<provider>","provider_subject":"<provider_subject>","provider_email":"<provider_email>","provider_tenant_id":"<provider_tenant_id>","provider_metadata":"<provider_metadata>","requested_scopes":["<requested_scopes>"],"granted_scopes":["<granted_scopes>"],"status":"<status>","last_error":"<last_error>","access_token_expires_at":"<access_token_expires_at>","created_at":"<created_at>","updated_at":"<updated_at>"}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"integration_identities","x-auth-context":"tenant"}},"/api/v1/integrations/auth/identities/{integration_identity_id}":{"delete":{"tags":["v1/Integrations/auth"],"summary":"Delete integration identity","description":"Delete one of your integration identities and disconnect its consumers. For an MCP connection, this deletes all of your identities in the current tenant for the same exact server URL and disconnects every agent using that connection. This also applies when the selected MCP identity is pending or failed.","operationId":"deleteIntegrationIdentity","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteIntegrationIdentityResponse"},"examples":{"example_1":{"value":{"status":"Integration identity deleted successfully."}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"integration_identity","x-auth-context":"tenant"}},"/api/v1/integrations/auth/{provider}/authorizations":{"post":{"tags":["v1/Integrations/auth"],"summary":"Authorize integration provider","description":"Start an authorization-code flow with PKCE for a supported provider and the authenticated user.","operationId":"startIntegrationOAuth2Authorization","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/OAuth2Provider"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartOAuth2AuthorizationBody","additionalProperties":false,"example":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete"},"properties":{"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Provider API scopes. Null uses the provider's default preset; an explicit list replaces that API preset.","title":"Scopes"},"completion_redirect_uri":{"anyOf":[{"format":"uri","minLength":1,"type":"string"},{"type":"null"}],"description":"Allowed redirect URI to open after authorization completes. Omit to receive the callback result as JSON.","examples":["https://app.livoi.de/integrations/oauth/complete"],"title":"Completion Redirect Uri"}},"title":"StartOAuth2AuthorizationBody","type":"object"},"examples":{"example_1":{"value":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartOAuth2AuthorizationResponse"},"examples":{"example_1":{"value":{"integration_identity_id":"7442550215703679004","authorization_url":"<authorization_url>","expires_at":"<expires_at>"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"oauth2_authorization","x-auth-context":"tenant"}},"/api/v1/integrations/auth/identities/{integration_identity_id}/authorizations":{"post":{"tags":["v1/Integrations/auth"],"summary":"Reauthorize integration identity","description":"Start a new authorization-code flow for an existing Google or Microsoft identity, for example after its access was revoked. The identity, its settings, and linked integrations are kept. The provider account must be the one originally connected; until the flow succeeds, the identity keeps its current credentials and status.","operationId":"reauthorizeIntegrationIdentity","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthorizeIntegrationIdentityBody","additionalProperties":false,"example":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete"},"properties":{"completion_redirect_uri":{"anyOf":[{"format":"uri","minLength":1,"type":"string"},{"type":"null"}],"description":"Allowed redirect URI to open after authorization completes. Omit to receive the callback result as JSON.","examples":["https://app.livoi.de/integrations/oauth/complete"],"title":"Completion Redirect Uri"}},"title":"ReauthorizeIntegrationIdentityBody","type":"object"},"examples":{"example_1":{"value":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartOAuth2AuthorizationResponse"},"examples":{"example_1":{"value":{"integration_identity_id":"7442550215703679004","authorization_url":"<authorization_url>","expires_at":"<expires_at>"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"oauth2_authorization","x-auth-context":"tenant"}},"/api/v1/integrations/email/identities/{integration_identity_id}/messages":{"get":{"tags":["v1/Integrations/email"],"summary":"List email messages","description":"List email messages for the selected integration identity.","operationId":"listIntegrationEmailMessages","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"description":"Opaque cursor returned as next_cursor by the previous page.","title":"Cursor"},"description":"Opaque cursor returned as next_cursor by the previous page."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page Size"}},{"name":"mailbox","in":"query","required":false,"schema":{"$ref":"#/components/schemas/EmailMailbox","default":"inbox"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Search"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationPage_EmailMessageSummary_"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Please slow down.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"429","status_message":"Too Many Requests","errors":[{"info":"Too many requests. Please slow down.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant"}},"/api/v1/integrations/email/identities/{integration_identity_id}/messages/download":{"get":{"tags":["v1/Integrations/email"],"summary":"Download email message","description":"Downloads one message or a complete thread with selected content representations and optional attachments as a zip archive.","operationId":"downloadIntegrationEmailMessage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"message_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024},{"type":"null"}],"description":"Provider message identifier. Provide exactly one of message_id or thread_id.","title":"Message Id"},"description":"Provider message identifier. Provide exactly one of message_id or thread_id."},{"name":"thread_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024},{"type":"null"}],"description":"Provider thread or conversation identifier. Provide exactly one of message_id or thread_id.","title":"Thread Id"},"description":"Provider thread or conversation identifier. Provide exactly one of message_id or thread_id."},{"name":"include","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailDownloadContent"},"minItems":1,"description":"Email content representations to include in the archive.","title":"Include"},"description":"Email content representations to include in the archive."},{"name":"include_attachments","in":"query","required":false,"schema":{"type":"boolean","description":"Include file attachments in the archive.","default":true,"title":"Include Attachments"},"description":"Include file attachments in the archive."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Zip archive containing the selected email content and optional attachments.","content":{"application/json":{"schema":{}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Please slow down.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"429","status_message":"Too Many Requests","errors":[{"info":"Too many requests. Please slow down.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant","x-file-response":{"media_types":["application/zip"]}}},"/api/v1/integrations/email/identities/{integration_identity_id}/messages/{message_id}":{"get":{"tags":["v1/Integrations/email"],"summary":"Read email message","description":"Read an email message for the selected integration identity.","operationId":"getIntegrationEmailMessage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":1024,"title":"Message Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailMessage"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Please slow down.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"429","status_message":"Too Many Requests","errors":[{"info":"Too many requests. Please slow down.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant"}},"/api/v1/integrations/email-office":{"get":{"tags":["v1/Integrations/email-office"],"summary":"List Email-to-Office integrations","description":"List recurring Email-to-Office configurations owned by the authenticated user.","operationId":"listEmailOfficeIntegrations","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEmailOfficeIntegrationsResponse"},"examples":{"example_1":{"value":{"integrations":[{"email_office_integration_id":"7442550215703679137","integration_identity_id":"7442550215703679004","enabled":true,"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"exclude_filters":[{"sender_name":"Automated Notifications"}],"run_interval":30,"run_interval_unit":"seconds","last_run_started_at":"2028-06-18T04:45:12Z","last_scan_completed_at":"2029-09-29T19:08:54Z","created_at":"2027-02-10T11:22:33Z","updated_at":"2028-06-18T04:45:12Z"}]}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"email_office_integrations","x-auth-context":"tenant"}},"/api/v1/integrations/email-office/identities/{integration_identity_id}":{"post":{"tags":["v1/Integrations/email-office"],"summary":"Create Email-to-Office integration","description":"Create a recurring Email-to-Office configuration for an authenticated Google or Microsoft identity.","operationId":"createEmailOfficeIntegration","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmailOfficeIntegrationBody","$defs":{"EmailOfficeMessageFilter":{"additionalProperties":false,"properties":{"sender_name":{"anyOf":[{"maxLength":320,"type":"string"},{"type":"null"}],"examples":["Acme Billing"],"title":"Sender Name"},"sender_email":{"anyOf":[{"maxLength":320,"type":"string"},{"type":"null"}],"examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"],"title":"Sender Email"},"label_name":{"anyOf":[{"maxLength":320,"type":"string"},{"type":"null"}],"examples":["Invoices"],"title":"Label Name"},"label_id":{"anyOf":[{"maxLength":1024,"type":"string"},{"type":"null"}],"examples":["Label_123"],"title":"Label Id"}},"title":"EmailOfficeMessageFilter","type":"object"},"EmailOfficeRunIntervalUnit":{"enum":["seconds","minutes","hours","days"],"title":"EmailOfficeRunIntervalUnit","type":"string"}},"additionalProperties":false,"example":{"enabled":true,"exclude_filters":[{"sender_name":"Automated Notifications"}],"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"run_interval":30,"run_interval_unit":"seconds"},"properties":{"enabled":{"default":true,"description":"Whether recurring processing is enabled.","examples":[true,false],"title":"Enabled","type":"boolean"},"include_filters":{"description":"Sender or label filters that select messages for processing. Rules are combined with OR.","examples":[[{"sender_email":"sprizzy@p-cation.de"}],[{"label_name":"Invoices"}],[{"label_id":"Label_123"}]],"items":{"$ref":"#/$defs/EmailOfficeMessageFilter"},"maxItems":100,"title":"Include Filters","type":"array"},"exclude_filters":{"description":"Sender or label filters that exclude messages. Exclusions take precedence over inclusions.","examples":[[{"sender_name":"Automated Notifications"}],[{"label_name":"Spam"}],[{"label_id":"CATEGORY_ID"}]],"items":{"$ref":"#/$defs/EmailOfficeMessageFilter"},"maxItems":100,"title":"Exclude Filters","type":"array"},"run_interval":{"default":15,"description":"Number of run interval units between processing attempts.","examples":[30,30,2,1],"exclusiveMinimum":0,"maximum":2147483647,"title":"Run Interval","type":"integer"},"run_interval_unit":{"$ref":"#/$defs/EmailOfficeRunIntervalUnit","default":"minutes","description":"Unit used for the recurring run interval.","examples":["seconds","minutes","hours","days"]}},"title":"CreateEmailOfficeIntegrationBody","type":"object"},"examples":{"example_1":{"value":{"enabled":true,"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"exclude_filters":[{"sender_name":"Automated Notifications"}],"run_interval":30,"run_interval_unit":"seconds"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailOfficeIntegrationResponse"},"examples":{"example_1":{"value":{"email_office_integration_id":"7442550215703679137","integration_identity_id":"7442550215703679004","enabled":true,"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"exclude_filters":[{"sender_name":"Automated Notifications"}],"run_interval":30,"run_interval_unit":"seconds","last_run_started_at":"2028-06-18T04:45:12Z","last_scan_completed_at":"2029-09-29T19:08:54Z","created_at":"2027-02-10T11:22:33Z","updated_at":"2028-06-18T04:45:12Z"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"email_office_integration","x-auth-context":"tenant"}},"/api/v1/integrations/email-office/{email_office_integration_id}":{"patch":{"tags":["v1/Integrations/email-office"],"summary":"Update Email-to-Office integration","description":"Update filtering, enablement, or the supported recurring interval.","operationId":"updateEmailOfficeIntegration","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_office_integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Email Office Integration Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmailOfficeIntegrationBody","$defs":{"EmailOfficeMessageFilter":{"additionalProperties":false,"properties":{"sender_name":{"anyOf":[{"maxLength":320,"type":"string"},{"type":"null"}],"examples":["Acme Billing"],"title":"Sender Name"},"sender_email":{"anyOf":[{"maxLength":320,"type":"string"},{"type":"null"}],"examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"],"title":"Sender Email"},"label_name":{"anyOf":[{"maxLength":320,"type":"string"},{"type":"null"}],"examples":["Invoices"],"title":"Label Name"},"label_id":{"anyOf":[{"maxLength":1024,"type":"string"},{"type":"null"}],"examples":["Label_123"],"title":"Label Id"}},"title":"EmailOfficeMessageFilter","type":"object"},"EmailOfficeRunIntervalUnit":{"enum":["seconds","minutes","hours","days"],"title":"EmailOfficeRunIntervalUnit","type":"string"}},"additionalProperties":false,"example":{"enabled":true,"exclude_filters":[{"sender_name":"Automated Notifications"}],"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"run_interval":30,"run_interval_unit":"seconds"},"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"examples":[true,false],"title":"Enabled"},"include_filters":{"anyOf":[{"items":{"$ref":"#/$defs/EmailOfficeMessageFilter"},"maxItems":100,"type":"array"},{"type":"null"}],"examples":[[{"sender_email":"sprizzy@p-cation.de"}],[{"label_name":"Invoices"}],[{"label_id":"Label_123"}]],"title":"Include Filters"},"exclude_filters":{"anyOf":[{"items":{"$ref":"#/$defs/EmailOfficeMessageFilter"},"maxItems":100,"type":"array"},{"type":"null"}],"examples":[[{"sender_name":"Automated Notifications"}],[{"label_name":"Spam"}],[{"label_id":"CATEGORY_ID"}]],"title":"Exclude Filters"},"run_interval":{"anyOf":[{"exclusiveMinimum":0,"maximum":2147483647,"type":"integer"},{"type":"null"}],"examples":[30,30,2,1],"title":"Run Interval"},"run_interval_unit":{"anyOf":[{"$ref":"#/$defs/EmailOfficeRunIntervalUnit"},{"type":"null"}],"examples":["seconds","minutes","hours","days"]}},"title":"UpdateEmailOfficeIntegrationBody","type":"object"},"examples":{"example_1":{"value":{"enabled":true,"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"exclude_filters":[{"sender_name":"Automated Notifications"}],"run_interval":30,"run_interval_unit":"seconds"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailOfficeIntegrationResponse"},"examples":{"example_1":{"value":{"email_office_integration_id":"7442550215703679137","integration_identity_id":"7442550215703679004","enabled":true,"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"exclude_filters":[{"sender_name":"Automated Notifications"}],"run_interval":30,"run_interval_unit":"seconds","last_run_started_at":"2028-06-18T04:45:12Z","last_scan_completed_at":"2029-09-29T19:08:54Z","created_at":"2027-02-10T11:22:33Z","updated_at":"2028-06-18T04:45:12Z"}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"email_office_integration","x-auth-context":"tenant"},"delete":{"tags":["v1/Integrations/email-office"],"summary":"Delete Email-to-Office integration","description":"Delete an Email-to-Office configuration and stop its recurring email processing.","operationId":"deleteEmailOfficeIntegration","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_office_integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Email Office Integration Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEmailOfficeIntegrationResponse"},"examples":{"example_1":{"value":{"status":"Email-to-Office integration deleted successfully."}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"email_office_integration","x-auth-context":"tenant"}},"/api/v1/integrations/calendar/identities/{integration_identity_id}/calendars":{"get":{"tags":["v1/Integrations/calendar"],"summary":"List calendars","description":"List calendars for the selected integration identity.","operationId":"listIntegrationCalendars","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"description":"Opaque cursor returned as next_cursor by the previous page.","title":"Cursor"},"description":"Opaque cursor returned as next_cursor by the previous page."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page Size"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationPage_Calendar_"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Please slow down.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"429","status_message":"Too Many Requests","errors":[{"info":"Too many requests. Please slow down.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant"}},"/api/v1/integrations/calendar/identities/{integration_identity_id}/calendars/{calendar_id}/events":{"get":{"tags":["v1/Integrations/calendar"],"summary":"List calendar events","description":"List events in the selected integration calendar.","operationId":"listIntegrationCalendarEvents","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_identity_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Identity Id"}},{"name":"calendar_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":1024,"title":"Calendar Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"description":"Opaque cursor returned as next_cursor by the previous page.","title":"Cursor"},"description":"Opaque cursor returned as next_cursor by the previous page."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page Size"}},{"name":"time_min","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Time Min"}},{"name":"time_max","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Time Max"}},{"name":"time_zone","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"pattern":"^[^\"\\r\\n]+$"},{"type":"null"}],"title":"Time Zone"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationPage_CalendarEvent_"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Please slow down.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"429","status_message":"Too Many Requests","errors":[{"info":"Too many requests. Please slow down.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"502","status_message":"Bad Gateway","errors":[{"info":null,"type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-auth-context":"tenant"}},"/api/v1/office/cases":{"get":{"tags":["v1/Office/cases"],"summary":"List office cases","description":"List office cases with optional union filters and overlapping calculated queue memberships. Queue counts cover all matching cases before pagination. Cases are newest-first unless queue_order or sort_by explicitly requests sorting. Search matches literal text within case titles, correspondent or supplier names, and invoice numbers, ignoring letter case. It uses current reviewed or approved values and filters before pagination. Completed and archived cases are included unless other filters exclude them.\n\nRequired permissions:\n- `office_cases.read`","operationId":"listOfficeCases","security":[{"HTTPBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"Search case titles, correspondent and supplier names, or invoice numbers.","examples":["Example Parts"],"title":"Search"},"description":"Search case titles, correspondent and supplier names, or invoice numbers."},{"name":"amount_min","in":"query","required":false,"schema":{"anyOf":[{"anyOf":[{"type":"number"},{"type":"string"}],"ge":0},{"type":"null"}],"description":"Inclusive minimum invoice amount. Requires currency.","examples":["100.00"],"title":"Amount Min"},"description":"Inclusive minimum invoice amount. Requires currency."},{"name":"amount_max","in":"query","required":false,"schema":{"anyOf":[{"anyOf":[{"type":"number"},{"type":"string"}],"ge":0},{"type":"null"}],"description":"Inclusive maximum invoice amount. Requires currency.","examples":["150.00"],"title":"Amount Max"},"description":"Inclusive maximum invoice amount. Requires currency."},{"name":"currency","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}],"description":"Three-letter invoice currency code.","examples":["EUR"],"title":"Currency"},"description":"Three-letter invoice currency code."},{"name":"handling_step","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeHandlingStep"},{"type":"null"}],"description":"Filter by the next handling step.","examples":["payment"],"title":"Handling Step"},"description":"Filter by the next handling step."},{"name":"number","in":"query","required":false,"schema":{"type":"integer","minimum":1,"examples":[1],"default":1,"title":"Number"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"examples":[50],"default":50,"title":"Size"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeSortBy"},{"type":"null"}],"description":"Sort cases by creation or modification date.","examples":["created_at"],"title":"Sort By"},"description":"Sort cases by creation or modification date."},{"name":"sort_order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/OfficeSortOrder","description":"Sort direction.","examples":["desc"],"default":"desc"},"description":"Sort direction."},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeCaseState"},{"type":"null"}],"title":"State"}},{"name":"queues","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OfficeCaseQueue"},"minItems":1,"maxItems":8},{"type":"null"}],"description":"Filter by any selected calculated Office dashboard queue. Queue memberships overlap.","examples":[["review"]],"title":"Queues"},"description":"Filter by any selected calculated Office dashboard queue. Queue memberships overlap."},{"name":"queue_order","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OfficeCaseQueue"},"minItems":1,"maxItems":8},{"type":"null"}],"description":"Prioritize cases by calculated queue membership. Requested queues come first, omitted queues follow, and the first matching queue wins. Without this parameter, cases remain newest-first.","title":"Queue Order"},"description":"Prioritize cases by calculated queue membership. Requested queues come first, omitted queues follow, and the first matching queue wins. Without this parameter, cases remain newest-first."},{"name":"document_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeDocumentType"},{"type":"null"}],"examples":["letter"],"title":"Document Type"}},{"name":"route","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeBranchRoute"},{"type":"null"}],"title":"Route"}},{"name":"deadline","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeDeadlineFilter"},{"type":"null"}],"title":"Deadline"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeCaseListResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442550215703679004","state":"review_required","document_type":"letter","route":"letter","analysis_status":"completed","title":"Request for delivery confirmation","key_recommendation":"Confirm the delivery date.","sender":{"organization":"Example Supplies GmbH","email":"office@example.test"},"payable_amount":{"amount":"125.00","currency":"EUR"},"handling_step":"review","queues":["review","deadlines"],"next_action_deadline":"2026-10-26","overdue":false,"change_history":[{"user_id":null,"changed_at":"2026-10-19T09:00:00Z"}],"last_activity":"2026-10-19T09:00:00Z"}],"counts":{"errors":0,"deadlines":1,"review":1,"creditor_documents":0,"system_processing":0,"in_progress":0,"completed":0,"archived":0},"page":{"number":"1","size":"50","total":"1","has_next":false}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_cases","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"read","key":"office_cases.read"}]},"post":{"tags":["v1/Office/cases"],"summary":"Create office case","description":"Create a new office case from uploaded source documents, or return the existing matching case when documents are already registered.\n\nRequired permissions:\n- `office_cases.create`\n- `storage_objects.create`","operationId":"createOfficeCase","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/OfficeCaseDocumentsBody","$defs":{"RequireAllowedOfficeDocumentUpload":{"format":"binary","type":"string"}},"example":{"documents":["delivery-request.pdf"],"per_document":true},"properties":{"documents":{"description":"One or more source documents, including XML and PDF when enabled by the upload configuration. Acceptance confirms intake, not invoice validity.","examples":[["delivery-request.pdf"]],"items":{"$ref":"#/$defs/RequireAllowedOfficeDocumentUpload"},"minItems":1,"title":"Documents","type":"array"},"per_document":{"default":true,"description":"For case creation, create one case per uploaded document when true, or group the documents when false. When adding documents to an existing case, all documents belong to that case regardless of this value.","examples":[true],"title":"Per Document","type":"boolean"}},"required":["documents"],"title":"OfficeCaseDocumentsBody","type":"object"},"examples":{"example_1":{"value":{"documents":["delivery-request.pdf"],"per_document":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeCaseCreateResponse"},"examples":{"example_1":{"value":{"items":[{"case_id":"7442550215703679004","exact_duplicate":false}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_case","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"create","key":"office_cases.create"},{"model":"storage_objects","action":"create","key":"storage_objects.create"}]}},"/api/v1/office/threads":{"get":{"tags":["v1/Office/cases"],"summary":"List office case threads","description":"List one dashboard item per authoritative case thread. Root lifecycle state remains historical while active member cases supply current queues, actions, and the earliest action deadline. Search matches literal text within case titles, correspondent or supplier names, and invoice numbers, ignoring letter case. Search and invoice amount filters use current reviewed or approved values, including completed and archived cases. Combined search, amount, currency, and handling-step filters must match the same case; handling-step filters match active cases only. Filters apply before pagination. Every selected thread includes all of its cases. Queue counts cover all matching threads before pagination.\n\nRequired permissions:\n- `office_cases.read`","operationId":"listOfficeThreads","security":[{"HTTPBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"Search case titles, correspondent and supplier names, or invoice numbers.","examples":["Example Parts"],"title":"Search"},"description":"Search case titles, correspondent and supplier names, or invoice numbers."},{"name":"amount_min","in":"query","required":false,"schema":{"anyOf":[{"anyOf":[{"type":"number"},{"type":"string"}],"ge":0},{"type":"null"}],"description":"Inclusive minimum invoice amount. Requires currency.","examples":["100.00"],"title":"Amount Min"},"description":"Inclusive minimum invoice amount. Requires currency."},{"name":"amount_max","in":"query","required":false,"schema":{"anyOf":[{"anyOf":[{"type":"number"},{"type":"string"}],"ge":0},{"type":"null"}],"description":"Inclusive maximum invoice amount. Requires currency.","examples":["150.00"],"title":"Amount Max"},"description":"Inclusive maximum invoice amount. Requires currency."},{"name":"currency","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}],"description":"Three-letter invoice currency code.","examples":["EUR"],"title":"Currency"},"description":"Three-letter invoice currency code."},{"name":"handling_step","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeHandlingStep"},{"type":"null"}],"description":"Filter threads by the next handling step of an active case.","examples":["payment"],"title":"Handling Step"},"description":"Filter threads by the next handling step of an active case."},{"name":"number","in":"query","required":false,"schema":{"type":"integer","minimum":1,"examples":[1],"default":1,"title":"Number"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"examples":[50],"default":50,"title":"Size"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeSortBy"},{"type":"null"}],"description":"Sort threads by creation or modification date.","examples":["updated_at"],"title":"Sort By"},"description":"Sort threads by creation or modification date."},{"name":"sort_order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/OfficeSortOrder","description":"Sort direction.","examples":["desc"],"default":"desc"},"description":"Sort direction."},{"name":"queues","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OfficeCaseQueue"},"minItems":1,"maxItems":8},{"type":"null"}],"description":"Filter by any selected calculated thread queue. Queue memberships overlap.","examples":[["review"]],"title":"Queues"},"description":"Filter by any selected calculated thread queue. Queue memberships overlap."},{"name":"queue_order","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OfficeCaseQueue"},"minItems":1,"maxItems":8},{"type":"null"}],"description":"Prioritize threads by calculated queue membership; otherwise order by latest member activity.","title":"Queue Order"},"description":"Prioritize threads by calculated queue membership; otherwise order by latest member activity."},{"name":"document_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeDocumentType"},{"type":"null"}],"title":"Document Type"}},{"name":"route","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeBranchRoute"},{"type":"null"}],"title":"Route"}},{"name":"deadline","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeDeadlineFilter"},{"type":"null"}],"title":"Deadline"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeThreadListResponse"},"examples":{"example_1":{"value":{"items":[{"root":{"id":"7442550215703679004","state":"review_required","document_type":"letter","route":"letter","title":"Request for delivery confirmation","sender":{"organization":"Example Supplies GmbH","email":"office@example.test"},"created_at":"2026-10-19T09:00:00Z","last_activity":"2026-10-19T09:00:00Z"},"is_active":true,"member_count":1,"cases":[{"id":"7442550215703679004","state":"review_required","document_type":"letter","route":"letter","analysis_status":"completed","title":"Request for delivery confirmation","key_recommendation":"Confirm the delivery date.","sender":{"organization":"Example Supplies GmbH","email":"office@example.test"},"payable_amount":{"amount":"125.00","currency":"EUR"},"handling_step":"review","queues":["review","deadlines"],"next_action_deadline":"2026-10-26","overdue":false,"change_history":[{"user_id":null,"changed_at":"2026-10-19T09:00:00Z"}],"last_activity":"2026-10-19T09:00:00Z"}],"active_cases":[{"id":"7442550215703679004","state":"review_required","document_type":"letter","route":"letter","analysis_status":"completed","title":"Request for delivery confirmation","key_recommendation":"Confirm the delivery date.","sender":{"organization":"Example Supplies GmbH","email":"office@example.test"},"payable_amount":{"amount":"125.00","currency":"EUR"},"handling_step":"review","queues":["review","deadlines"],"next_action_deadline":"2026-10-26","overdue":false,"change_history":[{"user_id":null,"changed_at":"2026-10-19T09:00:00Z"}],"last_activity":"2026-10-19T09:00:00Z"}],"queues":["review","deadlines"],"next_action_deadline":"2026-10-26","overdue":false,"last_activity":"2026-10-19T09:00:00Z"}],"counts":{"errors":0,"deadlines":1,"review":1,"creditor_documents":0,"system_processing":0,"in_progress":0,"completed":0,"archived":0},"page":{"number":"1","size":"50","total":"1","has_next":false}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_case_threads","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"read","key":"office_cases.read"}]}},"/api/v1/office/configuration":{"get":{"tags":["v1/Office/configuration"],"summary":"Get office configuration","description":"Return tenant office settings, including sender details, payment methods, required review fields, and asset links.\n\nRequired permissions:\n- `tenants.read`","operationId":"getOfficeConfiguration","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeConfigurationResponse"},"examples":{"example_1":{"value":{"sender":{"organization":"Example Services GmbH","email":"hello@example.test"},"template_url":"https://storage.example.test/office/template.docx","signature_url":null,"payment_methods":[{"id":7442550215703679137,"name":"Business account","kind":"bank_account","iban":"DE89370400440532013000"}],"required_review_fields":["document_type","summary"],"letter_date_format":"%d.%m.%Y","auto_approve_optimistic":false}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"office_configuration","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"read","key":"tenants.read"}]},"patch":{"tags":["v1/Office/configuration"],"summary":"Update office configuration","description":"Update tenant-level office settings such as sender information, letter date format, and review requirements.\n\nRequired permissions:\n- `tenants.update`","operationId":"updateOfficeConfiguration","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeConfigurationPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeConfigurationResponse"},"examples":{"example_1":{"value":{"sender":{"organization":"Example Services GmbH","email":"hello@example.test"},"template_url":"https://storage.example.test/office/template.docx","signature_url":null,"payment_methods":[{"id":7442550215703679137,"name":"Business account","kind":"bank_account","iban":"DE89370400440532013000"}],"required_review_fields":["document_type","summary"],"letter_date_format":"%d.%m.%Y","auto_approve_optimistic":false}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_configuration","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"update","key":"tenants.update"}]}},"/api/v1/office/configuration/default-template":{"get":{"tags":["v1/Office/configuration"],"summary":"Download office default template","description":"Download the global Office DOCX template for tenant customization and upload.\n\nRequired permissions:\n- `tenants.read`","operationId":"downloadOfficeDefaultTemplate","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Global office default DOCX template.","content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"office_configuration","x-auth-context":"tenant","x-file-response":{"media_types":["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],"filename":"office-standardvorlage.docx"},"x-required-permissions":[{"model":"tenants","action":"read","key":"tenants.read"}]}},"/api/v1/office/cases/{case_id}":{"get":{"tags":["v1/Office/cases"],"summary":"Get office case","description":"Return the complete case state, including documents, analysis results, review data, workflow history, and allowed actions.\n\nRequired permissions:\n- `office_cases.read`","operationId":"getOfficeCase","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeCaseView"},"examples":{"example_1":{"value":{"id":"7442550215703679004","state":"review_required","invoice_controls":{"obligation_exception":null,"payment_hold":false,"approval_required":false},"financial_status":"open","financial_review_required":false,"route":"letter","allowed_actions":["save_review","approve","add_note"],"process_overview":{"previous":{"step":"analysis","occurred_at":"2026-10-19T09:00:00Z"},"current":{"step":"review","state":"review_required"},"next":[{"step":"letter_draft","state":"in_progress","via_action":"approve","availability":"available"}],"terminal":false},"values":{"document_type":"letter","title":"Request for delivery confirmation","summary":"The supplier requests delivery confirmation by 26 October 2026.","document_date":"2026-10-19","next_action_deadline":"2026-10-26","sender":{"organization":"Example Supplies GmbH","email":"office@example.test"},"letter":{"subject":"Request for delivery confirmation","response_deadline":"2026-10-26","reply_required":true}},"analysis":{"status":"completed","evidence":[{"field_name":"letter.response_deadline","artifact_id":7442550215703679137,"excerpt":"Please confirm delivery by 26 October 2026.","page_number":1}],"uncertainties":[],"failure_code":null,"failure_explanation":null},"review":{"provenance":{"summary":"analysis","letter.response_deadline":"analysis"},"reasons":[]},"approved_by_user_id":null,"approved_at":null,"documents":[{"id":"7442550215703679137","origin":"received","participation":"analysis_input","file_name":"delivery-request.pdf","content_type":"application/pdf","size":2048,"content_url":"https://storage.example.test/office/delivery-request.pdf","created_at":"2026-10-19T09:00:00Z"}],"duplicate_candidates":[],"thread":{"root_case_id":"7442550215703679004","role":"root","is_active":true,"member_count":1,"members":[{"id":"7442550215703679004","state":"review_required","document_type":"letter","title":"Request for delivery confirmation","created_at":"2026-10-19T09:00:00Z"}]},"thread_link_suggestions":[],"letter":{"reply_required":true,"draft":null,"accepted_subject":null,"accepted_body":null,"approved_reply_id":null,"replies":[],"completed_without_reply_reason":null},"creditor_document":null,"other":null,"recommendations":[{"id":"7442550215703679137","text":"Confirm the delivery date.","position":0,"completed":false,"completion_note":null,"completed_by_user_id":null,"completed_at":null,"created_by_user_id":null,"created_at":"2026-10-19T09:00:00Z","updated_at":"2026-10-19T09:00:00Z"}],"notes":[{"id":"7442550215703679137","content":"Check the delivery receipt before replying.","allow_ai_use":false,"created_by_user_id":"7442551216804781021","created_at":"2026-10-19T09:00:00Z"}],"history":[{"id":"7442550215703679137","type":"case_created","actor_user_id":"7442551216804781021","occurred_at":"2026-10-19T09:00:00Z"}],"created_at":"2026-10-19T09:00:00Z","updated_at":"2026-10-19T09:00:00Z","completed_at":null}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"office_case","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"read","key":"office_cases.read"}]},"delete":{"tags":["v1/Office/cases"],"summary":"Assess or permanently delete office case","description":"Assess permanent deletion when confirmation is false. Permanently delete an eligible Office case when confirmation is true.\n\nRequired permissions:\n- `office_cases.delete`","operationId":"deleteOfficeCase","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeCaseDeleteBody","example":{"confirm_permanent_deletion":false},"properties":{"confirm_permanent_deletion":{"description":"Set to false to assess deletion or true to permanently delete the case.","examples":[false],"title":"Confirm Permanent Deletion","type":"boolean"}},"required":["confirm_permanent_deletion"],"title":"OfficeCaseDeleteBody","type":"object"},"examples":{"example_1":{"value":{"confirm_permanent_deletion":false}}}}}},"responses":{"204":{"description":"Successful Response"},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Current deletion consequences or blockers; the case is unchanged.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/OfficeCaseDeletionAllowed"},{"$ref":"#/components/schemas/OfficeCaseDeletionBlocked"}],"discriminator":{"propertyName":"allowed","mapping":{"true":"#/components/schemas/OfficeCaseDeletionAllowed","false":"#/components/schemas/OfficeCaseDeletionBlocked"}},"title":"Response 200 Deleteofficecase"}}}},"409":{"description":"Deletion is blocked by a relationship or a required related-case update permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeCaseDeletionBlocked"}}}}},"x-content-part":"office_case_delete","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"delete","key":"office_cases.delete"}]}},"/api/v1/office/cases/{case_id}/artifacts/{artifact_id}/xml":{"get":{"tags":["v1/Office/cases"],"summary":"Download original invoice XML","description":"Download the unchanged original XML document, including XML embedded in an invoice PDF. Requires case read access.\n\nRequired permissions:\n- `office_cases.read`","operationId":"downloadOfficeInvoiceXml","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"integer","title":"Artifact Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Original invoice XML bytes.","content":{"application/json":{"schema":{}},"application/xml":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"office_invoice_xml","x-auth-context":"tenant","x-file-response":{"media_types":["application/xml"]},"x-required-permissions":[{"model":"office_cases","action":"read","key":"office_cases.read"}]}},"/api/v1/office/cases/{case_id}/draft/preview/{format}":{"get":{"tags":["v1/Office/cases"],"summary":"Get office letter draft preview","description":"Return the latest rendered letter draft preview for a case as a DOCX or PDF file.\n\nRequired permissions:\n- `office_cases.read`","operationId":"getOfficeLetterDraftPreviewContent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}},{"name":"format","in":"path","required":true,"schema":{"enum":["docx","pdf"],"type":"string","title":"Format"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Generated office letter preview document.","content":{"application/json":{"schema":{}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"office_letter_draft_preview","x-auth-context":"tenant","x-file-response":{"media_types":["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/pdf"]},"x-required-permissions":[{"model":"office_cases","action":"read","key":"office_cases.read"}]}},"/api/v1/office/cases/{case_id}/actions":{"post":{"tags":["v1/Office/cases"],"summary":"Apply office case action","description":"Apply a state-changing action such as review, letter, creditor-document payment, invoice payment controls, automatic credit application or its explicit reversal, independent credit-note settlement, completed-case correction, or archive/unarchive updates and return the updated case view. An in-progress invoice can be archived manually once its obligation exception is cancelled, extinguished or written off and no payment hold, payment approval requirement or pending credit settlement remains. Unarchiving an invoice returns it to in_progress when settlement is incomplete or payment controls require review, otherwise to completed; an approved invoice already in progress is returned unchanged. Send a new idempotency_key to record an additional payment, and reuse the key and payment details to retry it.\n\nRequired permissions:\n- `office_cases.update`","operationId":"applyOfficeCaseAction","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/OfficeSetInvoiceControlsAction"},{"$ref":"#/components/schemas/OfficeRetryAnalysisAction"},{"$ref":"#/components/schemas/OfficeSaveReviewAction"},{"$ref":"#/components/schemas/OfficeApproveAction"},{"$ref":"#/components/schemas/OfficeSaveRecommendationsAction"},{"$ref":"#/components/schemas/OfficeSetRecommendationCompletionAction"},{"$ref":"#/components/schemas/OfficeAddNoteAction"},{"$ref":"#/components/schemas/OfficeSetNoteAIUseAction"},{"$ref":"#/components/schemas/OfficeResolveDuplicateAction"},{"$ref":"#/components/schemas/OfficeDismissSemanticDuplicatesAction"},{"$ref":"#/components/schemas/OfficeLinkCaseAction"},{"$ref":"#/components/schemas/OfficeUnlinkCaseAction"},{"$ref":"#/components/schemas/OfficeGenerateLetterDraftAction"},{"$ref":"#/components/schemas/OfficeSaveLetterDraftAction"},{"$ref":"#/components/schemas/OfficeReviseLetterDraftAction"},{"$ref":"#/components/schemas/OfficeRenderLetterDraftAction"},{"$ref":"#/components/schemas/OfficeApproveLetterDraftAction"},{"$ref":"#/components/schemas/OfficeRecordLetterDispatchAction"},{"$ref":"#/components/schemas/OfficeCompleteLetterAction"},{"$ref":"#/components/schemas/OfficeCompleteLetterWithoutReplyAction"},{"$ref":"#/components/schemas/OfficeRecordPaymentAction"},{"$ref":"#/components/schemas/OfficeResolveCreditAction"},{"$ref":"#/components/schemas/OfficeApplyCreditAction"},{"$ref":"#/components/schemas/OfficeReverseCreditApplicationAction"},{"$ref":"#/components/schemas/OfficeCompleteOtherAction"},{"$ref":"#/components/schemas/OfficeCorrectCompletedCaseAction"},{"$ref":"#/components/schemas/OfficeArchiveAction"},{"$ref":"#/components/schemas/OfficeUnarchiveAction"}],"discriminator":{"propertyName":"type","mapping":{"set_invoice_controls":"#/components/schemas/OfficeSetInvoiceControlsAction","retry_analysis":"#/components/schemas/OfficeRetryAnalysisAction","save_review":"#/components/schemas/OfficeSaveReviewAction","approve":"#/components/schemas/OfficeApproveAction","save_recommendations":"#/components/schemas/OfficeSaveRecommendationsAction","set_recommendation_completion":"#/components/schemas/OfficeSetRecommendationCompletionAction","add_note":"#/components/schemas/OfficeAddNoteAction","set_note_ai_use":"#/components/schemas/OfficeSetNoteAIUseAction","resolve_duplicate":"#/components/schemas/OfficeResolveDuplicateAction","dismiss_semantic_duplicates":"#/components/schemas/OfficeDismissSemanticDuplicatesAction","link_case":"#/components/schemas/OfficeLinkCaseAction","unlink_case":"#/components/schemas/OfficeUnlinkCaseAction","generate_letter_draft":"#/components/schemas/OfficeGenerateLetterDraftAction","save_letter_draft":"#/components/schemas/OfficeSaveLetterDraftAction","revise_letter_draft":"#/components/schemas/OfficeReviseLetterDraftAction","render_letter_draft":"#/components/schemas/OfficeRenderLetterDraftAction","approve_letter_draft":"#/components/schemas/OfficeApproveLetterDraftAction","record_letter_dispatch":"#/components/schemas/OfficeRecordLetterDispatchAction","complete_letter":"#/components/schemas/OfficeCompleteLetterAction","complete_letter_without_reply":"#/components/schemas/OfficeCompleteLetterWithoutReplyAction","record_payment":"#/components/schemas/OfficeRecordPaymentAction","resolve_credit":"#/components/schemas/OfficeResolveCreditAction","apply_credit":"#/components/schemas/OfficeApplyCreditAction","reverse_credit_application":"#/components/schemas/OfficeReverseCreditApplicationAction","complete_other":"#/components/schemas/OfficeCompleteOtherAction","correct_completed_case":"#/components/schemas/OfficeCorrectCompletedCaseAction","archive":"#/components/schemas/OfficeArchiveAction","unarchive":"#/components/schemas/OfficeUnarchiveAction"}},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeCaseView"},"examples":{"example_1":{"value":{"id":"7442550215703679004","state":"review_required","invoice_controls":{"obligation_exception":null,"payment_hold":false,"approval_required":false},"financial_status":"open","financial_review_required":false,"route":"letter","allowed_actions":["save_review","approve","add_note"],"process_overview":{"previous":{"step":"analysis","occurred_at":"2026-10-19T09:00:00Z"},"current":{"step":"review","state":"review_required"},"next":[{"step":"letter_draft","state":"in_progress","via_action":"approve","availability":"available"}],"terminal":false},"values":{"document_type":"letter","title":"Request for delivery confirmation","summary":"The supplier requests delivery confirmation by 26 October 2026.","document_date":"2026-10-19","next_action_deadline":"2026-10-26","sender":{"organization":"Example Supplies GmbH","email":"office@example.test"},"letter":{"subject":"Request for delivery confirmation","response_deadline":"2026-10-26","reply_required":true}},"analysis":{"status":"completed","evidence":[{"field_name":"letter.response_deadline","artifact_id":7442550215703679137,"excerpt":"Please confirm delivery by 26 October 2026.","page_number":1}],"uncertainties":[],"failure_code":null,"failure_explanation":null},"review":{"provenance":{"summary":"analysis","letter.response_deadline":"analysis"},"reasons":[]},"approved_by_user_id":null,"approved_at":null,"documents":[{"id":"7442550215703679137","origin":"received","participation":"analysis_input","file_name":"delivery-request.pdf","content_type":"application/pdf","size":2048,"content_url":"https://storage.example.test/office/delivery-request.pdf","created_at":"2026-10-19T09:00:00Z"}],"duplicate_candidates":[],"thread":{"root_case_id":"7442550215703679004","role":"root","is_active":true,"member_count":1,"members":[{"id":"7442550215703679004","state":"review_required","document_type":"letter","title":"Request for delivery confirmation","created_at":"2026-10-19T09:00:00Z"}]},"thread_link_suggestions":[],"letter":{"reply_required":true,"draft":null,"accepted_subject":null,"accepted_body":null,"approved_reply_id":null,"replies":[],"completed_without_reply_reason":null},"creditor_document":null,"other":null,"recommendations":[{"id":"7442550215703679137","text":"Confirm the delivery date.","position":0,"completed":false,"completion_note":null,"completed_by_user_id":null,"completed_at":null,"created_by_user_id":null,"created_at":"2026-10-19T09:00:00Z","updated_at":"2026-10-19T09:00:00Z"}],"notes":[{"id":"7442550215703679137","content":"Check the delivery receipt before replying.","allow_ai_use":false,"created_by_user_id":"7442551216804781021","created_at":"2026-10-19T09:00:00Z"}],"history":[{"id":"7442550215703679137","type":"case_created","actor_user_id":"7442551216804781021","occurred_at":"2026-10-19T09:00:00Z"}],"created_at":"2026-10-19T09:00:00Z","updated_at":"2026-10-19T09:00:00Z","completed_at":null}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"A case-action conflict or a completed-case correction that requires lifecycle confirmation.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"anyOf":[{"$ref":"#/components/schemas/OfficeCaseCorrectionConfirmationRequired"},{"$ref":"#/components/schemas/ErrorResponse"}],"title":"Response 409 Applyofficecaseaction"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_case_action","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"update","key":"office_cases.update"}]}},"/api/v1/office/exports":{"post":{"tags":["v1/Office/cases"],"summary":"Export Office documents","description":"Prepare and return a ZIP of eligible original PDF documents. The request remains open until preparation finishes. An export is recorded when ZIP preparation finishes, before the download completes. A successful or partial export returns application/zip and X-Export-ID. No matching documents returns a JSON result with status no_matches. A document failure that prevents the export returns a JSON result with status failure and HTTP 409. Use Content-Type to distinguish ZIP and JSON responses. To download previously exported documents again, repeat the POST with export_status=exported.\n\nRequired permissions:\n- `office_cases.read`\n- `office_exports.create`","operationId":"exportOfficeDocuments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeExportRequest","additionalProperties":false,"example":{"allow_partial_export":false,"document_types":["creditor_invoice","credit_note"],"end_date":"2026-10-14","export_status":"not_exported","payment_status":"paid","start_date":"2026-10-01"},"properties":{"start_date":{"description":"First document date to include.","examples":["2026-10-01"],"format":"date","title":"Start Date","type":"string"},"end_date":{"description":"Last document date to include.","examples":["2026-10-14"],"format":"date","title":"End Date","type":"string"},"document_types":{"anyOf":[{"items":{"enum":["creditor_invoice","invoice","credit_note"],"type":"string"},"minItems":1,"type":"array"},{"type":"null"}],"description":"Document types to include. Omit to include invoices; select credit notes explicitly.","examples":[["creditor_invoice","credit_note"]],"title":"Document Types"},"payment_status":{"anyOf":[{"enum":["paid","unpaid"],"type":"string"},{"type":"null"}],"examples":["paid"],"title":"Payment Status"},"export_status":{"default":"not_exported","description":"Select documents by export history. Defaults to not_exported; select exported to include previously exported documents.","enum":["exported","not_exported"],"examples":["not_exported"],"title":"Export Status","type":"string"},"allow_partial_export":{"default":false,"description":"Allow a partial export after explicit confirmation when individual documents cannot be read.","examples":[false],"title":"Allow Partial Export","type":"boolean"}},"required":["start_date","end_date"],"title":"OfficeExportRequest","type":"object"},"examples":{"example_1":{"value":{"start_date":"2026-10-01","end_date":"2026-10-14","document_types":["creditor_invoice","credit_note"],"payment_status":"paid","export_status":"not_exported","allow_partial_export":false}}}}}},"responses":{"200":{"description":"ZIP for success or partial_success; JSON with no_matches when no documents match.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeExportResultResponse"}},"application/zip":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Export-ID":{"description":"Export ID for retrieving the result.","schema":{"type":"string"}},"Content-Disposition":{"description":"Attachment filename for a ZIP response.","schema":{"type":"string"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Export failed because selected documents could not be included.","headers":{"X-Export-ID":{"description":"Export ID for retrieving the result.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeExportResultResponse"}}}}},"x-content-part":"office_export","x-auth-context":"tenant","x-file-response":{"media_types":["application/zip"]},"x-required-permissions":[{"model":"office_cases","action":"read","key":"office_cases.read"},{"model":"office_exports","action":"create","key":"office_exports.create"}]}},"/api/v1/office/exports/{export_id}":{"get":{"tags":["v1/Office/cases"],"summary":"Get Office export result","description":"Return the current export status or its final result, including file errors and notices.\n\nRequired permissions:\n- `office_cases.read`","operationId":"getOfficeExport","security":[{"HTTPBearer":[]}],"parameters":[{"name":"export_id","in":"path","required":true,"schema":{"type":"integer","title":"Export Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeExportResultResponse"},"examples":{"example_1":{"value":{"export_id":"7442550215703679004","status":"success","exported_count":1,"errors":[],"notices":[]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_export","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"read","key":"office_cases.read"}]}},"/api/v1/office/cases/{case_id}/documents":{"post":{"tags":["v1/Office/cases"],"summary":"Add office case documents","description":"Upload additional source documents to an existing editable office case, deduplicate against existing files, and trigger re-analysis.\n\nRequired permissions:\n- `office_cases.update`\n- `storage_objects.create`","operationId":"addOfficeCaseDocuments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/OfficeCaseDocumentsBody","$defs":{"RequireAllowedOfficeDocumentUpload":{"format":"binary","type":"string"}},"example":{"documents":["delivery-request.pdf"],"per_document":true},"properties":{"documents":{"description":"One or more source documents, including XML and PDF when enabled by the upload configuration. Acceptance confirms intake, not invoice validity.","examples":[["delivery-request.pdf"]],"items":{"$ref":"#/$defs/RequireAllowedOfficeDocumentUpload"},"minItems":1,"title":"Documents","type":"array"},"per_document":{"default":true,"description":"For case creation, create one case per uploaded document when true, or group the documents when false. When adding documents to an existing case, all documents belong to that case regardless of this value.","examples":[true],"title":"Per Document","type":"boolean"}},"required":["documents"],"title":"OfficeCaseDocumentsBody","type":"object"},"examples":{"example_1":{"value":{"documents":["delivery-request.pdf"],"per_document":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeDocumentsAddedResponse"},"examples":{"example_1":{"value":{"case_id":"7442550215703679004","added_document_count":1,"unchanged":false}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_case_documents","x-auth-context":"tenant","x-required-permissions":[{"model":"office_cases","action":"update","key":"office_cases.update"},{"model":"storage_objects","action":"create","key":"storage_objects.create"}]}},"/api/v1/office/configuration/assets":{"post":{"tags":["v1/Office/configuration"],"summary":"Upload office configuration assets","description":"Replace the tenant letter template and/or signature asset used for generating outgoing letters. DOCX templates may use {{subject}}, {{body}}, {{date}}, {{signature}}, {{sender_name}}, {{sender_organization}}, {{sender_email}}, {{sender_phone}}, {{sender_address}}, {{recipient_name}}, {{recipient_organization}}, {{recipient_email}}, {{recipient_phone}}, and {{recipient_address}}. Party name uses person, organization uses organization, and recipient fields use the approved incoming sender. Addresses contain address lines, postal code and city, then country. Missing values render empty without fallbacks.\n\nRequired permissions:\n- `tenants.update`\n- `storage_objects.create`","operationId":"updateOfficeConfigurationAssets","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/OfficeConfigurationAssetsBody","example":{"signature":"signature.png","template":"letter-template.docx"},"properties":{"template":{"title":"Template","description":"Optional current DOCX template.","examples":["letter-template.docx"],"type":"string","format":"binary"},"signature":{"title":"Signature","description":"Optional PNG/JPEG signature.","examples":["signature.png"],"type":"string","format":"binary"}},"title":"OfficeConfigurationAssetsBody","type":"object"},"examples":{"example_1":{"value":{"template":"letter-template.docx","signature":"signature.png"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfficeConfigurationResponse"},"examples":{"example_1":{"value":{"sender":{"organization":"Example Services GmbH","email":"hello@example.test"},"template_url":"https://storage.example.test/office/template.docx","signature_url":null,"payment_methods":[{"id":7442550215703679137,"name":"Business account","kind":"bank_account","iban":"DE89370400440532013000"}],"required_review_fields":["document_type","summary"],"letter_date_format":"%d.%m.%Y","auto_approve_optimistic":false}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"office_configuration","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"update","key":"tenants.update"},{"model":"storage_objects","action":"create","key":"storage_objects.create"}]}},"/api/v1/permissions":{"get":{"tags":["v1/Core/permissions"],"summary":"List valid permissions","description":"List the available permissions for each resource.","operationId":"listPermissions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPermissionsResponse"},"examples":{"example_1":{"value":{"items":[{"resource":"roles","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"]}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"permissions","x-auth-context":"any"}},"/api/v1/permissions/effective":{"get":{"tags":["v1/Core/permissions"],"summary":"Get effective permissions","description":"Get the resolved effective permissions for the current or selected user in a tenant.","operationId":"getEffectivePermissions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional user ID override. Superuser only.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],"title":"User Id"},"description":"Optional user ID override. Superuser only."},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional tenant ID override. Superuser only.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Tenant Id"},"description":"Optional tenant ID override. Superuser only."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetEffectivePermissionsResponse"},"examples":{"example_1":{"value":{"user_id":"7442550215703679004","tenant_id":"7442551216804781021","is_superuser":true,"role_ids":["7442678451937742086"],"group_ids":["7443001845129083411"],"permissions":["agents.read","agents.read.any","knowledgefile.read.granted"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"effective_permissions","x-auth-context":"any"}},"/api/v1/resource-grants/":{"post":{"tags":["v1/Core/resource-grants"],"summary":"Create resource grant","description":"Create a resource-level grant for a user, group, role, or API key.\n\nRequired permissions:\n- `resource_grants.create`","operationId":"createResourceGrant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceGrantBody","$defs":{"SubjectKind":{"enum":["user","group","role","api_key"],"title":"SubjectKind","type":"string"}},"example":{"permission":"agents.read.granted","resource_id":"7442551216804781021","resource_kind":"knowledgefile","subject_id":"7442678451937742086","subject_kind":"user"},"properties":{"resource_kind":{"description":"Resource kind / table name.","examples":["knowledgefile","storage_objects","agents","chats","datev_profiles"],"title":"Resource Kind","type":"string"},"resource_id":{"description":"Resource ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Resource Id","type":"integer"},"subject_kind":{"$ref":"#/$defs/SubjectKind","description":"Grant subject kind.","examples":["user","group","role","api_key"]},"subject_id":{"description":"Grant subject ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520],"title":"Subject Id","type":"integer"},"permission":{"description":"Granted permission string.","examples":["agents.read.granted","storage_objects.read.granted","chats.update.granted","datev_profiles.access_manage.granted"],"title":"Permission","type":"string"}},"required":["resource_kind","resource_id","subject_kind","subject_id","permission"],"title":"CreateResourceGrantBody","type":"object"},"examples":{"example_1":{"value":{"resource_kind":"knowledgefile","resource_id":"7442551216804781021","subject_kind":"user","subject_id":"7442678451937742086","permission":"agents.read.granted"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceGrantResponse"},"examples":{"example_1":{"value":{"id":"7443001845129083411","tenant_id":"7442550215703679004","resource_kind":"knowledgefile","resource_id":"7442551216804781021","subject_kind":"user","subject_id":"7442678451937742086","permission":"agents.read.granted"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"resource_grant","x-auth-context":"tenant","x-required-permissions":[{"model":"resource_grants","action":"create","key":"resource_grants.create"}]},"get":{"tags":["v1/Core/resource-grants"],"summary":"List resource grants","description":"List visible resource grants for the current tenant.\n\nRequired permissions:\n- `resource_grants.read`","operationId":"listResourceGrants","security":[{"HTTPBearer":[]}],"parameters":[{"name":"resource_kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional resource kind filter.","examples":["knowledgefile","storage_objects","agents","chats","datev_profiles"],"title":"Resource Kind"},"description":"Optional resource kind filter."},{"name":"resource_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional resource ID filter.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Resource Id"},"description":"Optional resource ID filter."},{"name":"subject_kind","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SubjectKind"},{"type":"null"}],"description":"Optional subject kind filter.","examples":["user","group","role","api_key"],"title":"Subject Kind"},"description":"Optional subject kind filter."},{"name":"subject_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional subject ID filter.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520],"title":"Subject Id"},"description":"Optional subject ID filter."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResourceGrantsResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7443001845129083411","tenant_id":"7442550215703679004","resource_kind":"knowledgefile","resource_id":"7442551216804781021","subject_kind":"user","subject_id":"7442678451937742086","permission":"agents.read.granted"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"resource_grants","x-auth-context":"tenant","x-required-permissions":[{"model":"resource_grants","action":"read","key":"resource_grants.read"}]}},"/api/v1/resource-grants/{grant_id}":{"delete":{"tags":["v1/Core/resource-grants"],"summary":"Delete resource grant","description":"Delete a resource grant by ID.\n\nRequired permissions:\n- `resource_grants.delete`","operationId":"deleteResourceGrant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"grant_id","in":"path","required":true,"schema":{"type":"integer","title":"Grant Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResourceGrantResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"resource_grant","x-auth-context":"tenant","x-required-permissions":[{"model":"resource_grants","action":"delete","key":"resource_grants.delete"}]}},"/api/v1/roles":{"post":{"tags":["v1/Core/roles"],"summary":"Create role","description":"Create a new role for the current tenant.\n\nRequired permissions:\n- `roles.create`","operationId":"createRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleBody","example":{"description":"Can read chats and files.","name":"Administrator"},"properties":{"name":{"description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"],"title":"Name","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional role description.","examples":["Can read chats and files.","Handles advanced support cases.","Coordinates tenant operations.","Handles day-to-day platform tasks."],"title":"Description"}},"required":["name"],"title":"CreateRoleBody","type":"object"},"examples":{"example_1":{"value":{"name":"Administrator","description":"Can read chats and files."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleResponse"},"examples":{"example_1":{"value":{"id":"7443001845129083411","tenant_id":"7442550215703679004","name":"Administrator","description":"Can manage tenant resources."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"create","key":"roles.create"}]},"get":{"tags":["v1/Core/roles"],"summary":"List roles","description":"List visible roles for the current tenant.\n\nRequired permissions:\n- `roles.read`","operationId":"listRoles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRolesResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7443001845129083411","tenant_id":"7442550215703679004","name":"Administrator","description":"Can manage tenant resources."}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"roles","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"read","key":"roles.read"}]}},"/api/v1/roles/{role_id}":{"get":{"tags":["v1/Core/roles"],"summary":"Get role","description":"Get a role by ID.\n\nRequired permissions:\n- `roles.read`","operationId":"getRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRoleResponse"},"examples":{"example_1":{"value":{"id":"7443001845129083411","tenant_id":"7442550215703679004","name":"Administrator","description":"Can manage tenant resources."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"read","key":"roles.read"}]},"patch":{"tags":["v1/Core/roles"],"summary":"Update role","description":"Update a role by ID. The owner role cannot be renamed.\n\nRequired permissions:\n- `roles.update`","operationId":"updateRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleBody","example":{"description":"Extended support permissions.","name":"Administrator"},"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional role description.","examples":["Extended support permissions.","Updated operational scope.","Can manage additional tenant resources."],"title":"Description"}},"title":"UpdateRoleBody","type":"object"},"examples":{"example_1":{"value":{"name":"Administrator","description":"Extended support permissions."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleResponse"},"examples":{"example_1":{"value":{"id":"7443001845129083411","tenant_id":"7442550215703679004","name":"Administrator","description":"Can manage tenant resources."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"update","key":"roles.update"}]},"delete":{"tags":["v1/Core/roles"],"summary":"Delete role","description":"Delete a role by ID. The owner role cannot be deleted.\n\nRequired permissions:\n- `roles.delete`","operationId":"deleteRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRoleResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"delete","key":"roles.delete"}]}},"/api/v1/roles/{role_id}/permissions":{"get":{"tags":["v1/Core/roles"],"summary":"List role permissions","description":"List permissions assigned to a role.\n\nRequired permissions:\n- `role_permissions.read`","operationId":"listRolePermissions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRolePermissionsResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442678451937742086","role_id":"7443001845129083411","permission":"agents.read.any"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role_permissions","x-auth-context":"tenant","x-required-permissions":[{"model":"role_permissions","action":"read","key":"role_permissions.read"}]},"post":{"tags":["v1/Core/roles"],"summary":"Add role permissions","description":"Add permissions to a role.\n\nRequired permissions:\n- `role_permissions.create`\n- `roles.update`","operationId":"addRolePermissions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddRolePermissionsBody","example":{"permissions":["roles.read"]},"properties":{"permissions":{"description":"List of permission strings to add.","examples":[["roles.read"],["roles.read","roles.update","users.read"]],"items":{"type":"string"},"minItems":1,"title":"Permissions","type":"array"}},"required":["permissions"],"title":"AddRolePermissionsBody","type":"object"},"examples":{"example_1":{"value":{"permissions":["roles.read"]}},"example_2":{"value":{"permissions":["roles.read","roles.update","users.read"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddRolePermissionsResponse"},"examples":{"example_1":{"value":{"add_permissions":{"7442678451937742086":"agents:read"},"add_failed":{"agents:read":"Role permission already exists."}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role_permission","x-auth-context":"tenant","x-required-permissions":[{"model":"role_permissions","action":"create","key":"role_permissions.create"},{"model":"roles","action":"update","key":"roles.update"}]},"delete":{"tags":["v1/Core/roles"],"summary":"Remove role permissions","description":"Remove permissions from a role based on permission IDs or permission names. The owner role cannot lose permissions.\n\nRequired permissions:\n- `role_permissions.delete`\n- `roles.update`","operationId":"removeRolePermissions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveRolePermissionsBody","example":{"permission_ids":["7442678451937742086"],"permission_names":["roles.read"]},"properties":{"permission_ids":{"description":"Role permission row IDs.","examples":[[7442678451937742086],[7442678451937742086,7442678451937742214]],"items":{"type":"integer"},"title":"Permission Ids","type":"array","uniqueItems":true},"permission_names":{"description":"Role permission names.","examples":[["roles.read"],["roles.update","users.read"]],"items":{"type":"string"},"title":"Permission Names","type":"array"}},"title":"RemoveRolePermissionsBody","type":"object"},"examples":{"example_1":{"value":{"permission_ids":["7442678451937742086"],"permission_names":["roles.read"]}},"example_2":{"value":{"permission_ids":["7442678451937742086","7442678451937742214"],"permission_names":["roles.update","users.read"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveRolePermissionsResponse"},"examples":{"example_1":{"value":{"removed_success":{"7442678451937742086":"agents:read"},"remove_failed_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"remove_failed_names":["agents:delete"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role_permission","x-auth-context":"tenant","x-required-permissions":[{"model":"role_permissions","action":"delete","key":"role_permissions.delete"},{"model":"roles","action":"update","key":"roles.update"}]}},"/api/v1/roles/{role_id}/users":{"post":{"tags":["v1/Core/roles"],"summary":"Assign role to users","description":"Assign a role to tenant users.\n\nRequired permissions:\n- `roles.update`","operationId":"assignUserRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignUserRoleBody","example":{"user_ids":["7442678451937742086"]},"properties":{"user_ids":{"description":"User IDs to assign role to.","examples":[[7442678451937742086],[7442678451937742086,7442678451937742214,7442678451937742389]],"items":{"type":"integer"},"minItems":1,"title":"User Ids","type":"array"}},"required":["user_ids"],"title":"AssignUserRoleBody","type":"object"},"examples":{"example_1":{"value":{"user_ids":["7442678451937742086"]}},"example_2":{"value":{"user_ids":["7442678451937742086","7442678451937742214","7442678451937742389"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignUserRoleResponse"},"examples":{"example_1":{"value":{"success":true,"assigned_user_ids":["7442678451937742389","7442678451937742086","7442678451937742214","7442678451937742520"],"failed":{"7442550215703679004":"User not found.","7442550215703679137":"User already has this role."}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"user_role","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"update","key":"roles.update"}]},"delete":{"tags":["v1/Core/roles"],"summary":"Remove role from users","description":"Remove a role assignment from tenant users.\n\nRequired permissions:\n- `roles.update`","operationId":"removeUserRole","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveUserRoleBody","example":{"user_ids":["7442678451937742086"]},"properties":{"user_ids":{"description":"User IDs to remove role from.","examples":[[7442678451937742086],[7442678451937742086,7442678451937742214,7442678451937742389]],"items":{"type":"integer"},"minItems":1,"title":"User Ids","type":"array"}},"required":["user_ids"],"title":"RemoveUserRoleBody","type":"object"},"examples":{"example_1":{"value":{"user_ids":["7442678451937742086"]}},"example_2":{"value":{"user_ids":["7442678451937742086","7442678451937742214","7442678451937742389"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveUserRoleResponse"},"examples":{"example_1":{"value":{"success":true,"removed_user_ids":["7442678451937742389","7442678451937742086","7442678451937742214","7442678451937742520"],"failed":{"7442550215703679004":"User role assignment not found."}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"user_role","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"update","key":"roles.update"}]},"get":{"tags":["v1/Core/roles"],"summary":"List role users","description":"List users directly assigned to a role.\n\nRequired permissions:\n- `roles.read`","operationId":"listRoleUsers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRoleUsersResponse"},"examples":{"example_1":{"value":{"items":[{"user_id":"7442678451937742086","role_id":"7442551216804781021","tenant_id":"7442550215703679004"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"role_users","x-auth-context":"tenant","x-required-permissions":[{"model":"roles","action":"read","key":"roles.read"}]}},"/api/v1/storage/upload":{"post":{"tags":["v1/Core/storage"],"summary":"Upload storage objects","description":"Upload one or more files as storage objects without starting further processing.\n\nRequired permissions:\n- `storage_objects.create`","operationId":"uploadStorageObjects","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/StorageObjectUploadBody","$defs":{"RequireAllowedStorageObjectUpload":{"format":"binary","type":"string"}},"example":{"files":["report.pdf","summary.txt"]},"properties":{"files":{"description":"Files to upload.","examples":[["report.pdf","summary.txt"]],"items":{"$ref":"#/$defs/RequireAllowedStorageObjectUpload"},"minItems":1,"title":"Files","type":"array"}},"required":["files"],"title":"StorageObjectUploadBody","type":"object"},"examples":{"example_1":{"value":{"files":["report.pdf","summary.txt"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageObjectUploadResponse"},"examples":{"example_1":{"value":{"uploaded_storage_objects":{"report.pdf":"7442550215703679004","summary.txt":"7442550215703679137"}}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict with the current state of the resource.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"409","status_message":"Conflict","errors":[{"info":"Conflict with the current state of the resource.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"storage_objects","x-auth-context":"tenant","x-required-permissions":[{"model":"storage_objects","action":"create","key":"storage_objects.create"}]}},"/api/v1/storage/download":{"post":{"tags":["v1/Core/storage"],"summary":"Download storage objects","description":"Download one or more storage objects by ID.\n\nRequired permissions:\n- `storage_objects.read`","operationId":"downloadStorageObjects","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageObjectDownloadBody","example":{"storage_object_ids":["7442550215703679004"]},"properties":{"storage_object_ids":{"description":"Storage object IDs to download.","examples":[[7442550215703679004],[7442550215703679004,7442550215703679137]],"items":{"type":"integer"},"minItems":1,"title":"Storage Object Ids","type":"array"}},"required":["storage_object_ids"],"title":"StorageObjectDownloadBody","type":"object"},"examples":{"example_1":{"value":{"storage_object_ids":["7442550215703679004"]}}}}}},"responses":{"200":{"description":"Requested file, or a zip archive when multiple files are requested.","content":{"application/json":{"schema":{}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"503","status_message":"Service Unavailable","errors":[{"info":"Service temporarily unavailable.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"storage_objects","x-auth-context":"tenant","x-file-response":{"media_types":["application/octet-stream","application/zip"]},"x-required-permissions":[{"model":"storage_objects","action":"read","key":"storage_objects.read"}]}},"/api/v1/storage/delete":{"delete":{"tags":["v1/Core/storage"],"summary":"Delete storage objects","description":"Delete one or more unreferenced storage objects by ID.\n\nRequired permissions:\n- `storage_objects.delete`","operationId":"deleteStorageObjects","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageObjectDeleteBody","example":{"storage_object_ids":["7442550215703679004"]},"properties":{"storage_object_ids":{"description":"Storage object IDs to delete.","examples":[[7442550215703679004],[7442550215703679004,7442550215703679137]],"items":{"type":"integer"},"minItems":1,"title":"Storage Object Ids","type":"array"}},"required":["storage_object_ids"],"title":"StorageObjectDeleteBody","type":"object"},"examples":{"example_1":{"value":{"storage_object_ids":["7442550215703679004"]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageObjectDeleteResponse"},"examples":{"example_1":{"value":{"message":"2 storage objects deleted successfully."}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"storage_objects","x-auth-context":"tenant","x-required-permissions":[{"model":"storage_objects","action":"delete","key":"storage_objects.delete"}]}},"/api/v1/tenants":{"post":{"tags":["v1/Core/tenants"],"summary":"Create tenant","description":"Create a new tenant.\n\nRequired permissions:\n- `tenants.create`","operationId":"createTenant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantBody","example":{"domain":"sprizzy.de","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"},"properties":{"name":{"description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"],"title":"Name","type":"string"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"],"title":"Domain"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Owner User Id"}},"required":["name"],"title":"CreateTenantBody","type":"object"},"examples":{"example_1":{"value":{"name":"Sprizzy GmbH","domain":"sprizzy.de","owner_user_id":"7442551216804781021"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","name":"Sprizzy GmbH","domain":"sprizzy.de","owner_user_id":"7442551216804781021"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant","x-auth-context":"user","x-required-permissions":[{"model":"tenants","action":"create","key":"tenants.create"}]},"get":{"tags":["v1/Core/tenants"],"summary":"List tenants","description":"List visible tenants.\n\nRequired permissions:\n- `tenants.read`","operationId":"listTenants","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTenantsResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442550215703679004","name":"Sprizzy GmbH","domain":"sprizzy.de","owner_user_id":"7442551216804781021"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenants","x-auth-context":"user","x-required-permissions":[{"model":"tenants","action":"read","key":"tenants.read"}]}},"/api/v1/tenants/{tenant_id}":{"get":{"tags":["v1/Core/tenants"],"summary":"Get tenant","description":"Get a visible tenant by ID.\n\nRequired permissions:\n- `tenants.read`","operationId":"getTenant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTenantResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","name":"Sprizzy GmbH","domain":"sprizzy.de","owner_user_id":"7442551216804781021"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant","x-auth-context":"user","x-required-permissions":[{"model":"tenants","action":"read","key":"tenants.read"}]},"patch":{"tags":["v1/Core/tenants"],"summary":"Update tenant","description":"Update a visible tenant by ID.\n\nRequired permissions:\n- `tenants.update`","operationId":"updateTenant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantBody","example":{"domain":"sprizzy.de","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"},"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"],"title":"Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"],"title":"Domain"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509],"title":"Owner User Id"}},"title":"UpdateTenantBody","type":"object"},"examples":{"example_1":{"value":{"name":"Sprizzy GmbH","domain":"sprizzy.de","owner_user_id":"7442551216804781021"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","name":"Sprizzy GmbH","domain":"sprizzy.de","owner_user_id":"7442551216804781021"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"update","key":"tenants.update"}]},"delete":{"tags":["v1/Core/tenants"],"summary":"Delete tenant","description":"Soft-delete a tenant by ID.\n\nRequired permissions:\n- `tenants.delete`\n- `tenants.update`","operationId":"deleteTenant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTenantResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"delete","key":"tenants.delete"},{"model":"tenants","action":"update","key":"tenants.update"}]}},"/api/v1/tenants/{tenant_id}/memberships":{"post":{"tags":["v1/Core/tenants"],"summary":"Create tenant membership","description":"Add a user to a tenant.\n\nRequired permissions:\n- `tenants.update`","operationId":"createTenantMembership","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantMembershipBody","example":{"user_id":"7442678451937742086"},"properties":{"user_id":{"description":"User ID to add.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520],"title":"User Id","type":"integer"}},"required":["user_id"],"title":"CreateTenantMembershipBody","type":"object"},"examples":{"example_1":{"value":{"user_id":"7442678451937742086"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantMembershipResponse"},"examples":{"example_1":{"value":{"id":"7442678451937742086","tenant_id":"7442550215703679004","user_id":"7442551216804781021","is_active":true,"joined_at":"2027-02-10T11:22:33Z","left_at":"2027-12-01T07:55:09Z"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant_membership","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"update","key":"tenants.update"}]},"get":{"tags":["v1/Core/tenants"],"summary":"List tenant memberships","description":"List memberships for a tenant.\n\nRequired permissions:\n- `tenants.read`","operationId":"listTenantMemberships","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTenantMembershipsResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442678451937742086","tenant_id":"7442550215703679004","user_id":"7442551216804781021","is_active":true,"joined_at":"2027-02-10T11:22:33Z","left_at":"2027-12-01T07:55:09Z"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant_memberships","x-auth-context":"user","x-required-permissions":[{"model":"tenants","action":"read","key":"tenants.read"}]}},"/api/v1/tenants/{tenant_id}/memberships/{membership_id}":{"patch":{"tags":["v1/Core/tenants"],"summary":"Update tenant membership","description":"Update a tenant membership.\n\nRequired permissions:\n- `tenants.update`","operationId":"updateTenantMembership","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"membership_id","in":"path","required":true,"schema":{"type":"integer","title":"Membership Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantMembershipBody","example":{"is_active":true},"properties":{"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the membership is active.","examples":[true,false],"title":"Is Active"}},"title":"UpdateTenantMembershipBody","type":"object"},"examples":{"example_1":{"value":{"is_active":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantMembershipResponse"},"examples":{"example_1":{"value":{"id":"7442678451937742086","tenant_id":"7442550215703679004","user_id":"7442551216804781021","is_active":true,"joined_at":"2027-02-10T11:22:33Z","left_at":"2027-12-01T07:55:09Z"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant_membership","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"update","key":"tenants.update"}]},"delete":{"tags":["v1/Core/tenants"],"summary":"Delete tenant membership","description":"Remove a user from a tenant.\n\nRequired permissions:\n- `tenants.update`","operationId":"deleteTenantMembership","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"membership_id","in":"path","required":true,"schema":{"type":"integer","title":"Membership Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTenantMembershipResponse"},"examples":{"example_1":{"value":{"success":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"tenant_membership","x-auth-context":"tenant","x-required-permissions":[{"model":"tenants","action":"update","key":"tenants.update"}]}},"/api/v1/tenants/{tenant_id}/user-profiles/{user_id}":{"patch":{"tags":["v1/Core/tenants"],"summary":"Update tenant user profile","description":"Update the name and contact details this tenant keeps for a member or contact. The user's own account is not changed.\n\nRequired permissions:\n- `tenant_user_profiles.read`\n- `tenant_user_profiles.update`","operationId":"updateTenantUserProfile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantUserProfileBody","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","phone_number":"+491701234567"},"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First name in this tenant.","examples":["Sprizzy","Prasath","Iva","Chef"],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last name in this tenant.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"],"title":"Last Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name in this tenant.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"],"title":"Display Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Contact email address in this tenant.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"],"title":"Email"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Contact phone number in this tenant.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"],"title":"Phone Number"}},"title":"UpdateTenantUserProfileBody","type":"object"},"examples":{"example_1":{"value":{"first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","phone_number":"+491701234567"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantUserProfileResponse"},"examples":{"example_1":{"value":{"id":"7442678451937742086","tenant_id":"7442550215703679004","user_id":"7442551216804781021","first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","phone_number":"+491701234567"}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"tenant_user_profile","x-auth-context":"tenant","x-required-permissions":[{"model":"tenant_user_profiles","action":"read","key":"tenant_user_profiles.read"},{"model":"tenant_user_profiles","action":"update","key":"tenant_user_profiles.update"}]}},"/api/v1/users":{"post":{"tags":["v1/Core/users"],"summary":"Create user","description":"Create a new user. With a non-superuser tenant-bound key, the submitted name and contact details are stored for that tenant only.\n\nRequired permissions:\n- `users.create`","operationId":"createUser","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserBody","additionalProperties":false,"example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","is_active":true,"last_name":"Musterassistent","phone_number":"+491701234567"},"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"],"title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"],"title":"Last Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"],"title":"Display Name"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"],"title":"Phone Number"},"is_active":{"default":true,"description":"Whether the user is active.","examples":[true,false],"title":"Is Active","type":"boolean"}},"title":"CreateUserBody","type":"object"},"examples":{"example_1":{"value":{"email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","phone_number":"+491701234567","is_active":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","phone_number":"+491701234567","full_name":"Sprizzy Musterassistent","is_active":true,"is_superuser":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"user","x-auth-context":"any","x-required-permissions":[{"model":"users","action":"create","key":"users.create"}]},"get":{"tags":["v1/Core/users"],"summary":"List users","description":"List your own user account. Superusers see all accounts.\n\nRequired permissions:\n- `users.read`","operationId":"listUsers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUsersResponse"},"examples":{"example_1":{"value":{"items":[{"id":"7442550215703679004","email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","phone_number":"+491701234567","full_name":"Sprizzy Musterassistent","is_active":true,"is_superuser":true}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"users","x-auth-context":"user","x-required-permissions":[{"model":"users","action":"read","key":"users.read"}]}},"/api/v1/users/{user_id}":{"get":{"tags":["v1/Core/users"],"summary":"Get user","description":"Get your own user account by ID. Superusers can get any account.\n\nRequired permissions:\n- `users.read`","operationId":"getUser","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","phone_number":"+491701234567","full_name":"Sprizzy Musterassistent","is_active":true,"is_superuser":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"user","x-auth-context":"user","x-required-permissions":[{"model":"users","action":"read","key":"users.read"}]},"patch":{"tags":["v1/Core/users"],"summary":"Update user","description":"Update a user account. Requires superuser authority; use updateTenantUserProfile for tenant-specific details.\n\nRequired permissions:\n- `users.update`","operationId":"updateUser","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserBody","additionalProperties":false,"example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","is_active":true,"last_name":"Musterassistent","phone_number":"+491701234567"},"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"],"title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"],"title":"Last Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"],"title":"Display Name"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"],"title":"Phone Number"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the user is active.","examples":[true,false],"title":"Is Active"}},"title":"UpdateUserBody","type":"object"},"examples":{"example_1":{"value":{"email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","phone_number":"+491701234567","is_active":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserResponse"},"examples":{"example_1":{"value":{"id":"7442550215703679004","email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","display_name":"Sprizzy Musterassistent","phone_number":"+491701234567","full_name":"Sprizzy Musterassistent","is_active":true,"is_superuser":true}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed. One or more fields are invalid.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"422","status_message":"Unprocessable Content","errors":[{"info":"Validation failed. One or more fields are invalid.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-content-part":"user","x-auth-context":"tenant","x-required-permissions":[{"model":"users","action":"update","key":"users.update"}]}},"/api/v1/users/{user_id}/roles":{"get":{"tags":["v1/Core/users"],"summary":"List user roles","description":"List roles assigned to a user in the current tenant.\n\nRequired permissions:\n- `users.read`","operationId":"listUserRoles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUserRolesResponse"},"examples":{"example_1":{"value":{"items":[{"user_id":"7442550215703679004","role_id":"7442551216804781021","tenant_id":"7442678451937742086"}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"user_roles","x-auth-context":"tenant","x-required-permissions":[{"model":"users","action":"read","key":"users.read"}]}},"/api/v1/users/{user_id}/groups":{"get":{"tags":["v1/Core/users"],"summary":"List user groups","description":"List groups assigned to a user in the current tenant.\n\nRequired permissions:\n- `group_memberships.read`","operationId":"listUserGroups","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUserGroupsResponse"},"examples":{"example_1":{"value":{"items":[{"group_membership_id":"7443001845129083411","user_id":"7442550215703679004","group_id":"7442551216804781021","tenant_id":"7442678451937742086","is_active":true}]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"user_groups","x-auth-context":"tenant","x-required-permissions":[{"model":"group_memberships","action":"read","key":"group_memberships.read"}]}},"/api/v1/users/{user_id}/permissions/effective":{"get":{"tags":["v1/Core/users"],"summary":"Get user effective permissions","description":"Get the resolved effective permissions for a user in the current or selected tenant.","operationId":"getUserEffectivePermissions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional tenant ID override. Superuser only.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520],"title":"Tenant Id"},"description":"Optional tenant ID override. Superuser only."},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserEffectivePermissionsResponse"},"examples":{"example_1":{"value":{"user_id":"7442550215703679004","tenant_id":"7442551216804781021","is_superuser":true,"role_ids":["7442678451937742086"],"group_ids":["7443001845129083411"],"permissions":["agents.read","agents.read.any","knowledgefile.read.granted"]}}}}}},"400":{"description":"Bad request due to invalid input.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"400","status_message":"Bad Request","errors":[{"info":"Bad request due to invalid input.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"401","status_message":"Unauthorized","errors":[{"info":"Authentication required.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied. You do not have permission to perform this action.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"403","status_message":"Forbidden","errors":[{"info":"Access denied. You do not have permission to perform this action.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource could not be found.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"404","status_message":"Not Found","errors":[{"info":"Requested resource could not be found.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal server error occurred.","content":{"application/json":{"examples":{"example_1":{"value":{"status_code":"500","status_message":"Internal Server Error","errors":[{"info":"Unexpected internal server error occurred.","type":null,"context":null,"cause":null}]}}},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-content-part":"effective_permissions","x-auth-context":"any"}},"/ws/sync/chats":{"get":{"tags":["v1/Sync/chats"],"summary":"Chat Index","operationId":"chat_index_ws_sync_chats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatIndexPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ws/sync/chats/{chat_id}/history":{"get":{"tags":["v1/Sync/chats"],"summary":"Chat History","operationId":"chat_history_ws_sync_chats__chat_id__history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"title":"Chat Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"before_sequence","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Before Sequence"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"representation","in":"query","required":false,"schema":{"$ref":"#/components/schemas/HistoryRepresentation","default":"display"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatHistoryWindow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ws/sync/chats/{chat_id}/history/gap":{"get":{"tags":["v1/Sync/chats"],"summary":"Chat History Gap","operationId":"chat_history_gap_ws_sync_chats__chat_id__history_gap_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"title":"Chat Id"}},{"name":"from_sequence","in":"query","required":true,"schema":{"type":"integer","minimum":0,"title":"From Sequence"}},{"name":"through_sequence","in":"query","required":true,"schema":{"type":"integer","minimum":0,"title":"Through Sequence"}},{"name":"representation","in":"query","required":false,"schema":{"$ref":"#/components/schemas/HistoryRepresentation","default":"display"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatHistoryGap"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ws/sync/agents":{"get":{"tags":["v1/Sync/agents"],"summary":"Agent State","operationId":"agent_state_ws_sync_agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Include"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStatePage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ws/sync/knowledge-files":{"get":{"tags":["v1/Sync/knowledge-files"],"summary":"Knowledge File Index","operationId":"knowledge_file_index_ws_sync_knowledge_files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeFileIndexPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ws/sync/changes":{"get":{"tags":["v1/Sync/changes"],"summary":"Changes","operationId":"changes_ws_sync_changes_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":true,"schema":{"type":"string","title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"X-Tenant-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"X-Impersonate-User-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Impersonate-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeFeedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActiveUserMetrics":{"properties":{"active_users":{"type":"string","title":"Active Users","description":"Number of users active during the timeframe","examples":["45"]},"total_active_messages":{"type":"string","title":"Total Active Messages","description":"Total number of messages sent by active users","examples":["1200"]},"average_messages_per_active_user":{"type":"string","title":"Average Messages Per Active User","description":"Average messages per active user","examples":["26.67"]},"total_active_tokens":{"$ref":"#/components/schemas/TokenUsage","description":"Total token usage (response and request tokens) for active users"},"average_tokens_per_active_user":{"type":"string","title":"Average Tokens Per Active User","description":"Average token usage per active user","examples":["222.22"]}},"type":"object","required":["active_users","total_active_messages","average_messages_per_active_user","total_active_tokens","average_tokens_per_active_user"],"title":"ActiveUserMetrics","example":{"active_users":"45","average_messages_per_active_user":"26.67","average_tokens_per_active_user":"222.22","total_active_messages":"1200","total_active_tokens":{"request_tokens":"8000","response_tokens":"12000"}}},"AddAgentWhitelistBody":{"properties":{"entries":{"additionalProperties":{"items":{"type":"string"},"type":"array","uniqueItems":true},"propertyNames":{"$ref":"#/components/schemas/WhitelistMatchType"},"type":"object","title":"Entries","description":"Whitelist entries keyed by match type, for example user_id, email, email_domain, phone_number, clerk, whatsapp, microsoft, or better_auth.","examples":[{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]}]}},"type":"object","title":"AddAgentWhitelistBody","example":{"entries":{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]}}},"AddAgentWhitelistResponse":{"properties":{"added":{"type":"string","title":"Added","description":"Summary of whitelist entries added.","examples":["Added 2 whitelist entries."]},"already_present":{"type":"string","title":"Already Present","description":"Summary of entries that already existed.","examples":["1 whitelist entry already existed."]}},"type":"object","required":["added","already_present"],"title":"AddAgentWhitelistResponse","example":{"added":"Added 2 whitelist entries.","already_present":"1 whitelist entry already existed."}},"AddGroupMemberBody":{"properties":{"user_id":{"type":"integer","title":"User Id","description":"User ID to add.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["user_id"],"title":"AddGroupMemberBody","example":{"user_id":"7442551216804781021"}},"AddGroupMemberResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"AddGroupMemberResponse","example":{"success":true}},"AddGroupRoleBody":{"properties":{"role_id":{"type":"integer","title":"Role Id","description":"Role ID to assign to the group.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["role_id"],"title":"AddGroupRoleBody","example":{"role_id":"7442551216804781021"}},"AddGroupRoleResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"AddGroupRoleResponse","example":{"success":true}},"AddRolePermissionsBody":{"properties":{"permissions":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Permissions","description":"List of permission strings to add.","examples":[["roles.read"],["roles.read","roles.update","users.read"]]}},"type":"object","required":["permissions"],"title":"AddRolePermissionsBody","example":{"permissions":["roles.read"]}},"AddRolePermissionsResponse":{"properties":{"add_permissions":{"additionalProperties":{"type":"string"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object","title":"Add Permissions","description":"Added role permission IDs mapped to permission strings.","examples":[{"7442678451937742086":"agents:read"}]},"add_failed":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Add Failed","description":"Failed additions mapped by permission string to error message.","examples":[{"agents:read":"Role permission already exists."}]}},"type":"object","title":"AddRolePermissionsResponse","example":{"add_failed":{"agents:read":"Role permission already exists."},"add_permissions":{"7442678451937742086":"agents:read"}}},"AgentCustomToolBase":{"properties":{"tool_name":{"type":"string","maxLength":128,"minLength":1,"title":"Tool Name","description":"Tool name.","examples":["lookup_customer"]},"tool_description":{"type":"string","minLength":1,"title":"Tool Description","description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."]},"request_config":{"$ref":"#/components/schemas/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/components/schemas/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Retries","description":"Max retries.","examples":[1]},"read_only":{"type":"boolean","title":"Read Only","description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","default":false},"defer_loading":{"type":"boolean","title":"Defer Loading","description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","default":false,"examples":[true]},"input_schema":{"$ref":"#/components/schemas/CustomToolInputSchema-Input","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Api Key","description":"Optional API key used when calling the custom tool.","examples":["sk_tool_live_123456"]}},"type":"object","required":["tool_name","tool_description","request_config"],"title":"AgentCustomToolBase","example":{"api_key":"sk_tool_live_123456","defer_loading":true,"max_retries":1,"request_config":"<request_config>","tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"}},"AgentCustomToolResponseBase":{"properties":{"agent_tool_id":{"type":"string","title":"Agent Tool Id","description":"Custom agent tool ID.","examples":[7442551216804781344]},"tool_name":{"type":"string","title":"Tool Name","description":"Custom tool name.","examples":["lookup_customer"]},"tool_description":{"type":"string","title":"Tool Description","description":"Custom tool description.","examples":["Looks up a customer record by customer ID."]},"api_url":{"type":"string","title":"Api Url","description":"Custom tool API URL.","examples":["https://api.example.com/customers/{customer_id}"]},"http_method":{"type":"string","title":"Http Method","description":"HTTP method used by the custom tool.","examples":["GET"]},"max_retries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Retries","description":"Maximum retry attempts for the custom tool request.","examples":[2]},"read_only":{"type":"boolean","title":"Read Only","description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","default":false},"defer_loading":{"type":"boolean","title":"Defer Loading","description":"Whether the agent discovers this tool through search.","default":false,"examples":[true]},"has_api_key":{"type":"boolean","title":"Has Api Key","description":"Whether the custom tool has a stored API key.","examples":[true]},"input_parameters":{"items":{"type":"string"},"type":"array","title":"Input Parameters","description":"Input parameter names exposed by the custom tool.","examples":[["customer_id"]]}},"type":"object","required":["agent_tool_id","tool_name","tool_description","api_url","http_method","has_api_key","input_parameters"],"title":"AgentCustomToolResponseBase","example":{"agent_tool_id":"7442551216804781344","api_url":"https://api.example.com/customers/{customer_id}","defer_loading":true,"has_api_key":true,"http_method":"GET","input_parameters":["customer_id"],"max_retries":2,"tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"}},"AgentDatevProfileResponse":{"properties":{"assigned_agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Assigned Agent Id","description":"Agent ID assigned to the DATEV profile.","examples":[7442550215703679004]},"assigned_datev_profile_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Assigned Datev Profile Id","description":"DATEV profile ID assigned to the agent.","examples":[7442678451937742086]},"unassigned_agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Unassigned Agent Id","description":"Agent ID unassigned from the DATEV profile.","examples":[7442550215703679137]},"unassigned_datev_profile_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Unassigned Datev Profile Id","description":"DATEV profile ID removed from a previous assignment.","examples":[7442678451937742214]}},"type":"object","title":"AgentDatevProfileResponse","example":{"assigned_agent_id":"7442550215703679004","assigned_datev_profile_id":"7442678451937742086","unassigned_agent_id":"7442550215703679137","unassigned_datev_profile_id":"7442678451937742214"}},"AgentFileBase":{"properties":{"agent_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Agent Ids","description":"Agent IDs.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]},"file_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"File Ids","description":"File IDs.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","required":["agent_ids","file_ids"],"title":"AgentFileBase"},"AgentImageSnapshot":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"agent_image_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Image Id"},"presigned_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presigned Url"},"presigned_url_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presigned Url Expires At"}},"additionalProperties":false,"type":"object","required":["agent_id"],"title":"AgentImageSnapshot"},"AgentInstructionsSnapshot":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"instruction_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction Prompt"}},"additionalProperties":false,"type":"object","required":["agent_id"],"title":"AgentInstructionsSnapshot"},"AgentLifecycleSnapshot":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"agent_image_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Image Id"}},"additionalProperties":false,"type":"object","required":["agent_id","name","created_at","updated_at"],"title":"AgentLifecycleSnapshot"},"AgentMcpClientResponse":{"properties":{"mcp_client_id":{"type":"string","title":"Mcp Client Id","description":"Agent MCP client ID.","examples":[7442551216804781021]},"agent_id":{"type":"string","title":"Agent Id","description":"Owning agent ID.","examples":[7442550215703679004]},"mcp_server_id":{"type":"string","title":"Mcp Server Id","description":"Linked MCP server ID.","examples":[7442551216804781198]},"name":{"type":"string","title":"Name","description":"Tool prefix for this server on this agent.","examples":["accounting"]},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["mcp_client_id","agent_id","mcp_server_id","name","enabled"],"title":"AgentMcpClientResponse","example":{"agent_id":"7442550215703679004","enabled":"<enabled>","mcp_client_id":"7442551216804781021","mcp_server_id":"7442551216804781198","name":"accounting"}},"AgentMetaSnapshot":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"model":{"type":"string","title":"Model"},"model_settings":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"title":"Model Settings"},"default_file_title_tags":{"type":"boolean","title":"Default File Title Tags"},"default_chat_summary":{"type":"boolean","title":"Default Chat Summary"},"default_chat_title":{"type":"boolean","title":"Default Chat Title"},"default_transcribe":{"type":"boolean","title":"Default Transcribe"},"default_embedding":{"type":"boolean","title":"Default Embedding"}},"additionalProperties":false,"type":"object","required":["agent_id","model","default_file_title_tags","default_chat_summary","default_chat_title","default_transcribe","default_embedding"],"title":"AgentMetaSnapshot"},"AgentPhoneResponse":{"properties":{"assigned_agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Assigned Agent Id","description":"Agent ID assigned to the phone number.","examples":[7442550215703679004]},"assigned_whatsapp_business_phone_number_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Assigned Whatsapp Business Phone Number Id","description":"WhatsApp business phone number ID assigned to the agent.","examples":[7442551216804781021]},"unassigned_agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Unassigned Agent Id","description":"Agent ID unassigned from the phone number.","examples":[7442550215703679137]},"unassigned_whatsapp_business_phone_number_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Unassigned Whatsapp Business Phone Number Id","description":"WhatsApp business phone number ID removed from a previous assignment.","examples":[7442551216804781198]}},"type":"object","title":"AgentPhoneResponse","example":{"assigned_agent_id":"7442550215703679004","assigned_whatsapp_business_phone_number_id":"7442551216804781021","unassigned_agent_id":"7442550215703679137","unassigned_whatsapp_business_phone_number_id":"7442551216804781198"}},"AgentPhoneSnapshot":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"agent_phone_number_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Phone Number Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},"additionalProperties":false,"type":"object","required":["agent_id"],"title":"AgentPhoneSnapshot"},"AgentRetries":{"properties":{"tools":{"type":"integer","title":"Tools"},"output":{"type":"integer","title":"Output"}},"additionalProperties":false,"type":"object","title":"AgentRetries","description":"Per-category retry budgets for an [`Agent`][pydantic_ai.agent.Agent].\n\nPass to `Agent(retries=...)` as a dict to set different budgets per category.\n\nA bare `int` is shorthand for setting both `tools` and `output` to that value — the same at\nevery call site (`Agent(retries=N)`, `run()`, `iter()`, `override()`, and a run-time `spec`).\nTo set only one budget, pass a dict, e.g. `retries={'tools': ...}` or `retries={'output': ...}`.\n\nKeys:\n    tools: Default number of retries for tool calls before raising an error. Applies to function\n        tools, output tools, and MCP tools, unless a more specific per-tool or per-toolset limit\n        is set.\n    output: Maximum number of retries for output validation. On the text path\n        this is a global per-run budget; on the tool path it is the default\n        per-tool `max_retries` for each output tool, overridable via\n        [`ToolOutput(max_retries=...)`][pydantic_ai.output.ToolOutput.max_retries]."},"AgentSpec":{"properties":{"json_schema_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Json Schema Path","description":"JSON schema URI for the native agent spec.","examples":["https://schemas.livoi.de/native-agent-spec/v1.json"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"model":{"type":"string","minLength":1,"title":"Model","description":"Model used by the agent.","default":"gpt-6-luna","examples":["gpt-6-luna"]},"instruction_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction Prompt"},"deps_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deps Schema"},"output_schema":{"anyOf":[{"$ref":"#/components/schemas/ChatOutputSchema-Output"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Schema","description":"Output field definitions; omit for text answers.","examples":[{"fields":[{"name":"score","required":true,"type":"integer"}]}]},"model_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Model Settings"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"output_shape":{"anyOf":[{"$ref":"#/components/schemas/AgentSpecOutputShape"},{"type":"null"}]},"deps_contract":{"anyOf":[{"$ref":"#/components/schemas/AgentSpecDepsContract"},{"type":"null"}]},"retries":{"anyOf":[{"type":"integer"},{"$ref":"#/components/schemas/AgentRetries"},{"type":"null"}],"title":"Retries","description":"Retry limits for tool calls and output validation.","examples":[{"output":2,"tools":1}]},"end_strategy":{"type":"string","enum":["early","graceful","exhaustive"],"title":"End Strategy","default":"early"},"tool_timeout":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Tool Timeout","description":"Tool timeout in seconds.","examples":[30.0]},"capabilities":{"items":{"$ref":"#/components/schemas/CapabilitySpec"},"type":"array","title":"Capabilities","description":"Native agent capabilities."},"ownership":{"$ref":"#/components/schemas/AgentSpecOwnership"}},"additionalProperties":false,"type":"object","required":["ownership"],"title":"AgentSpec"},"AgentSpecDependencyField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Dependency field name.","examples":["tenant_id","user_id"]},"type":{"type":"string","minLength":1,"title":"Type","description":"Dependency field type annotation.","examples":["int","int | None"]},"required":{"type":"boolean","title":"Required","default":true}},"additionalProperties":false,"type":"object","required":["name","type"],"title":"AgentSpecDependencyField"},"AgentSpecDepsContract":{"properties":{"reference":{"type":"string","minLength":1,"title":"Reference","description":"Import path for the dependency contract model.","default":"shared.schemas.agent_runtime.AgentSpecDeps","examples":["shared.schemas.agent_runtime.AgentSpecDeps"]},"fields":{"items":{"$ref":"#/components/schemas/AgentSpecDependencyField"},"type":"array","title":"Fields","description":"Dependency fields required by the agent runtime."}},"additionalProperties":false,"type":"object","title":"AgentSpecDepsContract"},"AgentSpecOutputShape":{"properties":{"reference":{"type":"string","minLength":1,"title":"Reference","description":"Import path for the output shape.","examples":["schemas.agent_runtime.AgentOutput"]}},"additionalProperties":false,"type":"object","required":["reference"],"title":"AgentSpecOutputShape"},"AgentSpecOwnership":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id","examples":["7442550215703679873"]},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id"}},"additionalProperties":false,"type":"object","required":["tenant_id"],"title":"AgentSpecOwnership"},"AgentStatePage":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentStateSnapshot"},"type":"array","title":"Agents"},"included_sections":{"items":{"$ref":"#/components/schemas/AgentSyncSection"},"type":"array","title":"Included Sections"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"additionalProperties":false,"type":"object","required":["agents","included_sections","has_more"],"title":"AgentStatePage"},"AgentStateSnapshot":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"lifecycle":{"anyOf":[{"$ref":"#/components/schemas/AgentLifecycleSnapshot"},{"type":"null"}]},"instructions":{"anyOf":[{"$ref":"#/components/schemas/AgentInstructionsSnapshot"},{"type":"null"}]},"meta":{"anyOf":[{"$ref":"#/components/schemas/AgentMetaSnapshot"},{"type":"null"}]},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentToolsSnapshot"},"type":"array"},{"type":"null"}],"title":"Tools"},"image":{"anyOf":[{"$ref":"#/components/schemas/AgentImageSnapshot"},{"type":"null"}]},"phone":{"anyOf":[{"$ref":"#/components/schemas/AgentPhoneSnapshot"},{"type":"null"}]},"whitelist":{"anyOf":[{"$ref":"#/components/schemas/AgentWhitelistState"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["agent_id"],"title":"AgentStateSnapshot"},"AgentSyncSection":{"type":"string","enum":["agent.lifecycle","agent.instructions","agent.meta","agent.tools","agent.image","agent.phone","agent.whitelist"],"title":"AgentSyncSection"},"AgentToolsSnapshot":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"tool_name":{"type":"string","title":"Tool Name"},"agent_tool_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Tool Id"}},"additionalProperties":false,"type":"object","required":["agent_id","tool_name"],"title":"AgentToolsSnapshot"},"AgentWhitelistEntrySnapshot":{"properties":{"id":{"type":"string","title":"Id","examples":["7442550215703679873"]},"match_type":{"$ref":"#/components/schemas/WhitelistMatchType"},"match_value":{"type":"string","minLength":1,"title":"Match Value"}},"additionalProperties":false,"type":"object","required":["id","match_type","match_value"],"title":"AgentWhitelistEntrySnapshot"},"AgentWhitelistState":{"properties":{"agent_id":{"type":"string","title":"Agent Id","examples":["7442550215703679873"]},"entries":{"$ref":"#/components/schemas/WhitelistEntries","description":"Complete current whitelist, including an empty whitelist."}},"additionalProperties":false,"type":"object","required":["agent_id"],"title":"AgentWhitelistState"},"ApiKeyInstance":{"type":"string","enum":["prod","staging","dev","test","local"],"title":"ApiKeyInstance"},"ApiKeyKind":{"type":"string","enum":["pk","sk","wk"],"title":"ApiKeyKind"},"ApiKeyListItemModel":{"properties":{"id":{"type":"string","title":"Id","description":"API key ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"API key name.","examples":["Local Dev Key"]},"kind":{"$ref":"#/components/schemas/ApiKeyKind","description":"API key kind.","examples":["sk"]},"instance":{"$ref":"#/components/schemas/ApiKeyInstance","description":"API key instance.","examples":["dev"]},"tenant_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Tenant Id","description":"Bound tenant ID, if this is a tenant-scoped key.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"User Id","description":"User ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the API key is active.","examples":[true,false]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether this API key can activate superuser authorization.","examples":[true,false]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Expiration timestamp.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At","description":"Revocation timestamp.","examples":["2027-12-01T07:55:09Z","2028-08-14T13:20:48Z","2029-05-22T21:44:30Z","2030-10-30T02:11:16Z"]},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At","description":"Last usage timestamp.","examples":["2027-01-23T05:18:42Z","2028-04-11T16:09:27Z","2029-07-30T12:56:03Z","2030-09-15T20:41:59Z"]},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"Permissions.","examples":[["agents.read","agents.read.any","knowledgefile.read.granted"],["users.read","users.update","groups.read"],["roles.create","roles.update","roles.delete.any"],["agents.read.own","groups.read","users.read"]]}},"type":"object","required":["id","name","kind","instance","is_active","is_superuser"],"title":"ApiKeyListItemModel","example":{"expires_at":"2027-02-10T11:22:33Z","id":"7442550215703679004","instance":"dev","is_active":true,"is_superuser":true,"kind":"sk","last_used_at":"2027-01-23T05:18:42Z","name":"Local Dev Key","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"revoked_at":"2027-12-01T07:55:09Z","tenant_id":"7442551216804781021","user_id":"7442678451937742086"}},"AssignAgentFilesBody":{"properties":{"agent_file_assign":{"items":{"$ref":"#/components/schemas/AgentFileBase"},"type":"array","title":"Agent File Assign","description":"Agent-file assignments to create."}},"type":"object","required":["agent_file_assign"],"title":"AssignAgentFilesBody","example":{"agent_file_assign":["<agent_file_assign>"]}},"AssignAgentFilesResponse":{"properties":{"assigned":{"additionalProperties":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object","title":"Assigned","description":"Mapping of agent IDs to file IDs assigned successfully.","examples":[{"7442550215703679004":[7442551216804781021]}]},"failed":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Failed","description":"Assignment failures keyed by input identifier.","examples":[{"7442551216804781198":"File not found."}]}},"type":"object","required":["assigned"],"title":"AssignAgentFilesResponse","example":{"assigned":{"7442550215703679004":["7442551216804781021"]},"failed":{"7442551216804781198":"File not found."}}},"AssignUserRoleBody":{"properties":{"user_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"User Ids","description":"User IDs to assign role to.","examples":[[7442678451937742086],[7442678451937742086,7442678451937742214,7442678451937742389]]}},"type":"object","required":["user_ids"],"title":"AssignUserRoleBody","example":{"user_ids":["7442678451937742086"]}},"AssignUserRoleResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Operation result.","default":true,"examples":[true]},"assigned_user_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","uniqueItems":true,"title":"Assigned User Ids","description":"User IDs that were successfully assigned the role.","examples":[[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]]},"failed":{"anyOf":[{"additionalProperties":{"type":"string"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object"},{"type":"null"}],"title":"Failed","description":"Failed assignments mapped by user ID to error message.","examples":[{"7442550215703679004":"User not found.","7442550215703679137":"User already has this role."}]}},"type":"object","required":["assigned_user_ids"],"title":"AssignUserRoleResponse","example":{"assigned_user_ids":["7442678451937742389","7442678451937742086","7442678451937742214","7442678451937742520"],"failed":{"7442550215703679004":"User not found.","7442550215703679137":"User already has this role."},"success":true}},"AuthenticationBodyParam":{"properties":{"type":{"type":"string","const":"AUTHENTICATION_BODY","title":"Type","description":"Runtime authentication body parameter type.","examples":["AUTHENTICATION_BODY"]},"otp":{"type":"string","minLength":1,"title":"Otp","description":"OTP value for the authentication body.","examples":["0220292","94604798"]}},"additionalProperties":false,"type":"object","required":["type","otp"],"title":"AuthenticationBodyParam"},"AutomationBody":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name","examples":["Order preparation"]},"agent_id":{"type":"integer","title":"Agent Id","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"configuration":{"$ref":"#/components/schemas/AutomationConfiguration"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","required":["name","agent_id"],"title":"AutomationBody","example":{"agent_id":"7442550215703679004","name":"Order preparation"}},"AutomationConfiguration":{"properties":{"preparation":{"$ref":"#/components/schemas/PreparationPolicy"},"reason_codes":{"items":{"type":"string"},"type":"array","maxItems":64,"uniqueItems":true,"title":"Reason Codes"},"limits":{"$ref":"#/components/schemas/BackgroundLimits"}},"additionalProperties":false,"type":"object","title":"AutomationConfiguration"},"AutomationItemStatus":{"type":"string","enum":["pending","running","ready","needs_action","ignored","cancelled"]},"AutomationView":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name","examples":["Order preparation"]},"agent_id":{"type":"string","title":"Agent Id","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"configuration":{"$ref":"#/components/schemas/AutomationConfiguration"},"enabled":{"type":"boolean","title":"Enabled","default":true},"automation_id":{"type":"string","title":"Automation Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"additionalProperties":false,"type":"object","required":["name","agent_id","automation_id"],"title":"AutomationView","example":{"agent_id":"7442550215703679004","automation_id":"7442551216804781021","name":"Order preparation"}},"BackgroundLimits":{"properties":{"requests":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Requests","default":8},"tool_calls":{"type":"integer","maximum":64.0,"minimum":1.0,"title":"Tool Calls","default":16},"total_tokens":{"type":"integer","maximum":128000.0,"minimum":1.0,"title":"Total Tokens","default":32000},"output_tokens":{"type":"integer","maximum":16000.0,"minimum":1.0,"title":"Output Tokens","default":4000},"timeout_seconds":{"type":"number","maximum":600.0,"exclusiveMinimum":0.0,"title":"Timeout Seconds","default":120},"tool_timeout_seconds":{"type":"number","maximum":60.0,"exclusiveMinimum":0.0,"title":"Tool Timeout Seconds","default":20},"request_bytes":{"type":"integer","maximum":262144.0,"minimum":1.0,"title":"Request Bytes","default":65536},"response_bytes":{"type":"integer","maximum":1048576.0,"minimum":1.0,"title":"Response Bytes","default":262144}},"additionalProperties":false,"type":"object","title":"BackgroundLimits"},"BackgroundResult":{"properties":{"outcome":{"type":"string","enum":["ready","needs_action","ignored"],"title":"Outcome"},"reason_code":{"type":"string","title":"Reason Code"},"reason":{"type":"string","title":"Reason"},"data":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Data"}},"additionalProperties":false,"type":"object","required":["outcome","reason_code","reason","data"],"title":"BackgroundResult"},"BodyTextParam":{"properties":{"type":{"type":"string","const":"BODY_TEXT","title":"Type","description":"Runtime body text parameter type.","examples":["BODY_TEXT"]},"values":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"oneOf":[{"$ref":"#/components/schemas/CurrencyTextValue"},{"$ref":"#/components/schemas/DateTimeTextValue"}],"discriminator":{"propertyName":"type","mapping":{"CURRENCY":"#/components/schemas/CurrencyTextValue","DATE_TIME":"#/components/schemas/DateTimeTextValue"}}}]},"type":"array"},{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"oneOf":[{"$ref":"#/components/schemas/CurrencyTextValue"},{"$ref":"#/components/schemas/DateTimeTextValue"}],"discriminator":{"propertyName":"type","mapping":{"CURRENCY":"#/components/schemas/CurrencyTextValue","DATE_TIME":"#/components/schemas/DateTimeTextValue"}}}]},"type":"object"}],"title":"Values","description":"Text parameter values. Use an array for positional templates and an object for named templates.","examples":[["Max","Tuesday"],{"appointment_day":"Tuesday","customer_name":"Max"}]}},"additionalProperties":false,"type":"object","required":["type","values"],"title":"BodyTextParam"},"Button":{"properties":{"title":{"type":"string","maxLength":80,"minLength":1,"title":"Title","description":"Button title shown in the first-contact message.","examples":["Open website"]},"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"Button destination URL.","examples":["https://example.com"]}},"additionalProperties":false,"type":"object","required":["title","url"],"title":"Button"},"Calendar":{"properties":{"external_id":{"type":"string","minLength":1,"title":"External Id"},"name":{"type":"string","minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"time_zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Time Zone"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"owner":{"anyOf":[{"$ref":"#/components/schemas/EmailAddress"},{"type":"null"}]},"is_default":{"type":"boolean","title":"Is Default","default":false},"is_selected":{"type":"boolean","title":"Is Selected","default":false},"is_hidden":{"type":"boolean","title":"Is Hidden","default":false},"can_edit":{"type":"boolean","title":"Can Edit","default":false},"can_share":{"type":"boolean","title":"Can Share","default":false},"can_view_private_items":{"type":"boolean","title":"Can View Private Items","default":false}},"additionalProperties":false,"type":"object","required":["external_id","name"],"title":"Calendar"},"CalendarAssignRequestBase":{"properties":{"agent_id":{"type":"integer","title":"Agent Id","description":"Agent ID to assign calendars to.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"calendar_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Calendar Ids","description":"Calendar IDs to assign or unassign.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]},"calendar_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Calendar Names","description":"Calendar names to assign or unassign.","examples":[["Team","Dev","External"]]}},"type":"object","required":["agent_id"],"title":"CalendarAssignRequestBase","example":{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}},"CalendarAssignResponseBase":{"properties":{"agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Id","description":"The agent ID calendars were assigned or unassigned for.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"calendar_ids":{"anyOf":[{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},{"type":"null"}],"title":"Calendar Ids","description":"Calendar IDs currently assigned to the agent after the operation.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error if assignment or unassignment failed.","examples":["Agent not found: [744128060820239091]","Calendar not found: Team"]}},"type":"object","title":"CalendarAssignResponseBase","example":{"agent_id":"7442550215703679004","calendar_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"error":"Agent not found: [744128060820239091]"}},"CalendarCreateItem":{"properties":{"name":{"type":"string","maxLength":20,"minLength":1,"title":"Name","description":"Name of the calendar.","examples":["Team"]},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Tags associated with the calendar.","examples":[["meeting","internal"],["meeting","internal","dev"],["meeting","internal","planning"]]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the calendar.","examples":["Internal calendar for team meetings","Internal calendar for Dev meetings"]},"link":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Link","description":"URL link related to the calendar.","examples":["https://calendar.example.com/team","https://calendar.example.com/dev"]}},"type":"object","required":["name","link"],"title":"CalendarCreateItem","example":{"description":"Internal calendar for team meetings","link":"https://calendar.example.com/team","name":"Team","tags":["meeting","internal"]}},"CalendarEvent":{"properties":{"external_id":{"type":"string","minLength":1,"title":"External Id"},"external_calendar_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Calendar Id"},"external_recurring_event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Recurring Event Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"start":{"$ref":"#/components/schemas/CalendarEventTime"},"end":{"$ref":"#/components/schemas/CalendarEventTime"},"creator":{"anyOf":[{"$ref":"#/components/schemas/CalendarParticipant"},{"type":"null"}]},"organizer":{"anyOf":[{"$ref":"#/components/schemas/CalendarParticipant"},{"type":"null"}]},"attendees":{"items":{"$ref":"#/components/schemas/CalendarParticipant"},"type":"array","title":"Attendees","default":[]},"is_all_day":{"type":"boolean","title":"Is All Day","default":false},"is_cancelled":{"type":"boolean","title":"Is Cancelled","default":false},"web_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Url"}},"additionalProperties":false,"type":"object","required":["external_id","start","end"],"title":"CalendarEvent"},"CalendarEventTime":{"properties":{"date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date"},"date_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Time"},"time_zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Time Zone"}},"additionalProperties":false,"type":"object","title":"CalendarEventTime"},"CalendarParticipant":{"properties":{"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"response_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Status"},"is_self":{"type":"boolean","title":"Is Self","default":false}},"additionalProperties":false,"type":"object","title":"CalendarParticipant"},"CapabilitySpec":{},"CarouselParam":{"properties":{"type":{"type":"string","const":"CAROUSEL","title":"Type","description":"Runtime carousel parameter type.","examples":["CAROUSEL"]},"cards":{"items":{"$ref":"#/components/schemas/TemplateSendCarouselCard"},"type":"array","minItems":1,"title":"Cards","description":"Carousel card params. Each card must contain its own indexed component params.","examples":[[{"index":0,"params":[{"type":"HEADER_TEXT","values":["Offer 1"]},{"type":"BODY_TEXT","values":["Max","20% discount"]}]},{"index":1,"params":[{"type":"HEADER_TEXT","values":["Offer 2"]},{"index":0,"type":"URL","url_variable":"product/sku-2001"}]}]]}},"additionalProperties":false,"type":"object","required":["type","cards"],"title":"CarouselParam"},"CatalogParam":{"properties":{"type":{"type":"string","const":"CATALOG","title":"Type","description":"Runtime catalog button parameter type.","examples":["CATALOG"]},"index":{"type":"integer","minimum":0.0,"title":"Index","description":"Zero-based button index.","examples":[0,1,2]},"thumbnail_product_sku":{"type":"string","minLength":1,"title":"Thumbnail Product Sku","description":"Thumbnail product SKU for catalog buttons.","examples":["SKU-1001","SKU-2001"]}},"additionalProperties":false,"type":"object","required":["type","index","thumbnail_product_sku"],"title":"CatalogParam"},"CauseDetails":{"properties":{"details":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details","description":"Detailed information about the cause"},"value":{"anyOf":[{"type":"string"},{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Value","description":"The value associated with the cause"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"The location associated with the cause"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","description":"Optional machine-readable error code"}},"additionalProperties":true,"type":"object","title":"CauseDetails"},"ChangeFeedPage":{"properties":{"status":{"type":"string","const":"ok","title":"Status","default":"ok"},"changes":{"items":{"$ref":"#/components/schemas/SyncChange"},"type":"array","title":"Changes"},"next_cursor":{"type":"string","title":"Next Cursor"},"live_cursor":{"type":"string","title":"Live Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"additionalProperties":false,"type":"object","required":["changes","next_cursor","live_cursor","has_more"],"title":"ChangeFeedPage"},"ChangeFeedResponse":{"anyOf":[{"$ref":"#/components/schemas/ChangeFeedPage"},{"$ref":"#/components/schemas/FullResyncRequired"}]},"ChatAwaitBody":{"properties":{"chat_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chat Id","description":"ID of the chat to continue.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"app_origin":{"anyOf":[{"$ref":"#/components/schemas/McpAppMessageOrigin"},{"type":"null"}]},"supports_mcp_apps":{"type":"boolean","title":"Supports Mcp Apps","description":"Whether the chat client can render MCP Apps. Omit for text-only tool results.","default":false},"supports_html_renders":{"type":"boolean","title":"Supports Html Renders","description":"Set to true when this client can display interactive HTML attachments. The agent may then publish one per response. The response field `html_render` and its history part (file_handling `html_render`) identify it; read the document with readChatHtmlRender, which requires read access to the chat and its history. Send the same value on every request from a client.","default":false},"prompt":{"anyOf":[{"type":"string","maxLength":65536},{"type":"null"}],"title":"Prompt","description":"User input prompt.","examples":["Hello LIVOI, how can you help me?","How can you save me time?","Which documents can I upload?"]},"media":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequireAllowedChatMediaUpload"},"type":"array","minItems":1},{"type":"null"}],"title":"Media","description":"Uploaded media files.","examples":[["report.pdf","summary.txt"],null]},"storage_object_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array","minItems":1},{"type":"null"}],"title":"Storage Object Ids","description":"Existing storage object IDs to attach to the message.","examples":[[7442551216804781021,7442551216804781198],null]}},"type":"object","title":"ChatAwaitBody","example":{"app_origin":{"app_history_part_id":"7442551216804781021","mcp_client_id":"7442550215703679004"},"chat_id":"7442550215703679004","media":["report.pdf","summary.txt"],"prompt":"Hello LIVOI, how can you help me?","storage_object_ids":["7442551216804781021","7442551216804781198"]}},"ChatAwaitResponse":{"properties":{"type":{"$ref":"#/components/schemas/ChatOutputType","description":"Whether message contains plain text or a validated structured output.","examples":["text"]},"message":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"}],"title":"Message","description":"Plain text or the validated configured output object.","examples":["Hello! How can I help?"]},"chat_id":{"type":"string","title":"Chat Id","description":"Chat session ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"history_id":{"type":"string","title":"History Id","description":"Assistant history entry ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"html_render":{"anyOf":[{"$ref":"#/components/schemas/ChatResponseHtmlRender"},{"type":"null"}],"description":"Interactive HTML attachment published in this response, if any. Requires supports_html_renders.","examples":[{"height":600,"history_part_id":"7442551216804781344","title":"Calculator","version":1},null]},"history_part_types":{"additionalProperties":{"type":"string"},"type":"object","title":"History Part Types","description":"Ordered mapping of visible history part IDs to their types.","examples":[{"7442551216804781021":"text","7442551216804781198":"tool_call","7442551216804781344":"tool_return","7442551216804781509":"text"}]}},"additionalProperties":false,"type":"object","required":["type","message","chat_id","history_id"],"title":"ChatAwaitResponse","example":{"chat_id":"7442550215703679004","history_id":"7442551216804781021","history_part_types":{"7442551216804781021":"text","7442551216804781198":"tool_call","7442551216804781344":"tool_return","7442551216804781509":"text"},"html_render":{"height":600,"history_part_id":"7442551216804781344","title":"Calculator","version":1},"message":"Hello! How can I help?","type":"text"}},"ChatDeleteBody":{"properties":{"chat_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Chat Ids","description":"Chat IDs to delete.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]},"history_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"History Ids","description":"History entry IDs to delete.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","title":"ChatDeleteBody","example":{"chat_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"history_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]}},"ChatDeleteResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Deletion status message.","examples":["Successfully deleted 2 chats and their histories."]},"attachments_deleted":{"type":"integer","title":"Attachments Deleted","description":"Number of chat attachments deleted.","default":0,"examples":[1]}},"type":"object","required":["status"],"title":"ChatDeleteResponse","example":{"attachments_deleted":1,"status":"Successfully deleted 2 chats and their histories."}},"ChatHistoryAttachment":{"properties":{"history_part_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"History Part Id","description":"History part of an interactive HTML attachment. Pass it to readChatHtmlRender to read the document."},"html_render":{"anyOf":[{"$ref":"#/components/schemas/HtmlRenderMetadata"},{"type":"null"}],"description":"Present only for interactive HTML attachments; ordinary HTML files omit it."},"attachment_id":{"type":"string","title":"Attachment Id","description":"Chat attachment ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"file_name":{"type":"string","title":"File Name","description":"Original uploaded file name.","examples":["report.pdf","summary.txt","invoice.png"]},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type","description":"Uploaded file MIME type.","examples":["application/pdf","image/png"]},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size","description":"Uploaded file size in bytes.","examples":[123456]},"presigned_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presigned Url","description":"Temporary URL for reading the attachment."},"presigned_url_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Presigned Url Expires At","description":"Expiration timestamp of the temporary URL."}},"type":"object","required":["attachment_id","file_name"],"title":"ChatHistoryAttachment","example":{"attachment_id":"7442551216804781021","content_type":"application/pdf","file_name":"report.pdf","size":123456}},"ChatHistoryEntryRole":{"type":"string","enum":["user","assistant","human","tool","system"],"title":"ChatHistoryEntryRole"},"ChatHistoryEntryType":{"type":"string","enum":["template","user_request","agent_response","human_response","system_event","system_context"],"title":"ChatHistoryEntryType"},"ChatHistoryGap":{"properties":{"chat_id":{"type":"string","title":"Chat Id","examples":["7442550215703679873"]},"representation":{"$ref":"#/components/schemas/HistoryRepresentation"},"hydration":{"$ref":"#/components/schemas/HistoryHydration"},"requested_range":{"$ref":"#/components/schemas/HistorySequenceRange"},"loaded_range":{"anyOf":[{"$ref":"#/components/schemas/HistorySequenceRange"},{"type":"null"}]},"entries":{"items":{"$ref":"#/components/schemas/HistoryEntry"},"type":"array","title":"Entries"},"complete":{"type":"boolean","title":"Complete"},"missing_sequences":{"items":{"type":"integer"},"type":"array","title":"Missing Sequences"}},"additionalProperties":false,"type":"object","required":["chat_id","representation","hydration","requested_range","entries","complete","missing_sequences"],"title":"ChatHistoryGap"},"ChatHistoryValidateEntryExpand":{"properties":{"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"UTC time of the latest history update."},"role":{"type":"string","title":"Role","description":"Message sender role.","examples":["user","assistant"]},"type":{"anyOf":[{"$ref":"#/components/schemas/ChatOutputType"},{"type":"string","const":"template"}],"title":"Type","description":"History content: text, structured output, or WhatsApp template.","default":"text"},"content":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"}],"title":"Content","description":"Message content.","examples":["Hello LIVOI, how can you help me?","How can you save me time?","Which documents can I upload?","Hello! I can answer questions, help you find information, and handle recurring communications.","I save time by answering common questions, summarizing information, and preparing workflows.","You can upload PDFs, Office documents, images, and audio files, for example."]},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp","description":"UTC timestamp.","examples":["2026-06-08T12:00:00Z"]},"history_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"History Id","description":"History entry ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatHistoryAttachment"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Files attached to this chat history entry."},"agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Id","description":"Agent ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"tool_log_ids":{"anyOf":[{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},{"type":"null"}],"title":"Tool Log Ids","description":"Associated tool call history part IDs.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","required":["role","content"],"title":"ChatHistoryValidateEntryExpand","example":{"agent_id":"7442550215703679004","attachments":[{"attachment_id":"7442551216804781021","content_type":"application/pdf","file_name":"report.pdf","size":123456}],"content":"Hello LIVOI, how can you help me?","history_id":"7442550215703679004","role":"user","timestamp":"2026-06-08T12:00:00Z","tool_log_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]}},"ChatHistoryValidationBody":{"properties":{"last_validation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Validation","description":"Last validation timestamp in UTC.","examples":["2026-06-08T12:00:00Z"]},"hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hash","description":"Hash representing the known history state.","examples":["sha256:8fd4e1c67a2d28fced849ee1bb76e739"]}},"type":"object","title":"ChatHistoryValidationBody","example":{"hash":"sha256:8fd4e1c67a2d28fced849ee1bb76e739","last_validation":"2026-06-08T12:00:00Z"}},"ChatHistoryValidationEntryBase":{"properties":{"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"UTC time of the latest history update."},"role":{"type":"string","title":"Role","description":"Message sender role.","examples":["user","assistant"]},"type":{"anyOf":[{"$ref":"#/components/schemas/ChatOutputType"},{"type":"string","const":"template"}],"title":"Type","description":"History content: text, structured output, or WhatsApp template.","default":"text"},"content":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"}],"title":"Content","description":"Message content.","examples":["Hello LIVOI, how can you help me?","How can you save me time?","Which documents can I upload?","Hello! I can answer questions, help you find information, and handle recurring communications.","I save time by answering common questions, summarizing information, and preparing workflows.","You can upload PDFs, Office documents, images, and audio files, for example."]},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp","description":"UTC timestamp.","examples":["2026-06-08T12:00:00Z"]},"history_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"History Id","description":"History entry ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatHistoryAttachment"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Files attached to this chat history entry."}},"type":"object","required":["role","content"],"title":"ChatHistoryValidationEntryBase","example":{"attachments":[{"attachment_id":"7442551216804781021","content_type":"application/pdf","file_name":"report.pdf","size":123456}],"content":"Hello LIVOI, how can you help me?","history_id":"7442550215703679004","role":"user","timestamp":"2026-06-08T12:00:00Z"}},"ChatHistoryValidationResponse":{"properties":{"hashed":{"type":"string","title":"Hashed","description":"Hash representing the current history state.","default":"","examples":["sha256:bbd4c8ef9a14f7f3134a4c5d02b6e612"]},"diff":{"anyOf":[{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatHistoryValidationEntryBase"},{"$ref":"#/components/schemas/ChatHistoryValidateEntryExpand"}]},"type":"array"},{"type":"null"}],"title":"Diff","description":"Differences between stored and current history when validation fails.","examples":[[{"content":"Hello LIVOI, how can you help me?","history_id":7442550215703679004,"role":"user","timestamp":"2026-06-08T12:00:00Z"}]]}},"type":"object","title":"ChatHistoryValidationResponse","example":{"diff":[{"content":"Hello LIVOI, how can you help me?","history_id":7442550215703679004,"role":"user","timestamp":"2026-06-08T12:00:00Z"}],"hashed":"sha256:bbd4c8ef9a14f7f3134a4c5d02b6e612"}},"ChatHistoryWindow":{"properties":{"chat_id":{"type":"string","title":"Chat Id","examples":["7442550215703679873"]},"representation":{"$ref":"#/components/schemas/HistoryRepresentation"},"hydration":{"$ref":"#/components/schemas/HistoryHydration"},"entries":{"items":{"$ref":"#/components/schemas/HistoryEntry"},"type":"array","title":"Entries"},"loaded_range":{"anyOf":[{"$ref":"#/components/schemas/HistorySequenceRange"},{"type":"null"}]},"latest_sequence":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Latest Sequence"},"complete_through_sequence":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Complete Through Sequence"},"has_older":{"type":"boolean","title":"Has Older"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"additionalProperties":false,"type":"object","required":["chat_id","representation","hydration","entries","has_older"],"title":"ChatHistoryWindow"},"ChatIndexPage":{"properties":{"chats":{"items":{"$ref":"#/components/schemas/ChatSummary"},"type":"array","title":"Chats"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"additionalProperties":false,"type":"object","required":["chats","has_more"],"title":"ChatIndexPage"},"ChatOutputSchema-Input":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/FieldSchema-Input"},"type":"array","title":"Fields"}},"additionalProperties":false,"type":"object","required":["fields"],"title":"ChatOutputSchema"},"ChatOutputSchema-Output":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/FieldSchema-Output"},"type":"array","title":"Fields"}},"additionalProperties":false,"type":"object","required":["fields"],"title":"ChatOutputSchema"},"ChatOutputType":{"type":"string","enum":["text","structured_output"]},"ChatResponseHtmlRender":{"properties":{"version":{"type":"integer","const":1,"title":"Version","description":"Metadata version.","default":1},"title":{"type":"string","maxLength":160,"minLength":1,"title":"Title","description":"Short name of the attachment."},"height":{"type":"integer","maximum":2000.0,"minimum":80.0,"title":"Height","description":"Expected content height in CSS pixels. Use it as the initial frame height and, on phones, as the maximum frame height."},"history_part_id":{"type":"string","title":"History Part Id","description":"History part of the attachment. Pass it to readChatHtmlRender to read the document.","examples":["7442550215703679873"]}},"additionalProperties":false,"type":"object","required":["title","height","history_part_id"],"title":"ChatResponseHtmlRender"},"ChatStreamBody":{"properties":{"chat_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chat Id","description":"ID of the chat to continue.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"app_origin":{"anyOf":[{"$ref":"#/components/schemas/McpAppMessageOrigin"},{"type":"null"}]},"supports_mcp_apps":{"type":"boolean","title":"Supports Mcp Apps","description":"Whether the chat client can render MCP Apps. Omit for text-only tool results.","default":false},"supports_html_renders":{"type":"boolean","title":"Supports Html Renders","description":"Set to true when this client can display interactive HTML attachments. The agent may then publish one per response. The response field `html_render` and its history part (file_handling `html_render`) identify it; read the document with readChatHtmlRender, which requires read access to the chat and its history. Send the same value on every request from a client.","default":false},"prompt":{"anyOf":[{"type":"string","maxLength":65536},{"type":"null"}],"title":"Prompt","description":"User input prompt.","examples":["Hello LIVOI, how can you help me?","How can you save me time?","Which documents can I upload?"]},"media":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequireAllowedChatMediaUpload"},"type":"array","minItems":1},{"type":"null"}],"title":"Media","description":"Uploaded media files.","examples":[["report.pdf","summary.txt"],null]},"storage_object_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array","minItems":1},{"type":"null"}],"title":"Storage Object Ids","description":"Existing storage object IDs to attach to the message.","examples":[[7442551216804781021,7442551216804781198],null]}},"type":"object","title":"ChatStreamBody","example":{"app_origin":{"app_history_part_id":"7442551216804781021","mcp_client_id":"7442550215703679004"},"chat_id":"7442550215703679004","media":["report.pdf","summary.txt"],"prompt":"Hello LIVOI, how can you help me?","storage_object_ids":["7442551216804781021","7442551216804781198"]}},"ChatSummary":{"properties":{"chat_id":{"type":"string","title":"Chat Id","examples":["7442550215703679873"]},"label_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Label Ids"},"platform":{"type":"string","title":"Platform"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"last_activity_at":{"type":"string","title":"Last Activity At"},"use_agent_reply":{"type":"boolean","title":"Use Agent Reply"},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id"},"latest_sequence":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Latest Sequence"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"additionalProperties":false,"type":"object","required":["chat_id","platform","last_activity_at","use_agent_reply","created_at","updated_at"],"title":"ChatSummary"},"ChatSummaryBody":{"properties":{"include_responses":{"type":"boolean","title":"Include Responses","description":"Include agent responses.","default":true,"examples":[true,false]},"include_prompts":{"type":"boolean","title":"Include Prompts","description":"Include user prompts.","default":true,"examples":[true,false]},"user_addition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Addition","description":"Additional summarization instruction.","examples":["Focus on open action items and unresolved customer questions."]}},"type":"object","title":"ChatSummaryBody","example":{"include_prompts":true,"include_responses":true,"user_addition":"Focus on open action items and unresolved customer questions."}},"ChatSummaryResponse":{"properties":{"summary":{"type":"string","title":"Summary","description":"Summary of the chat history.","default":"","examples":["The customer asked about invoice status and needs a follow-up by Friday."]}},"type":"object","title":"ChatSummaryResponse","example":{"summary":"The customer asked about invoice status and needs a follow-up by Friday."}},"ConfirmDatevInvoicePreviewUploadResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Success message.","examples":["DATEV invoice preview uploaded successfully."]},"preview_id":{"type":"string","title":"Preview Id","description":"Invoice preview ID.","examples":[7442551216804781021]},"registry_id":{"type":"string","title":"Registry Id","description":"DATEV invoice registry ID created for the upload event.","examples":[7442678451937742086]},"status":{"type":"string","const":"uploaded","title":"Status","description":"Resulting preview status.","examples":["uploaded"]},"upload_document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Document Id","description":"TRAFFIQX outbox document ID.","examples":["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01"]},"upload_href":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Href","description":"TRAFFIQX resource href.","examples":["/platform/v1/traffiqx-clients/1234567890123/outbox-documents/b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01"]},"uploaded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Uploaded At","description":"Upload timestamp.","examples":["2026-02-10T12:05:00+00:00"]}},"type":"object","required":["message","preview_id","registry_id","status"],"title":"ConfirmDatevInvoicePreviewUploadResponse","example":{"message":"DATEV invoice preview uploaded successfully.","preview_id":"7442551216804781021","registry_id":"7442678451937742086","status":"uploaded","upload_document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","upload_href":"/platform/v1/traffiqx-clients/1234567890123/outbox-documents/b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","uploaded_at":"2026-02-10T12:05:00+00:00"}},"ContentState":{"type":"string","enum":["prepared","awaiting_fetch","captured","blocked"]},"CopyCodeOTPParam":{"properties":{"type":{"type":"string","const":"COPY_CODE_OTP","title":"Type","description":"Runtime copy-code OTP button parameter type.","examples":["COPY_CODE_OTP"]},"otp":{"type":"string","minLength":1,"title":"Otp","description":"OTP value for copy-code OTP buttons.","examples":["576146","942147"]}},"additionalProperties":false,"type":"object","required":["type","otp"],"title":"CopyCodeOTPParam"},"CopyCodeParam":{"properties":{"type":{"type":"string","const":"COPY_CODE","title":"Type","description":"Runtime copy-code button parameter type.","examples":["COPY_CODE"]},"index":{"type":"integer","minimum":0.0,"title":"Index","description":"Zero-based button index.","examples":[0,1,2]},"coupon_code":{"type":"string","minLength":1,"title":"Coupon Code","description":"Coupon code value for copy-code buttons.","examples":["SPRING2026","WELCOME10"]}},"additionalProperties":false,"type":"object","required":["type","index","coupon_code"],"title":"CopyCodeParam"},"CreateAgentBody":{"properties":{"default_file_title_tags":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default File Title Tags","description":"Whether uploaded files should default to title tag extraction.","examples":[true,false,null]},"default_chat_summary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Chat Summary","description":"Whether chats should default to summary generation.","examples":[true,false,null]},"default_chat_title":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Chat Title","description":"Whether chats should default to generated titles.","examples":[true,false,null]},"default_transcribe":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Transcribe","description":"Whether uploaded audio should default to transcription.","examples":[true,false,null]},"default_embedding":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Embedding","description":"Whether uploaded content should default to embedding generation.","examples":[true,false,null]},"output_schema":{"type":"string","contentMediaType":"application/json","contentSchema":{"anyOf":[{"$ref":"#/components/schemas/ChatOutputSchema-Input"},{"type":"null"}]},"title":"Output Schema","description":"Output field definitions as JSON text. Omit or send null for text answers.","examples":["{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}"]},"name":{"type":"string","minLength":1,"title":"Name","description":"Agent display name.","examples":["Support Assistant","Invoice Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional short description of what the agent helps with.","examples":["Answers customer support questions and escalates billing issues."]},"llm_api_key":{"type":"string","minLength":1,"title":"Llm Api Key","description":"OpenAI API key used by the agent.","examples":["sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","sk_prod_7443128874215608479_pIZrSYz:yyyyyyyyy","sk_wb_7443128874215608651_ySpzIRZ:zzzzzzzzz","sk_test_7443128874215608790_RiZsYPz:aaaaaaaaa"]},"llm_custom_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Custom Url","description":"Optional custom OpenAI-compatible base URL.","examples":["https://api.openai.com/v1"]},"model":{"type":"string","minLength":1,"title":"Model","description":"Model used by the agent.","default":"gpt-6-luna","examples":["gpt-6-luna"]},"whatsapp_business_phone_number_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Whatsapp Business Phone Number Id","description":"Optional WhatsApp business phone number ID to assign to the agent.","examples":[7442551216804781021]},"agent_image":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Agent Image","description":"Optional uploaded profile image for the agent.","examples":["agent-profile.png",null]},"agent_image_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Image Id","description":"Existing agent image ID to reuse.","examples":[null,7443001845129083411]},"datev_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Datev Profile Id","description":"Optional DATEV profile ID to assign.","examples":[7442678451937742086]}},"additionalProperties":false,"type":"object","required":["name","llm_api_key"],"title":"CreateAgentBody","example":{"agent_image":"agent-profile.png","datev_profile_id":"7442678451937742086","default_chat_summary":true,"default_chat_title":true,"default_embedding":true,"default_file_title_tags":true,"default_transcribe":true,"description":"Answers customer support questions and escalates billing issues.","llm_api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","llm_custom_url":"https://api.openai.com/v1","model":"gpt-6-luna","name":"Support Assistant","output_schema":"{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}","whatsapp_business_phone_number_id":"7442551216804781021"}},"CreateAgentMcpClientBody":{"properties":{"mcp_server_id":{"type":"integer","title":"Mcp Server Id","description":"Installed MCP server to link.","examples":[7442551216804781198]},"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Tool prefix for this server on this agent. It must be unique per agent.","examples":["accounting"]},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the agent uses this server.","default":true}},"additionalProperties":false,"type":"object","required":["mcp_server_id","name"],"title":"CreateAgentMcpClientBody","example":{"mcp_server_id":"7442551216804781198","name":"accounting"}},"CreateAgentResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"Created agent ID.","examples":[7442550215703679004]},"agent_image_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Image Id","description":"Assigned agent image ID.","examples":[7443001845129083411]},"agent_spec":{"anyOf":[{"$ref":"#/components/schemas/AgentSpec"},{"type":"null"}],"description":"Agent specification."}},"type":"object","required":["agent_id"],"title":"CreateAgentResponse","example":{"agent_id":"7442550215703679004","agent_image_id":"7443001845129083411"}},"CreateApiKeyBody":{"properties":{"name":{"type":"string","title":"Name","description":"Display name of the API key.","examples":["Local Dev Key"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description.","examples":["Used for local development"]},"kind":{"$ref":"#/components/schemas/ApiKeyKind","description":"API key kind.","examples":["sk"]},"instance":{"$ref":"#/components/schemas/ApiKeyInstance","description":"API key instance.","examples":["dev"]},"tenant_bound":{"type":"boolean","title":"Tenant Bound","description":"Whether the API key is bound to a tenant.","default":true,"examples":[true,false]},"tenant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tenant Id","description":"Tenant ID for tenant-bound keys.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id","description":"Optional owner user ID. Omit to bind tenant-scoped keys to the current user; set null for tenant-only keys.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Optional expiration timestamp.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"Optional permissions.","examples":[["agents.read","agents.read.any","knowledgefile.read.granted"],["users.read","users.update","groups.read"],["roles.create","roles.update","roles.delete.any"],["agents.read.own","groups.read","users.read"]]}},"additionalProperties":false,"type":"object","required":["name","kind","instance"],"title":"CreateApiKeyBody","example":{"description":"Used for local development","expires_at":"2027-02-10T11:22:33Z","instance":"dev","kind":"sk","name":"Local Dev Key","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"tenant_bound":true,"tenant_id":"7442551216804781021","user_id":"7442550215703679004"}},"CreateApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Created API key ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"name":{"type":"string","title":"Name","description":"API key name.","examples":["Local Dev Key"]},"kind":{"$ref":"#/components/schemas/ApiKeyKind","description":"API key kind.","examples":["sk"]},"instance":{"$ref":"#/components/schemas/ApiKeyInstance","description":"API key instance.","examples":["dev"]},"api_key":{"type":"string","title":"Api Key","description":"Plaintext API key. Only returned once.","examples":["sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","sk_prod_7443128874215608479_pIZrSYz:yyyyyyyyy","sk_wb_7443128874215608651_ySpzIRZ:zzzzzzzzz","sk_test_7443128874215608790_RiZsYPz:aaaaaaaaa"]},"user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"User Id","description":"Owning user ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"tenant_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Tenant Id","description":"Bound tenant ID, if this is a tenant-scoped key.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Expiration timestamp.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether this API key can activate superuser authorization.","examples":[true,false]},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"Permissions.","examples":[["agents.read","agents.read.any","knowledgefile.read.granted"],["users.read","users.update","groups.read"],["roles.create","roles.update","roles.delete.any"],["agents.read.own","groups.read","users.read"]]}},"type":"object","required":["id","name","kind","instance","api_key","is_superuser"],"title":"CreateApiKeyResponse","example":{"api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","expires_at":"2027-02-10T11:22:33Z","id":"7442551216804781021","instance":"dev","is_superuser":true,"kind":"sk","name":"Local Dev Key","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"tenant_id":"7443001845129083411","user_id":"7442678451937742086"}},"CreateCalendarBody":{"properties":{"calendars":{"items":{"$ref":"#/components/schemas/CalendarCreateItem"},"type":"array","minItems":1,"title":"Calendars","description":"List of calendars to create."},"assigns":{"anyOf":[{"items":{"$ref":"#/components/schemas/CalendarAssignRequestBase"},"type":"array"},{"type":"null"}],"title":"Assigns","description":"Optional mapping of agents and calendar assignments to create immediately."}},"type":"object","required":["calendars"],"title":"CreateCalendarBody","example":{"assigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"calendars":[{"description":"Internal calendar for team meetings","link":"https://calendar.example.com/team","name":"Team","tags":["meeting","internal"]}]}},"CreateCalendarResponse":{"properties":{"created_calendars":{"additionalProperties":{"type":"string","examples":["7442550215703679873"]},"type":"object","title":"Created Calendars","description":"Mapping of created calendar names to their IDs.","examples":[{"Team":7442678451937742086},{"Dev":7442678451937742214,"Team":7442678451937742086}]},"assigns":{"anyOf":[{"items":{"$ref":"#/components/schemas/CalendarAssignResponseBase"},"type":"array"},{"type":"null"}],"title":"Assigns","description":"Mapping of agents and their assigned calendars or assignment error messages."}},"type":"object","required":["created_calendars"],"title":"CreateCalendarResponse","example":{"assigns":[{"agent_id":"7442550215703679004","calendar_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"error":"Agent not found: [744128060820239091]"}],"created_calendars":{"Team":"7442678451937742086"}}},"CreateCustomToolForAgentBody":{"properties":{"custom_tools":{"items":{"$ref":"#/components/schemas/AgentCustomToolBase"},"type":"array","minItems":1,"title":"Custom Tools","description":"Custom tools.","examples":[[]]}},"type":"object","required":["custom_tools"],"title":"CreateCustomToolForAgentBody","example":{"custom_tools":[]}},"CreateCustomToolForAgentResponse":{"properties":{"created_tools":{"items":{"$ref":"#/components/schemas/AgentCustomToolResponseBase"},"type":"array","title":"Created Tools","description":"Custom tools created for the agent.","examples":[[{"agent_tool_id":7442551216804781344,"api_url":"https://api.example.com/customers/{customer_id}","has_api_key":true,"http_method":"GET","input_parameters":["customer_id"],"max_retries":2,"tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"}]]}},"type":"object","required":["created_tools"],"title":"CreateCustomToolForAgentResponse","example":{"created_tools":[{"agent_tool_id":"7442551216804781344","api_url":"https://api.example.com/customers/{customer_id}","has_api_key":true,"http_method":"GET","input_parameters":["customer_id"],"max_retries":2,"tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"}]}},"CreateDatevProfileBody":{"properties":{"code":{"type":"string","title":"Code","description":"Authorization code from DATEV redirect","examples":["abc123"]},"code_verifier":{"type":"string","title":"Code Verifier","description":"PKCE code_verifier used in the authorization request","examples":["someRandomVerifier"]},"redirect_uri":{"type":"string","title":"Redirect Uri","description":"Redirect URI used in the authorization request","examples":["http://localhost"]},"profile_name":{"type":"string","title":"Profile Name","description":"Optional display name for this DATEV profile empty by default","default":"","examples":["Steuerberater"]}},"type":"object","required":["code","code_verifier","redirect_uri"],"title":"CreateDatevProfileBody","example":{"code":"abc123","code_verifier":"someRandomVerifier","profile_name":"Steuerberater","redirect_uri":"http://localhost"}},"CreateDatevProfileResponse":{"properties":{"id":{"type":"string","title":"Id","description":"DATEV profile ID","examples":[7442550215703679004]},"name":{"type":"string","title":"Name","description":"Human readable name for this DATEV connection","examples":["Steuerberater"]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Creation timestamp","examples":["2026-02-11T09:00:00+00:00"]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Access token expiration timestamp","examples":["2026-02-11T10:00:00+00:00"]},"refresh_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Refresh At","description":"Next required refresh for token","examples":["2026-03-13T09:00:00+00:00"]},"message":{"type":"string","title":"Message","description":"Success message","examples":["DATEV profile created successfully."]}},"type":"object","required":["id","name","message"],"title":"CreateDatevProfileResponse","example":{"created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","id":"7442550215703679004","message":"DATEV profile created successfully.","name":"Steuerberater","refresh_at":"2026-03-13T09:00:00+00:00"}},"CreateEmailOfficeIntegrationBody":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Whether recurring processing is enabled.","default":true,"examples":[true,false]},"include_filters":{"items":{"$ref":"#/components/schemas/EmailOfficeMessageFilter"},"type":"array","maxItems":100,"title":"Include Filters","description":"Sender or label filters that select messages for processing. Rules are combined with OR.","examples":[[{"sender_email":"sprizzy@p-cation.de"}],[{"label_name":"Invoices"}],[{"label_id":"Label_123"}]]},"exclude_filters":{"items":{"$ref":"#/components/schemas/EmailOfficeMessageFilter"},"type":"array","maxItems":100,"title":"Exclude Filters","description":"Sender or label filters that exclude messages. Exclusions take precedence over inclusions.","examples":[[{"sender_name":"Automated Notifications"}],[{"label_name":"Spam"}],[{"label_id":"CATEGORY_ID"}]]},"run_interval":{"type":"integer","maximum":2147483647.0,"exclusiveMinimum":0.0,"title":"Run Interval","description":"Number of run interval units between processing attempts.","default":15,"examples":[30,30,2,1]},"run_interval_unit":{"$ref":"#/components/schemas/EmailOfficeRunIntervalUnit","description":"Unit used for the recurring run interval.","default":"minutes","examples":["seconds","minutes","hours","days"]}},"additionalProperties":false,"type":"object","title":"CreateEmailOfficeIntegrationBody","example":{"enabled":true,"exclude_filters":[{"sender_name":"Automated Notifications"}],"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"run_interval":30,"run_interval_unit":"seconds"}},"CreateFoldersBody":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/FolderCreateItem"},"type":"array","minItems":1,"title":"Folders","description":"Prompt library folders to create in bulk.","examples":[[{"name":"Sales"},{"name":"Marketing"}],[{"name":"Support"}]]}},"type":"object","required":["folders"],"title":"CreateFoldersBody","example":{"folders":[{"name":"Sales"},{"name":"Marketing"}]}},"CreateFoldersResponse":{"properties":{"created_folders":{"additionalProperties":{"type":"string","examples":["7442550215703679873"]},"type":"object","title":"Created Folders","description":"Mapping of successfully created folder names to their identifiers.","examples":[{"Marketing":7442678451937742214,"Sales":7442678451937742086},{"Sales":7442678451937742086}]},"failed_folders":{"items":{"type":"string"},"type":"array","title":"Failed Folders","description":"Folders that failed to create.","examples":[[],["Marketing"]]}},"type":"object","required":["created_folders","failed_folders"],"title":"CreateFoldersResponse","example":{"created_folders":{"Marketing":"7442678451937742214","Sales":"7442678451937742086"},"failed_folders":[]}},"CreateGroupBody":{"properties":{"name":{"type":"string","title":"Name","description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional group description.","examples":["Support staff group."]}},"type":"object","required":["name"],"title":"CreateGroupBody","example":{"description":"Support staff group.","name":"Support Team"}},"CreateGroupResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Group ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"name":{"type":"string","title":"Name","description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Group description.","examples":["Support staff group."]}},"type":"object","required":["id","tenant_id","name"],"title":"CreateGroupResponse","example":{"description":"Support staff group.","id":"7442550215703679004","name":"Support Team","tenant_id":"7442551216804781021"}},"CreateItem":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Display name of the prompt entry.","examples":["Meeting follow-up","Customer onboarding","Incident summary"]},"content":{"type":"string","minLength":1,"title":"Content","description":"Prompt content to store in the prompt library.","examples":["Write a follow-up email for {customer_name} after meeting about {topic}. Use tone {tone}.","Draft an onboarding message for {customer_name} covering {product_area}.","Summarize the incident for {customer_name} including impact {impact_level}."]},"folder_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Folder Id","description":"Optional folder identifier used to place the prompt within the library.","examples":[744128060820239091]},"variable_json":{"additionalProperties":{"$ref":"#/components/schemas/VariableDefinition"},"type":"object","title":"Variable Json","description":"Optional variable definitions keyed by placeholder name used in the prompt content.","examples":[{"customer_name":{"description":"Name of the customer.","required":true},"tone":{"default":"professional","description":"Desired writing tone."},"topic":{"description":"Main topic to address.","required":true}},{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to introduce.","required":true}},{"customer_name":{"description":"Name of the customer.","required":true},"impact_level":{"default":"high","description":"Incident impact severity."}}]}},"type":"object","required":["name","content"],"title":"CreateItem","example":{"content":"Write a follow-up email for {customer_name} after meeting about {topic}. Use tone {tone}.","folder_id":"744128060820239091","name":"Meeting follow-up","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"tone":{"default":"professional","description":"Desired writing tone."},"topic":{"description":"Main topic to address.","required":true}}}},"CreateMcpServerBody":{"properties":{"catalog_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Id","description":"Catalog entry to install. Provide either this or a custom URL.","examples":["notion"]},"url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Url","description":"Custom remote streamable-HTTP or SSE MCP endpoint. Provide either this or a catalog ID.","examples":["https://mcp.example.com/mcp"]},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Display name of the server.","examples":["Accounting"]},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"HTTP headers sent to the MCP server. Values are never returned by the API.","examples":[{"Authorization":"Bearer mcp_token"}]},"enabled":{"type":"boolean","title":"Enabled","description":"Whether agents can use this server.","default":true},"auth_mode":{"anyOf":[{"$ref":"#/components/schemas/McpAuthMode"},{"type":"null"}],"description":"Registration uses the configured headers as a server-scoped service identity. User OAuth requires each user to authorize separately. LIVOI identity sends a short-lived token signed by LIVOI that names the calling user and is valid only for this server URL. Defaults to the catalog entry's first auth mode, or registration for a custom URL."},"include_instructions":{"type":"boolean","title":"Include Instructions","description":"Include instructions returned by the MCP server in the agent instructions.","default":false},"include_return_schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Return Schema","description":"Whether MCP tool return schemas are sent to the model. Null uses the default behavior."},"max_retries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Retries","description":"MCP tool retry limit. Null inherits the agent tool retry setting.","examples":[2]},"tool_error_behavior":{"$ref":"#/components/schemas/McpToolErrorBehavior","description":"How the agent handles an MCP tool error. failed returns a completed tool error to the model as the call result, retry asks the model to correct the call within the retry limit, and error stops the agent run. Protocol errors are retried unless the behavior is error.","default":"failed"},"init_timeout":{"type":"number","maximum":120.0,"exclusiveMinimum":0.0,"title":"Init Timeout","description":"Connection and initialization timeout in seconds.","default":5.0},"read_timeout":{"type":"number","maximum":3600.0,"exclusiveMinimum":0.0,"title":"Read Timeout","description":"Long-lived MCP connection read timeout in seconds.","default":300.0},"tool_policies":{"additionalProperties":{"$ref":"#/components/schemas/McpToolPolicy"},"propertyNames":{"$ref":"#/components/schemas/McpToolName"},"type":"object","title":"Tool Policies","description":"Tool policy overrides by tool name. They replace the catalog default for that tool.","examples":[{"delete_page":"block"}]}},"additionalProperties":false,"type":"object","required":["name"],"title":"CreateMcpServerBody","example":{"catalog_id":"notion","headers":{"Authorization":"Bearer mcp_token"},"max_retries":2,"name":"Accounting","tool_policies":{"delete_page":"block"},"url":"https://mcp.example.com/mcp"}},"CreatePhoneNumberBody":{"properties":{"waba_id":{"type":"string","title":"Waba Id","description":"WhatsApp business account ID","examples":["12345678901234567890"]},"phone_number_id":{"type":"string","title":"Phone Number Id","description":"Phone number ID","examples":["12345678901234567890"]},"business_id":{"type":"string","title":"Business Id","description":"Business ID","examples":["12345678901234567890"]},"code":{"type":"string","title":"Code","description":"Signup validation callback code","examples":["234632467"]}},"type":"object","required":["waba_id","phone_number_id","business_id","code"],"title":"CreatePhoneNumberBody","example":{"business_id":"12345678901234567890","code":"234632467","phone_number_id":"12345678901234567890","waba_id":"12345678901234567890"}},"CreatePhoneNumberResponse":{"properties":{"number_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number Status","description":"Phone number status","examples":["CONNECTED"]},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status","description":"WhatsApp business account review status","examples":["APPROVED"]},"webhook_subscribed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Subscribed","description":"Webhook subscription status","examples":["TRUE"]},"message":{"type":"string","title":"Message","description":"Success message","examples":["Phone number 12345678901234567890 created successfully!"]},"status":{"$ref":"#/components/schemas/PhoneNumberStatusBase","description":"Phone number status"},"next_step":{"type":"string","title":"Next Step","description":"Next step required to complete phone number registration","examples":["Register the phone number (no PIN required)"]},"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin","description":"Pin used for registration","default":"","examples":["123456"]},"whatsapp_business_phone_number_id":{"type":"string","title":"Whatsapp Business Phone Number Id","description":"ID of the created WhatsApp business phone number.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]}},"type":"object","required":["message","status","next_step","whatsapp_business_phone_number_id"],"title":"CreatePhoneNumberResponse","example":{"message":"Phone number 12345678901234567890 created successfully!","next_step":"Register the phone number (no PIN required)","number_status":"CONNECTED","pin":"123456","review_status":"APPROVED","status":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE"},"webhook_subscribed":"TRUE","whatsapp_business_phone_number_id":"7442550215703679004"}},"CreatePromptsBody":{"properties":{"prompts":{"items":{"$ref":"#/components/schemas/CreateItem"},"type":"array","minItems":1,"title":"Prompts","description":"Prompt entries to create in bulk.","examples":[[{"content":"Welcome to our platform! We are excited to have you onboard.","folder_id":null,"name":"Welcome message","variable_json":{}}],[{"content":"Please review the meeting notes attached above.","folder_id":7442678451937742086,"name":"Meeting follow-up","variable_json":{}}],[{"content":"Write a follow-up email for {customer_name} after meeting about {topic}. Use tone {tone}.","folder_id":7442678451937742086,"name":"Meeting follow-up","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"tone":{"default":"professional","description":"Desired writing tone."},"topic":{"description":"Main topic to address.","required":true}}}],[{"content":"Summarize the incident for {customer_name} including impact {impact_level}.","folder_id":null,"name":"Incident summary","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"impact_level":{"default":"high","description":"Incident impact severity."}}}],[{"content":"We value your feedback, {customer_name}! Please rate {product_area} on a scale of 1-5.","folder_id":7442678451937742214,"name":"Customer survey","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to review.","required":true}}},{"content":"Draft an onboarding message for {customer_name} covering {product_area}.","folder_id":7442678451937742214,"name":"Customer onboarding","variable_json":{"customer_name":{"description":"Name of the customer.","required":true},"product_area":{"description":"Product area to introduce.","required":true}}}]]}},"type":"object","required":["prompts"],"title":"CreatePromptsBody","example":{"prompts":[{"content":"Welcome to our platform! We are excited to have you onboard.","folder_id":null,"name":"Welcome message","variable_json":{}}]}},"CreatePromptsResponse":{"properties":{"created_prompts":{"additionalProperties":{"type":"string","examples":["7442550215703679873"]},"type":"object","title":"Created Prompts","description":"Mapping of successfully created prompt names to their identifiers.","examples":[{"Meeting follow-up":7442550215703679004},{"Customer onboarding":7442550215703679137,"Meeting follow-up":7442550215703679004}]},"failed_prompts":{"items":{"type":"string"},"type":"array","title":"Failed Prompts","description":"Prompt names that failed to create.","examples":[["Incident summary"],["Customer onboarding","Incident summary"]]}},"type":"object","required":["created_prompts","failed_prompts"],"title":"CreatePromptsResponse","example":{"created_prompts":{"Meeting follow-up":"7442550215703679004"},"failed_prompts":["Incident summary"]}},"CreateResourceGrantBody":{"properties":{"resource_kind":{"type":"string","title":"Resource Kind","description":"Resource kind / table name.","examples":["knowledgefile","storage_objects","agents","chats","datev_profiles"]},"resource_id":{"type":"integer","title":"Resource Id","description":"Resource ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"subject_kind":{"$ref":"#/components/schemas/SubjectKind","description":"Grant subject kind.","examples":["user","group","role","api_key"]},"subject_id":{"type":"integer","title":"Subject Id","description":"Grant subject ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"permission":{"type":"string","title":"Permission","description":"Granted permission string.","examples":["agents.read.granted","storage_objects.read.granted","chats.update.granted","datev_profiles.access_manage.granted"]}},"type":"object","required":["resource_kind","resource_id","subject_kind","subject_id","permission"],"title":"CreateResourceGrantBody","example":{"permission":"agents.read.granted","resource_id":"7442551216804781021","resource_kind":"knowledgefile","subject_id":"7442678451937742086","subject_kind":"user"}},"CreateResourceGrantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Resource grant ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"resource_kind":{"type":"string","title":"Resource Kind","description":"Resource kind / table name.","examples":["knowledgefile","storage_objects","agents","chats","datev_profiles"]},"resource_id":{"type":"string","title":"Resource Id","description":"Resource ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"subject_kind":{"$ref":"#/components/schemas/SubjectKind","description":"Grant subject kind.","examples":["user","group","role","api_key"]},"subject_id":{"type":"string","title":"Subject Id","description":"Grant subject ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"permission":{"type":"string","title":"Permission","description":"Granted permission string.","examples":["agents.read.granted","storage_objects.read.granted","chats.update.granted","datev_profiles.access_manage.granted"]}},"type":"object","required":["id","tenant_id","resource_kind","resource_id","subject_kind","subject_id","permission"],"title":"CreateResourceGrantResponse","example":{"id":"7443001845129083411","permission":"agents.read.granted","resource_id":"7442551216804781021","resource_kind":"knowledgefile","subject_id":"7442678451937742086","subject_kind":"user","tenant_id":"7442550215703679004"}},"CreateRoleBody":{"properties":{"name":{"type":"string","title":"Name","description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional role description.","examples":["Can read chats and files.","Handles advanced support cases.","Coordinates tenant operations.","Handles day-to-day platform tasks."]}},"type":"object","required":["name"],"title":"CreateRoleBody","example":{"description":"Can read chats and files.","name":"Administrator"}},"CreateRoleResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Role ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Role description.","examples":["Can manage tenant resources.","Supervises support operations.","Handles day-to-day platform tasks.","Can read and write files."]}},"type":"object","required":["id","tenant_id","name"],"title":"CreateRoleResponse","example":{"description":"Can manage tenant resources.","id":"7443001845129083411","name":"Administrator","tenant_id":"7442550215703679004"}},"CreateTenantBody":{"properties":{"name":{"type":"string","title":"Name","description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"]},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["name"],"title":"CreateTenantBody","example":{"domain":"sprizzy.de","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"}},"CreateTenantMembershipBody":{"properties":{"user_id":{"type":"integer","title":"User Id","description":"User ID to add.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]}},"type":"object","required":["user_id"],"title":"CreateTenantMembershipBody","example":{"user_id":"7442678451937742086"}},"CreateTenantMembershipResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Membership ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the membership is active.","examples":[true,false]},"joined_at":{"type":"string","format":"date-time","title":"Joined At","description":"Joined timestamp.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]},"left_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Left At","description":"Left timestamp.","examples":["2027-12-01T07:55:09Z","2028-08-14T13:20:48Z","2029-05-22T21:44:30Z","2030-10-30T02:11:16Z"]}},"type":"object","required":["id","tenant_id","user_id","is_active","joined_at"],"title":"CreateTenantMembershipResponse","example":{"id":"7442678451937742086","is_active":true,"joined_at":"2027-02-10T11:22:33Z","left_at":"2027-12-01T07:55:09Z","tenant_id":"7442550215703679004","user_id":"7442551216804781021"}},"CreateTenantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"]},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["id","name"],"title":"CreateTenantResponse","example":{"domain":"sprizzy.de","id":"7442550215703679004","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"}},"CreateUserBody":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the user is active.","default":true,"examples":[true,false]}},"additionalProperties":false,"type":"object","title":"CreateUserBody","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","is_active":true,"last_name":"Musterassistent","phone_number":"+491701234567"}},"CreateUserResponse":{"properties":{"id":{"type":"string","title":"Id","description":"User ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the user is active.","examples":[true,false]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether the user is a superuser.","examples":[true,false]}},"type":"object","required":["id","is_active","is_superuser"],"title":"CreateUserResponse","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","full_name":"Sprizzy Musterassistent","id":"7442550215703679004","is_active":true,"is_superuser":true,"last_name":"Musterassistent","phone_number":"+491701234567"}},"CreateWhatsAppTemplateResponse":{"properties":{"template_id":{"type":"string","title":"Template Id","description":"Local template ID.","examples":[7442678451937742086]},"whatsapp_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Template Id","description":"Meta WhatsApp template ID.","examples":["123456789012345"]},"template_status":{"$ref":"#/components/schemas/TemplateStatus","description":"Template review status returned by Meta.","examples":["PENDING"]},"template_category":{"anyOf":[{"$ref":"#/components/schemas/TemplateCategory"},{"type":"null"}],"description":"Template category returned by Meta.","examples":["UTILITY"]}},"type":"object","required":["template_id","template_status"],"title":"CreateWhatsAppTemplateResponse","example":{"template_category":"UTILITY","template_id":"7442678451937742086","template_status":"PENDING","whatsapp_template_id":"123456789012345"}},"CurrencyTextValue":{"properties":{"type":{"type":"string","const":"CURRENCY","title":"Type","description":"Structured currency text value type.","examples":["CURRENCY"]},"fallback_value":{"type":"string","minLength":1,"title":"Fallback Value","description":"Human-readable fallback value for currency template params.","examples":["49,90 EUR","129,90 USD"]},"code":{"type":"string","minLength":1,"title":"Code","description":"ISO currency code.","examples":["EUR","USD"]},"amount_1000":{"type":"integer","title":"Amount 1000","description":"Amount in thousandths used by WhatsApp currency params.","examples":[49900,129900]}},"additionalProperties":false,"type":"object","required":["type","fallback_value","code","amount_1000"],"title":"CurrencyTextValue"},"CustomToolConditionPath":{"items":{"anyOf":[{"type":"string"},{"type":"integer","minimum":0.0}]},"type":"array","maxItems":16,"minItems":1},"CustomToolEmptyListCondition":{"properties":{"path":{"$ref":"#/components/schemas/CustomToolConditionPath"},"operator":{"type":"string","const":"absent_or_empty_list","title":"Operator"}},"additionalProperties":false,"type":"object","required":["path","operator"],"title":"CustomToolEmptyListCondition"},"CustomToolEqualsCondition":{"properties":{"path":{"$ref":"#/components/schemas/CustomToolConditionPath"},"operator":{"type":"string","const":"equals","title":"Operator"},"value":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value"}},"additionalProperties":false,"type":"object","required":["path","operator","value"],"title":"CustomToolEqualsCondition"},"CustomToolHttpHeader":{"properties":{"name":{"type":"string","title":"Name"},"value":{"type":"string","title":"Value"}},"additionalProperties":false,"type":"object","required":["name","value"],"title":"CustomToolHttpHeader"},"CustomToolInputSchema-Input":{"properties":{"parameters":{"items":{"$ref":"#/components/schemas/CustomToolParameter-Input"},"type":"array","title":"Parameters"}},"additionalProperties":false,"type":"object","title":"CustomToolInputSchema"},"CustomToolInputSchema-Output":{"properties":{"parameters":{"items":{"$ref":"#/components/schemas/CustomToolParameter-Output"},"type":"array","title":"Parameters"}},"additionalProperties":false,"type":"object","title":"CustomToolInputSchema"},"CustomToolParameter-Input":{"properties":{"type":{"type":"string","enum":["string","integer","number","boolean","object","array"],"title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldSchema-Input"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/components/schemas/ValueSchema-Input"},{"type":"null"}]},"name":{"type":"string","minLength":1,"title":"Name"},"required":{"type":"boolean","title":"Required","default":true},"default":{"$ref":"#/components/schemas/JsonValue"},"location":{"type":"string","enum":["path","query","body"],"title":"Location"}},"additionalProperties":false,"type":"object","required":["type","name","location"],"title":"CustomToolParameter"},"CustomToolParameter-Output":{"properties":{"type":{"type":"string","enum":["string","integer","number","boolean","object","array"],"title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldSchema-Output"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/components/schemas/ValueSchema-Output"},{"type":"null"}]},"name":{"type":"string","minLength":1,"title":"Name"},"required":{"type":"boolean","title":"Required","default":true},"default":{"$ref":"#/components/schemas/JsonValue"},"location":{"type":"string","enum":["path","query","body"],"title":"Location"}},"additionalProperties":false,"type":"object","required":["type","name","location"],"title":"CustomToolParameter"},"CustomToolRequestConfig":{"properties":{"api_url":{"type":"string","minLength":1,"title":"Api Url"},"http_method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Http Method"},"api_key_location":{"type":"string","enum":["header","query"],"title":"Api Key Location","default":"header"},"auth_param":{"type":"string","minLength":1,"title":"Auth Param","default":"Authorization"},"api_key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Prefix","default":"Bearer"},"additional_headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Additional Headers"},"unwrap_single_body_parameter":{"type":"boolean","title":"Unwrap Single Body Parameter","default":false},"timeout_seconds":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Timeout Seconds"},"body_template":{"$ref":"#/components/schemas/JsonValue","description":"Optional JSON body template. A value written as {\"$livoi_input\": \"<body parameter name>\"} is replaced with that parameter's validated value. Every other value is sent exactly as written and is not part of the agent's input schema, so the agent cannot change it. Every body parameter must be referenced, and unwrap_single_body_parameter must be false. When a template is set, an optional input that the agent omits or sends as null uses its default; without a default, the object member that references it is removed. On update, omit this field to keep the stored template or send null to remove it. Do not put credentials here; use api_key.","examples":[{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10}]}},"additionalProperties":false,"type":"object","required":["api_url","http_method"],"title":"CustomToolRequestConfig"},"CustomToolRequestSnapshot":{"properties":{"method":{"type":"string","title":"Method"},"url":{"type":"string","title":"Url"},"url_truncated":{"type":"boolean","title":"Url Truncated","default":false},"headers":{"items":{"$ref":"#/components/schemas/CustomToolHttpHeader"},"type":"array","title":"Headers"},"headers_truncated":{"type":"boolean","title":"Headers Truncated","default":false},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_size_bytes":{"type":"integer","minimum":0.0,"title":"Body Size Bytes","default":0},"body_truncated":{"type":"boolean","title":"Body Truncated","default":false},"timeout_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timeout Seconds"}},"additionalProperties":false,"type":"object","required":["method","url","headers"],"title":"CustomToolRequestSnapshot"},"CustomToolResponseConfig":{"properties":{"success_condition":{"anyOf":[{"$ref":"#/components/schemas/CustomToolSuccessCondition"},{"type":"null"}],"description":"Optional check on the parsed upstream response, after HTTP error handling. Paths contain object keys or nonnegative array indexes. equals compares scalar values without coercion; integers and floats compare numerically, but booleans never equal numbers. absent_or_empty_list accepts a missing path or an empty list; other types are unexpected responses. An unmet or unevaluable condition returns a terminal failure. It does not trigger automatic retries.","examples":[{"operator":"absent_or_empty_list","path":["errors"]}]}},"additionalProperties":false,"type":"object","title":"CustomToolResponseConfig"},"CustomToolSuccessCondition":{"oneOf":[{"$ref":"#/components/schemas/CustomToolEqualsCondition"},{"$ref":"#/components/schemas/CustomToolEmptyListCondition"}],"discriminator":{"propertyName":"operator","mapping":{"absent_or_empty_list":"#/components/schemas/CustomToolEmptyListCondition","equals":"#/components/schemas/CustomToolEqualsCondition"}}},"CustomToolTestResponse":{"properties":{"status_code":{"type":"integer","title":"Status Code"},"headers":{"items":{"$ref":"#/components/schemas/CustomToolHttpHeader"},"type":"array","title":"Headers"},"headers_truncated":{"type":"boolean","title":"Headers Truncated","default":false},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_size_bytes":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Body Size Bytes"},"body_truncated":{"type":"boolean","title":"Body Truncated","default":false}},"additionalProperties":false,"type":"object","required":["status_code","headers"],"title":"CustomToolTestResponse"},"DateTimeTextValue":{"properties":{"type":{"type":"string","const":"DATE_TIME","title":"Type","description":"Structured date-time text value type.","examples":["DATE_TIME"]},"fallback_value":{"type":"string","minLength":1,"title":"Fallback Value","description":"Fallback text shown when the client cannot localize the date/time value.","examples":["Tuesday","2026-05-13 14:30"]}},"additionalProperties":false,"type":"object","required":["type","fallback_value"],"title":"DateTimeTextValue"},"DatevInvoiceDefaultsAddress":{"properties":{"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street","description":"Seller street address."},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code","description":"Seller postal code."},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"Seller city."},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code","description":"Seller ISO country code (e.g. DE)."}},"type":"object","title":"DatevInvoiceDefaultsAddress"},"DatevInvoiceDefaultsContact":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Seller contact name."},"telephone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Telephone","description":"Seller contact phone number."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Seller contact email address."}},"type":"object","title":"DatevInvoiceDefaultsContact"},"DatevInvoiceDefaultsEndpoint":{"properties":{"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value","description":"Seller electronic endpoint value (e.g. email)."},"scheme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheme Id","description":"Endpoint scheme ID (e.g. \"EM\")."}},"type":"object","title":"DatevInvoiceDefaultsEndpoint"},"DatevInvoiceDefaultsPatch":{"properties":{"currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency Code","description":"Default currency code (e.g. \"EUR\")."},"invoice_type_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Type Code","description":"Default invoice type code (e.g. \"380\")."},"customization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customization Id","description":"Default customization ID."},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id","description":"Default profile ID."},"payment_means_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Means Code","description":"Default payment means code (e.g. \"58\")."},"payee_iban":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payee Iban","description":"Default payee IBAN."},"due_days":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Due Days","description":"Default due date offset in days."},"seller":{"anyOf":[{"$ref":"#/components/schemas/DatevInvoiceDefaultsSeller"},{"type":"null"}],"description":"Default seller object."}},"type":"object","title":"DatevInvoiceDefaultsPatch","example":{"seller":{"address":{},"contact":{},"endpoint":{}}}},"DatevInvoiceDefaultsSeller":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Seller company/legal name."},"vat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vat Id","description":"Seller VAT ID."},"tax_registration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Registration Id","description":"Seller tax registration ID."},"legal_registration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Registration Id","description":"Seller legal registration ID."},"identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identifier","description":"Seller identifier."},"endpoint":{"anyOf":[{"$ref":"#/components/schemas/DatevInvoiceDefaultsEndpoint"},{"type":"null"}],"description":"Seller endpoint defaults."},"address":{"anyOf":[{"$ref":"#/components/schemas/DatevInvoiceDefaultsAddress"},{"type":"null"}],"description":"Seller address defaults."},"contact":{"anyOf":[{"$ref":"#/components/schemas/DatevInvoiceDefaultsContact"},{"type":"null"}],"description":"Seller contact defaults."}},"type":"object","title":"DatevInvoiceDefaultsSeller","example":{"address":{},"contact":{},"endpoint":{}}},"DatevInvoicePreviewDetailData":{"properties":{"id":{"type":"string","title":"Id","description":"Invoice preview ID","examples":[7442551216804781021]},"datev_profile_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Datev Profile Id","description":"DATEV profile ID used for upload","examples":[7442550215703679004]},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number","description":"Invoice number from the draft","examples":["RE-2026-001"]},"traffiqx_id":{"type":"string","title":"Traffiqx Id","description":"TRAFFIQX client ID","examples":["1234567890123"]},"status":{"type":"string","enum":["pending","upload_failed"],"title":"Status","description":"Invoice preview status.","examples":["pending"]},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp","examples":["2026-02-10T12:00:00+00:00"]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp","examples":["2026-02-10T12:00:00+00:00"]},"upload_document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Document Id","description":"TRAFFIQX outbox document ID after confirmed upload"},"upload_href":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Href","description":"TRAFFIQX resource href after confirmed upload"},"upload_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Error","description":"Error message of the last failed upload attempt"},"totals":{"additionalProperties":true,"type":"object","title":"Totals","description":"Calculated invoice totals.","examples":[{"currency":"EUR","gross_total":"119.00","net_total":"100.00","tax_total":"19.00"}]},"xml_content":{"type":"string","title":"Xml Content","description":"Generated invoice XML.","examples":["<?xml version=\"1.0\" encoding=\"utf-8\"?>"]}},"type":"object","required":["id","traffiqx_id","status","created_at","totals","xml_content"],"title":"DatevInvoicePreviewDetailData","example":{"created_at":"2026-02-10T12:00:00+00:00","datev_profile_id":"7442550215703679004","id":"7442551216804781021","invoice_number":"RE-2026-001","status":"pending","totals":{"currency":"EUR","gross_total":"119.00","net_total":"100.00","tax_total":"19.00"},"traffiqx_id":"1234567890123","updated_at":"2026-02-10T12:00:00+00:00","xml_content":"<?xml version=\"1.0\" encoding=\"utf-8\"?>"}},"DatevInvoicePreviewItem":{"properties":{"id":{"type":"string","title":"Id","description":"Invoice preview ID","examples":[7442551216804781021]},"datev_profile_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Datev Profile Id","description":"DATEV profile ID used for upload","examples":[7442550215703679004]},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number","description":"Invoice number from the draft","examples":["RE-2026-001"]},"traffiqx_id":{"type":"string","title":"Traffiqx Id","description":"TRAFFIQX client ID","examples":["1234567890123"]},"status":{"type":"string","enum":["pending","upload_failed"],"title":"Status","description":"Invoice preview status.","examples":["pending"]},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp","examples":["2026-02-10T12:00:00+00:00"]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp","examples":["2026-02-10T12:00:00+00:00"]},"upload_document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Document Id","description":"TRAFFIQX outbox document ID after confirmed upload"},"upload_href":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Href","description":"TRAFFIQX resource href after confirmed upload"},"upload_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Error","description":"Error message of the last failed upload attempt"}},"type":"object","required":["id","traffiqx_id","status","created_at"],"title":"DatevInvoicePreviewItem","example":{"created_at":"2026-02-10T12:00:00+00:00","datev_profile_id":"7442550215703679004","id":"7442551216804781021","invoice_number":"RE-2026-001","status":"pending","traffiqx_id":"1234567890123","updated_at":"2026-02-10T12:00:00+00:00"}},"DatevInvoiceRegistryArchiveBulkItem":{"properties":{"registry_id":{"type":"string","title":"Registry Id","description":"DATEV invoice registry ID from the request.","examples":[7442678451937742214]},"status":{"type":"string","enum":["ok","not_found","not_uploaded","archive_disabled","archive_failed","archive_unavailable","archive_missing","archive_read_failed","archive_invalid_json","response_size_limit_exceeded"],"title":"Status","description":"Per-item result status.","examples":["ok"]},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional detail message for non-ok statuses."},"archive_json":{"anyOf":[{},{"type":"null"}],"title":"Archive Json","description":"Archived outgoing invoice JSON payload.","examples":[{"invoice_number":"RE-2026-001"},{"kind":"datev_outgoing_invoice_upload"}]},"archive_content_encoding":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archive Content Encoding","description":"Stored archive encoding/type (typically 'json').","examples":["json"]},"archive_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Archive Size Bytes","description":"Archive object size in bytes.","examples":[128]}},"type":"object","required":["registry_id","status"],"title":"DatevInvoiceRegistryArchiveBulkItem","example":{"archive_content_encoding":"json","archive_json":{"invoice_number":"RE-2026-001"},"archive_size_bytes":128,"registry_id":"7442678451937742214","status":"ok"}},"DatevProfileListItem":{"properties":{"id":{"type":"string","title":"Id","description":"DATEV profile ID","examples":[7442550215703679004]},"name":{"type":"string","title":"Name","description":"Human readable name for this DATEV connection","examples":["Steuerberater"]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Creation timestamp","examples":["2026-02-11T09:00:00+00:00"]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Access token expiration timestamp","examples":["2026-02-11T10:00:00+00:00"]},"refresh_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Refresh At","description":"Next required refresh for token","examples":["2026-03-13T09:00:00+00:00"]},"revoked":{"type":"boolean","title":"Revoked","description":"Whether profile access has been revoked.","examples":[false]},"tokens_expired":{"type":"boolean","title":"Tokens Expired","description":"Whether both access and refresh tokens are expired.","examples":[false]},"assigned_agent_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Assigned Agent Ids","description":"Agent IDs assigned to this DATEV profile.","examples":[[7442551216804781198]]},"assigned_agent_count":{"type":"integer","title":"Assigned Agent Count","description":"Number of agents assigned to this DATEV profile.","examples":[1]}},"type":"object","required":["id","name","revoked","tokens_expired","assigned_agent_ids","assigned_agent_count"],"title":"DatevProfileListItem","example":{"assigned_agent_count":1,"assigned_agent_ids":["7442551216804781198"],"created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","id":"7442550215703679004","name":"Steuerberater","refresh_at":"2026-03-13T09:00:00+00:00","revoked":false,"tokens_expired":false}},"DefaultConfigurationBody":{"properties":{"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference","description":"Filter by reference table name.","examples":["agent_tools"]},"function":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Function","description":"Filter by function title.","examples":["rag_search_tool"]}},"type":"object","title":"DefaultConfigurationBody","example":{"function":"rag_search_tool","reference":"agent_tools"}},"DefaultConfigurationResponse":{"properties":{"configurations":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Configurations","description":"Default configurations.","examples":[[{"function":"rag_search_tool","meta":{"answer_validation_mode":"disabled","fetch_k":50,"history_visibility":{"model_visible":true,"user_visible":true},"limit":10,"max_passage_tokens":450,"max_response_content_tokens":null,"min_similarity":null,"source_evidence_mode":"on_demand"},"reference":"agent_tools"}]]}},"type":"object","required":["configurations"],"title":"DefaultConfigurationResponse","example":{"configurations":[{"function":"rag_search_tool","meta":{"answer_validation_mode":"disabled","fetch_k":50,"history_visibility":{"model_visible":true,"user_visible":true},"limit":10,"max_passage_tokens":450,"max_response_content_tokens":null,"min_similarity":null,"source_evidence_mode":"on_demand"},"reference":"agent_tools"}]}},"DeleteAgentMcpClientResponse":{"properties":{"status":{"type":"string","title":"Status","examples":["MCP client deleted successfully."]}},"type":"object","required":["status"],"title":"DeleteAgentMcpClientResponse","example":{"status":"MCP client deleted successfully."}},"DeleteAgentProfileImagesBody":{"properties":{"agent_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true},{"type":"null"}],"title":"Agent Ids","description":"Agent IDs whose profile images should be removed.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]},"agent_image_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true,"title":"Agent Image Ids","description":"Agent image IDs to delete.","examples":[[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]]}},"type":"object","required":["agent_image_ids"],"title":"DeleteAgentProfileImagesBody","example":{"agent_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"agent_image_ids":["7443001845129083597","7443001845129083742","7443001845129083880","7443001845129083411"]}},"DeleteAgentProfileImagesResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Profile image deletion status message.","examples":["Deleted 2 agent profile images."]},"updated_agent_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Updated Agent Ids","description":"Agent IDs updated after image deletion.","examples":[[7442550215703679004,7442550215703679137]]},"deleted_image_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Deleted Image Ids","description":"Deleted agent image IDs.","examples":[[7443001845129083411,7443001845129083597]]}},"type":"object","required":["status"],"title":"DeleteAgentProfileImagesResponse","example":{"deleted_image_ids":["7443001845129083411","7443001845129083597"],"status":"Deleted 2 agent profile images.","updated_agent_ids":["7442550215703679004","7442550215703679137"]}},"DeleteAgentResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Deletion status message.","examples":["Agent deleted successfully."]}},"type":"object","required":["status"],"title":"DeleteAgentResponse","example":{"status":"Agent deleted successfully."}},"DeleteAgentToolsBody":{"properties":{"function_names":{"items":{"type":"string"},"type":"array","title":"Function Names","description":"Built-in tool function names to seed for the agent.","examples":[["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]]}},"type":"object","required":["function_names"],"title":"DeleteAgentToolsBody","example":{"function_names":["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]}},"DeleteAgentToolsResponse":{"properties":{"deleted_count_message":{"type":"string","title":"Deleted Count Message","description":"Summary of deleted agent tools.","examples":["Deleted 2 tools."]}},"type":"object","required":["deleted_count_message"],"title":"DeleteAgentToolsResponse","example":{"deleted_count_message":"Deleted 2 tools."}},"DeleteApiKeyResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"DeleteApiKeyResponse","example":{"success":true}},"DeleteCalendarResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Summary message.","examples":["Successfully deleted calendar 7442550215703679004"]},"calendar_id":{"type":"string","title":"Calendar Id","description":"ID of the deleted calendar.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]}},"type":"object","required":["message","calendar_id"],"title":"DeleteCalendarResponse","example":{"calendar_id":"7442550215703679004","message":"Successfully deleted calendar 7442550215703679004"}},"DeleteDatevInvoicePreviewResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Success message.","examples":["DATEV invoice preview deleted successfully."]},"preview_id":{"type":"string","title":"Preview Id","description":"Invoice preview ID.","examples":[7442551216804781021]},"status":{"type":"string","const":"deleted","title":"Status","description":"Resulting preview status.","examples":["deleted"]},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Deletion timestamp.","examples":["2026-02-10T12:10:00+00:00"]}},"type":"object","required":["message","preview_id","status"],"title":"DeleteDatevInvoicePreviewResponse","example":{"deleted_at":"2026-02-10T12:10:00+00:00","message":"DATEV invoice preview deleted successfully.","preview_id":"7442551216804781021","status":"deleted"}},"DeleteDatevProfileBody":{"properties":{"datev_profile_ids":{"items":{"type":"integer"},"type":"array","title":"Datev Profile Ids","description":"DATEV profile IDs","examples":[[7442550215703679137]]}},"type":"object","required":["datev_profile_ids"],"title":"DeleteDatevProfileBody","example":{"datev_profile_ids":["7442550215703679137"]}},"DeleteDatevProfileResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Success message","examples":["DATEV profiles deleted successfully."]},"missing_ids":{"anyOf":[{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},{"type":"null"}],"title":"Missing Ids","description":"List of DATEV profile IDs that were not found"}},"type":"object","required":["message"],"title":"DeleteDatevProfileResponse","example":{"message":"DATEV profiles deleted successfully."}},"DeleteEmailOfficeIntegrationResponse":{"properties":{"status":{"type":"string","title":"Status","examples":["Email-to-Office integration deleted successfully."]}},"type":"object","required":["status"],"title":"DeleteEmailOfficeIntegrationResponse","example":{"status":"Email-to-Office integration deleted successfully."}},"DeleteFoldersBody":{"properties":{"folder_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true,"title":"Folder Ids","description":"Identifiers of prompt library folders to delete; Important: Deleting a folder also deletes all prompts contained in that folder.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412,744128060820239091],[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]]}},"type":"object","required":["folder_ids"],"title":"DeleteFoldersBody","example":{"folder_ids":["7442550215703679412","7442550215703679137","744128060820239091","7442550215703679284","7442550215703679004"]}},"DeleteFoldersResponse":{"properties":{"deleted_folder_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Deleted Folder Ids","description":"Identifiers of prompt library folders deleted successfully; Contained prompts are deleted as part of the same operation.","examples":[[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520],[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]]},"missing_folder_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Missing Folder Ids","description":"Identifiers of requested prompt library folders that were not found and therefore not deleted.","examples":[[744128060820239091],[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]}},"type":"object","required":["deleted_folder_ids","missing_folder_ids"],"title":"DeleteFoldersResponse","example":{"deleted_folder_ids":["7442678451937742086","7442678451937742214","7442678451937742389","7442678451937742520"],"missing_folder_ids":["744128060820239091"]}},"DeleteGroupResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"DeleteGroupResponse","example":{"success":true}},"DeleteIntegrationIdentityResponse":{"properties":{"status":{"type":"string","title":"Status","examples":["Integration identity deleted successfully."]}},"type":"object","required":["status"],"title":"DeleteIntegrationIdentityResponse","example":{"status":"Integration identity deleted successfully."}},"DeleteMcpServerResponse":{"properties":{"status":{"type":"string","title":"Status","examples":["MCP server deleted successfully."]}},"type":"object","required":["status"],"title":"DeleteMcpServerResponse","example":{"status":"MCP server deleted successfully."}},"DeletePromptsBody":{"properties":{"prompt_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true,"title":"Prompt Ids","description":"Identifiers of prompt entries to delete.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412,744128060820239091],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","required":["prompt_ids"],"title":"DeletePromptsBody","example":{"prompt_ids":["7442550215703679412","7442550215703679137","744128060820239091","7442550215703679284","7442550215703679004"]}},"DeletePromptsResponse":{"properties":{"deleted_prompt_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Deleted Prompt Ids","description":"Identifiers of prompt entries deleted successfully.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]},"missing_prompt_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Missing Prompt Ids","description":"Identifiers of requested prompt entries that were not found and therefore not deleted.","examples":[[744128060820239091],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","required":["deleted_prompt_ids","missing_prompt_ids"],"title":"DeletePromptsResponse","example":{"deleted_prompt_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"missing_prompt_ids":["744128060820239091"]}},"DeleteResourceGrantResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Operation result.","default":true,"examples":[true]}},"type":"object","title":"DeleteResourceGrantResponse","example":{"success":true}},"DeleteRoleResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Operation result.","default":true,"examples":[true]}},"type":"object","title":"DeleteRoleResponse","example":{"success":true}},"DeleteTenantMembershipResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"DeleteTenantMembershipResponse","example":{"success":true}},"DeleteTenantResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"DeleteTenantResponse","example":{"success":true}},"DeleteWhatsAppTemplateBody":{"properties":{"template_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true,"title":"Template Ids","description":"Local template IDs to delete.","examples":[[7442678451937742086,7442678451937742214]]}},"type":"object","required":["template_ids"],"title":"DeleteWhatsAppTemplateBody","example":{"template_ids":["7442678451937742086","7442678451937742214"]}},"DeleteWhatsAppTemplateResponse":{"properties":{"requested_count":{"type":"integer","title":"Requested Count","description":"Number of requested template deletions.","examples":[1]},"deleted_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Deleted Ids","description":"Deleted local template IDs.","examples":[[7442678451937742086]]},"deleted_count":{"type":"integer","title":"Deleted Count","description":"Number of deleted templates.","examples":[1]},"failed_ids":{"items":{"$ref":"#/components/schemas/FailedDeletionDetail"},"type":"array","title":"Failed Ids","description":"Templates that could not be deleted."},"failed_count":{"type":"integer","title":"Failed Count","description":"Number of failed deletions.","examples":[0]}},"type":"object","required":["requested_count","deleted_count","failed_count"],"title":"DeleteWhatsAppTemplateResponse","example":{"deleted_count":1,"deleted_ids":["7442678451937742086"],"failed_count":0,"failed_ids":[{"error_message":"Template is still pending review.","template_id":"7442678451937742086"}],"requested_count":1}},"DynamicQueryAttributesResponse":{"properties":{"attributes":{"items":{"type":"string"},"type":"array","title":"Attributes","description":"Available attributes for the specified model.","examples":[["id","username","email"]]}},"type":"object","required":["attributes"],"title":"DynamicQueryAttributesResponse","example":{"attributes":["id","username","email"]}},"DynamicQueryBodyWithPage":{"properties":{"query_model":{"type":"string","minLength":1,"title":"Query Model","description":"Table name to query.","examples":["users"]},"query_attributes":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"prefixItems":[{"type":"string"},{"type":"string"}],"type":"array","maxItems":2,"minItems":2}]},"type":"array","maxItems":500},{"type":"null"}],"title":"Query Attributes","description":"Attributes to include in the result. Leave empty to select all. Supported aggregations: ARRAY_AGG, AVG, BOOL_AND, BOOL_OR, COUNT, JSONB_AGG, JSON_AGG, MAX, MIN, STDDEV_POP, STDDEV_SAMP, SUM, VAR_POP, VAR_SAMP.","examples":[["id","email","created_at"]]},"query_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Query Filter","description":"Filters to apply. Supported operators: eq, gt, gte, ilike, in, isnull, like, lt, lte, ne, not_in. Relationship filters: agents__any/agents__none on knowledgefile, labels__any/labels__none on chats. They match any or none of at most 100 related IDs and preserve returned associations.","examples":[{"email__ilike":"%@example.com"}]},"order_by":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":100},{"type":"null"}],"title":"Order By","description":"Fields to order by. Prefix with '-' for descending.","examples":[["-created_at"]]},"group_by":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":100},{"type":"null"}],"title":"Group By","description":"Fields to group by.","examples":[["tenant_id","status"]]},"joins":{"anyOf":[{"items":{"$ref":"#/components/schemas/JoinBase"},"type":"array","maxItems":50},{"type":"null"}],"title":"Joins","description":"Optional joins.","examples":[[{"isouter":true,"on":"owner_user_id=id","target_model":"users"}]]},"page":{"$ref":"#/components/schemas/PageRequest","description":"Pagination parameters.","examples":[{"number":1,"size":25}]}},"type":"object","required":["query_model","page"],"title":"DynamicQueryBodyWithPage","example":{"group_by":["tenant_id","status"],"joins":[{"isouter":true,"on":"owner_user_id=id","target_model":"users"}],"order_by":["-created_at"],"page":{"number":1,"size":25},"query_attributes":["id","email","created_at"],"query_filter":{"email__ilike":"%@example.com"},"query_model":"users"}},"DynamicQueryBulkBody":{"properties":{"queries":{"items":{"$ref":"#/components/schemas/DynamicQueryBodyWithPage"},"type":"array","maxItems":100,"title":"Queries","description":"Queries to execute.","examples":[[{"order_by":["agent_id"],"page":{"number":1,"size":10},"query_attributes":["agent_id","model","model_settings"],"query_model":"agent_specs"},{"group_by":["agent_id"],"order_by":["-tool_count"],"page":{"number":1,"size":10},"query_attributes":["agent_id",["COUNT(id)","tool_count"]],"query_model":"agent_tools"}]]}},"type":"object","required":["queries"],"title":"DynamicQueryBulkBody","example":{"queries":[{"order_by":["agent_id"],"page":{"number":1,"size":10},"query_attributes":["agent_id","model","model_settings"],"query_model":"agent_specs"},{"group_by":["agent_id"],"order_by":["-tool_count"],"page":{"number":1,"size":10},"query_attributes":["agent_id",["COUNT(id)","tool_count"]],"query_model":"agent_tools"}]}},"DynamicQueryBulkResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/DynamicQueryResponseWithPage"},"type":"array","title":"Results","description":"Results corresponding to the executed queries.","examples":[[{"page":{"cursor":null,"has_next":false,"number":"1","size":"10","total":"1"},"result":[{"agent_id":"1","model":"gpt-6-luna","model_settings":null}]},{"page":{"cursor":null,"has_next":false,"number":"1","size":"10","total":"1"},"result":[{"agent_id":"1","tool_count":3}]}]]}},"type":"object","required":["results"],"title":"DynamicQueryBulkResponse","example":{"results":[{"page":{"cursor":null,"has_next":false,"number":"1","size":"10","total":"1"},"result":[{"agent_id":"1","model":"gpt-6-luna","model_settings":null}]},{"page":{"cursor":null,"has_next":false,"number":"1","size":"10","total":"1"},"result":[{"agent_id":"1","tool_count":3}]}]}},"DynamicQueryResponseWithPage":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Result","description":"Query results.","examples":[[{"created_at":"2026-02-10T12:00:00+00:00","email":"user@example.com","id":"1"}]]},"page":{"$ref":"#/components/schemas/PageResponse","description":"Pagination metadata.","examples":[{"cursor":null,"has_next":false,"number":"1","size":"25","total":"1"}]}},"type":"object","required":["result","page"],"title":"DynamicQueryResponseWithPage","example":{"page":{"cursor":null,"has_next":false,"number":"1","size":"25","total":"1"},"result":[{"created_at":"2026-02-10T12:00:00+00:00","email":"user@example.com","id":"1"}]}},"DynamicQueryTablesResponse":{"properties":{"tables":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}]},"type":"object"}],"title":"Tables","description":"Available tables.","examples":[["agents","agent_tools","users"]]}},"type":"object","required":["tables"],"title":"DynamicQueryTablesResponse","example":{"tables":["agents","agent_tools","users"]}},"EmailAddress":{"properties":{"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"additionalProperties":false,"type":"object","title":"EmailAddress"},"EmailAttachment":{"properties":{"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"file_name":{"type":"string","minLength":1,"title":"File Name"},"content_type":{"type":"string","title":"Content Type","default":"application/octet-stream"},"size_bytes":{"type":"integer","minimum":0.0,"title":"Size Bytes","default":0},"content_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Id"},"is_inline":{"type":"boolean","title":"Is Inline","default":false}},"additionalProperties":false,"type":"object","required":["file_name"],"title":"EmailAttachment"},"EmailDownloadContent":{"type":"string","enum":["eml","html","txt"],"title":"EmailDownloadContent"},"EmailMailbox":{"type":"string","enum":["inbox","outbox","sent","draft","spam","trash","all"],"title":"EmailMailbox"},"EmailMessage":{"properties":{"external_id":{"type":"string","minLength":1,"title":"External Id"},"external_thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Thread Id"},"tags":{"items":{"$ref":"#/components/schemas/EmailTag"},"type":"array","title":"Tags","default":[]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview"},"sender":{"anyOf":[{"$ref":"#/components/schemas/EmailAddress"},{"type":"null"}]},"recipients":{"items":{"$ref":"#/components/schemas/EmailAddress"},"type":"array","title":"Recipients","default":[]},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received At"},"has_attachments":{"type":"boolean","title":"Has Attachments","default":false},"is_read":{"type":"boolean","title":"Is Read","default":true},"is_starred":{"type":"boolean","title":"Is Starred","default":false},"is_important":{"type":"boolean","title":"Is Important","default":false},"is_draft":{"type":"boolean","title":"Is Draft","default":false},"is_sent":{"type":"boolean","title":"Is Sent","default":false},"external_history_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External History Id"},"author":{"anyOf":[{"$ref":"#/components/schemas/EmailAddress"},{"type":"null"}]},"cc_recipients":{"items":{"$ref":"#/components/schemas/EmailAddress"},"type":"array","title":"Cc Recipients","default":[]},"bcc_recipients":{"items":{"$ref":"#/components/schemas/EmailAddress"},"type":"array","title":"Bcc Recipients","default":[]},"reply_to":{"items":{"$ref":"#/components/schemas/EmailAddress"},"type":"array","title":"Reply To","default":[]},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"attachments":{"items":{"$ref":"#/components/schemas/EmailAttachment"},"type":"array","title":"Attachments","default":[]}},"additionalProperties":false,"type":"object","required":["external_id"],"title":"EmailMessage"},"EmailMessageSummary":{"properties":{"external_id":{"type":"string","minLength":1,"title":"External Id"},"external_thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Thread Id"},"tags":{"items":{"$ref":"#/components/schemas/EmailTag"},"type":"array","title":"Tags","default":[]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview"},"sender":{"anyOf":[{"$ref":"#/components/schemas/EmailAddress"},{"type":"null"}]},"recipients":{"items":{"$ref":"#/components/schemas/EmailAddress"},"type":"array","title":"Recipients","default":[]},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received At"},"has_attachments":{"type":"boolean","title":"Has Attachments","default":false},"is_read":{"type":"boolean","title":"Is Read","default":true},"is_starred":{"type":"boolean","title":"Is Starred","default":false},"is_important":{"type":"boolean","title":"Is Important","default":false},"is_draft":{"type":"boolean","title":"Is Draft","default":false},"is_sent":{"type":"boolean","title":"Is Sent","default":false}},"additionalProperties":false,"type":"object","required":["external_id"],"title":"EmailMessageSummary"},"EmailOfficeIntegrationResponse":{"properties":{"email_office_integration_id":{"type":"string","title":"Email Office Integration Id","examples":[7442550215703679137]},"integration_identity_id":{"type":"string","title":"Integration Identity Id","examples":[7442550215703679004]},"enabled":{"type":"boolean","title":"Enabled","examples":[true,false]},"include_filters":{"items":{"$ref":"#/components/schemas/EmailOfficeMessageFilter"},"type":"array","title":"Include Filters","examples":[[{"sender_email":"sprizzy@p-cation.de"}],[{"label_name":"Invoices"}],[{"label_id":"Label_123"}]]},"exclude_filters":{"items":{"$ref":"#/components/schemas/EmailOfficeMessageFilter"},"type":"array","title":"Exclude Filters","examples":[[{"sender_name":"Automated Notifications"}],[{"label_name":"Spam"}],[{"label_id":"CATEGORY_ID"}]]},"run_interval":{"type":"integer","title":"Run Interval","examples":[30,30,2,1]},"run_interval_unit":{"$ref":"#/components/schemas/EmailOfficeRunIntervalUnit","examples":["seconds","minutes","hours","days"]},"last_run_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run Started At","examples":["2028-06-18T04:45:12Z"]},"last_scan_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Scan Completed At","examples":["2029-09-29T19:08:54Z"]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2027-02-10T11:22:33Z"]},"updated_at":{"type":"string","format":"date-time","title":"Updated At","examples":["2028-06-18T04:45:12Z"]}},"type":"object","required":["email_office_integration_id","integration_identity_id","enabled","include_filters","exclude_filters","run_interval","run_interval_unit","last_run_started_at","last_scan_completed_at","created_at","updated_at"],"title":"EmailOfficeIntegrationResponse","example":{"created_at":"2027-02-10T11:22:33Z","email_office_integration_id":"7442550215703679137","enabled":true,"exclude_filters":[{"sender_name":"Automated Notifications"}],"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"integration_identity_id":"7442550215703679004","last_run_started_at":"2028-06-18T04:45:12Z","last_scan_completed_at":"2029-09-29T19:08:54Z","run_interval":30,"run_interval_unit":"seconds","updated_at":"2028-06-18T04:45:12Z"}},"EmailOfficeMessageFilter":{"properties":{"sender_name":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Sender Name","examples":["Acme Billing"]},"sender_email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Sender Email","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"label_name":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Label Name","examples":["Invoices"]},"label_id":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Label Id","examples":["Label_123"]}},"additionalProperties":false,"type":"object","title":"EmailOfficeMessageFilter"},"EmailOfficeRunIntervalUnit":{"type":"string","enum":["seconds","minutes","hours","days"],"title":"EmailOfficeRunIntervalUnit"},"EmailTag":{"properties":{"external_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"External Id"},"name":{"type":"string","minLength":1,"title":"Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"EmailTag"},"ErrorDetails":{"properties":{"info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info","description":"Human-readable addition to explain the error"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"The type of exception"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context","description":"Additional information about the error"},"cause":{"anyOf":[{"$ref":"#/components/schemas/CauseDetails"},{"items":{"$ref":"#/components/schemas/CauseDetails"},"type":"array"},{"type":"null"}],"title":"Cause","description":"The underlying cause"}},"type":"object","title":"ErrorDetails"},"ErrorResponse":{"properties":{"status_code":{"type":"string","title":"Status Code","description":"HTTP status code of the error"},"status_message":{"type":"string","title":"Status Message","description":"Reason phrase for the HTTP status code"},"errors":{"items":{"$ref":"#/components/schemas/ErrorDetails"},"type":"array","title":"Errors","description":"List of errors"}},"type":"object","required":["status_code","status_message","errors"],"title":"ErrorResponse","example":{"errors":[{"cause":null,"context":null,"info":"Unexpected internal server error occurred.","type":null}],"status_code":"500","status_message":"Internal Server Error"}},"FailedDeletionDetail":{"properties":{"template_id":{"type":"string","title":"Template Id","description":"Template ID that could not be deleted.","examples":[7442678451937742086]},"error_message":{"type":"string","title":"Error Message","description":"Deletion failure reason.","examples":["Template is still pending review."]}},"type":"object","required":["template_id","error_message"],"title":"FailedDeletionDetail","example":{"error_message":"Template is still pending review.","template_id":"7442678451937742086"}},"FieldSchema-Input":{"properties":{"type":{"type":"string","enum":["string","integer","number","boolean","object","array"],"title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldSchema-Input"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/components/schemas/ValueSchema-Input"},{"type":"null"}]},"name":{"type":"string","minLength":1,"title":"Name"},"required":{"type":"boolean","title":"Required","default":true},"default":{"$ref":"#/components/schemas/JsonValue"}},"additionalProperties":false,"type":"object","required":["type","name"],"title":"FieldSchema"},"FieldSchema-Output":{"properties":{"type":{"type":"string","enum":["string","integer","number","boolean","object","array"],"title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldSchema-Output"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/components/schemas/ValueSchema-Output"},{"type":"null"}]},"name":{"type":"string","minLength":1,"title":"Name"},"required":{"type":"boolean","title":"Required","default":true},"default":{"$ref":"#/components/schemas/JsonValue"}},"additionalProperties":false,"type":"object","required":["type","name"],"title":"FieldSchema"},"FirstContactMessage":{"properties":{"text":{"type":"string","maxLength":1024,"minLength":1,"title":"Text","description":"Message text sent to users on first contact.","examples":["Hi {user_name}, how can we help?"]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageurl","description":"Optional header image URL.","examples":["https://example.com/header.png"]},"buttons":{"anyOf":[{"items":{"$ref":"#/components/schemas/Button"},"type":"array"},{"type":"null"}],"title":"Buttons","description":"CTA buttons displayed below the first-contact message."},"footer":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer","description":"Optional message footer.","examples":["LIVOI support"]}},"additionalProperties":false,"type":"object","required":["text"],"title":"FirstContactMessage"},"FlowParam":{"properties":{"type":{"type":"string","const":"FLOW","title":"Type","description":"Runtime flow button parameter type.","examples":["FLOW"]},"index":{"type":"integer","minimum":0.0,"title":"Index","description":"Zero-based button index.","examples":[0,1,2]},"flow_token":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Flow Token","description":"Flow token for flow buttons.","examples":["flow-session-123","flow-session-456"]},"flow_action_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Flow Action Data","description":"Flow action payload for flow buttons.","examples":[{"cart_id":"cart-123","step":"checkout"},{"step":"support","ticket_id":"ticket-987"}]}},"additionalProperties":false,"type":"object","required":["type","index"],"title":"FlowParam"},"FolderCreateItem":{"properties":{"name":{"type":"string","maxLength":40,"minLength":1,"title":"Name","description":"Display name of the folder.","examples":["Sales","Marketing","Support"]}},"type":"object","required":["name"],"title":"FolderCreateItem","example":{"name":"Sales"}},"FullResyncRequired":{"properties":{"status":{"type":"string","const":"full_resync_required","title":"Status","default":"full_resync_required"},"reason":{"type":"string","enum":["cursor_expired","cursor_unavailable"],"title":"Reason"},"current_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Cursor"}},"additionalProperties":false,"type":"object","required":["reason"],"title":"FullResyncRequired"},"GetCustomToolForAgentResponse":{"properties":{"agent_tool_id":{"type":"string","title":"Agent Tool Id","description":"Custom agent tool ID.","examples":[7442551216804781344]},"agent_id":{"type":"string","title":"Agent Id","description":"Agent ID.","examples":[7442550215703679004]},"tool_name":{"type":"string","title":"Tool Name","description":"Custom tool name.","examples":["search_companies"]},"tool_description":{"type":"string","title":"Tool Description","description":"Custom tool description.","examples":["Searches companies by name and returns their ID, name, and email address."]},"request_config":{"$ref":"#/components/schemas/CustomToolRequestConfig","description":"Stored HTTP request configuration with JSON types preserved, including body_template when configured.","examples":[{"additional_headers":{"X-Workspace-Id":"example"},"api_url":"https://api.example.com/v1/contacts/search","body_template":{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10},"http_method":"POST"}]},"response_config":{"anyOf":[{"$ref":"#/components/schemas/CustomToolResponseConfig"},{"type":"null"}],"description":"Stored upstream response validation, when configured."},"max_retries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Retries","description":"Maximum retry attempts for invalid tool arguments.","examples":[1]},"read_only":{"type":"boolean","title":"Read Only","description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","default":false},"defer_loading":{"type":"boolean","title":"Defer Loading","description":"Whether the agent discovers this tool through search.","default":false,"examples":[true]},"input_schema":{"$ref":"#/components/schemas/CustomToolInputSchema-Output","description":"Stored input schema with JSON types preserved.","examples":[{"parameters":[{"description":"Company name to search for.","location":"body","name":"name","type":"string"}]}]},"has_api_key":{"type":"boolean","title":"Has Api Key","description":"Whether the custom tool has a stored API key. The key itself is never returned.","examples":[true]}},"type":"object","required":["agent_tool_id","agent_id","tool_name","tool_description","request_config","input_schema","has_api_key"],"title":"GetCustomToolForAgentResponse","example":{"agent_id":"7442550215703679004","agent_tool_id":"7442551216804781344","defer_loading":true,"has_api_key":true,"input_schema":{"parameters":[{"description":"Company name to search for.","location":"body","name":"name","type":"string"}]},"max_retries":1,"request_config":{"additional_headers":{"X-Workspace-Id":"example"},"api_url":"https://api.example.com/v1/contacts/search","body_template":{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10},"http_method":"POST"},"tool_description":"Searches companies by name and returns their ID, name, and email address.","tool_name":"search_companies"}},"GetDatevInvoicePreviewResponse":{"properties":{"preview":{"$ref":"#/components/schemas/DatevInvoicePreviewDetailData","description":"Invoice preview details."}},"type":"object","required":["preview"],"title":"GetDatevInvoicePreviewResponse","example":{"preview":{"created_at":"2026-02-10T12:00:00+00:00","datev_profile_id":"7442550215703679004","id":"7442551216804781021","invoice_number":"RE-2026-001","status":"pending","totals":{"currency":"EUR","gross_total":"119.00","net_total":"100.00","tax_total":"19.00"},"traffiqx_id":"1234567890123","updated_at":"2026-02-10T12:00:00+00:00","xml_content":"<?xml version=\"1.0\" encoding=\"utf-8\"?>"}}},"GetDatevInvoiceRegistryArchiveUrlResponse":{"properties":{"registry_id":{"type":"string","title":"Registry Id","description":"DATEV invoice registry ID.","examples":[7442678451937742086]},"archive_url":{"type":"string","title":"Archive Url","description":"Presigned URL for archived invoice JSON.","examples":["https://storage.example.com/bucket/...signature..."]},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"Expiration timestamp of the presigned URL.","examples":["2026-02-24T15:05:00+00:00"]},"archive_content_encoding":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archive Content Encoding","description":"Archive format/type of the stored object (DATEV invoice archives are returned as 'json').","examples":["json"]}},"type":"object","required":["registry_id","archive_url","expires_at"],"title":"GetDatevInvoiceRegistryArchiveUrlResponse","example":{"archive_content_encoding":"json","archive_url":"https://storage.example.com/bucket/...signature...","expires_at":"2026-02-24T15:05:00+00:00","registry_id":"7442678451937742086"}},"GetDatevInvoiceRegistryArchivesBulkBody":{"properties":{"registry_ids":{"items":{"type":"integer"},"type":"array","maxItems":100,"minItems":1,"title":"Registry Ids","description":"DATEV invoice registry IDs to resolve in bulk.","examples":[[7442678451937742086,7442678451937742214]]}},"type":"object","required":["registry_ids"],"title":"GetDatevInvoiceRegistryArchivesBulkBody","example":{"registry_ids":["7442678451937742086","7442678451937742214"]}},"GetDatevInvoiceRegistryArchivesBulkResponse":{"properties":{"requested_count":{"type":"integer","title":"Requested Count","description":"Number of requested registry IDs.","examples":[3]},"success_count":{"type":"integer","title":"Success Count","description":"Number of items returned with status='ok'.","examples":[2]},"error_count":{"type":"integer","title":"Error Count","description":"Number of items with non-ok status.","examples":[1]},"partial":{"type":"boolean","title":"Partial","description":"Whether the response contains a mix of successful and failed items.","examples":[true]},"items":{"items":{"$ref":"#/components/schemas/DatevInvoiceRegistryArchiveBulkItem"},"type":"array","title":"Items","description":"Per-registry archive result."}},"type":"object","required":["requested_count","success_count","error_count","partial","items"],"title":"GetDatevInvoiceRegistryArchivesBulkResponse","example":{"error_count":1,"items":[{"archive_content_encoding":"json","archive_json":{"invoice_number":"RE-2026-001"},"archive_size_bytes":128,"registry_id":"7442678451937742214","status":"ok"}],"partial":true,"requested_count":3,"success_count":2}},"GetDatevOutboxDocumentStatusResponse":{"properties":{"document_id":{"type":"string","title":"Document Id","description":"Outbox document ID.","examples":["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01"]},"status":{"type":"string","title":"Status","description":"Current TRAFFIQX outbox status.","examples":["sent"]},"is_terminal":{"type":"boolean","title":"Is Terminal","description":"Whether the status is terminal and polling can stop.","examples":[true]},"checked_at":{"type":"string","format":"date-time","title":"Checked At","description":"UTC timestamp when the status was checked.","examples":["2026-02-20T10:35:00+00:00"]},"raw":{"anyOf":[{},{"type":"null"}],"title":"Raw","description":"Optional raw TRAFFIQX response payload.","examples":[{"status":"sent"}]}},"type":"object","required":["document_id","status","is_terminal","checked_at"],"title":"GetDatevOutboxDocumentStatusResponse","example":{"checked_at":"2026-02-20T10:35:00+00:00","document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","is_terminal":true,"raw":{"status":"sent"},"status":"sent"}},"GetEffectivePermissionsResponse":{"properties":{"user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"User Id","description":"Resolved user ID, if user-bound.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"tenant_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Tenant Id","description":"Resolved tenant ID, if tenant-bound.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether the resolved user is a superuser.","examples":[true,false]},"role_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Role Ids","description":"Resolved role IDs.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"group_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Group Ids","description":"Resolved group IDs.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"Resolved permissions.","examples":[["agents.read","agents.read.any","knowledgefile.read.granted"],["users.read","users.update","groups.read"],["roles.create","roles.update","roles.delete.any"],["agents.read.own","groups.read","users.read"]]}},"type":"object","required":["is_superuser"],"title":"GetEffectivePermissionsResponse","example":{"group_ids":["7443001845129083411"],"is_superuser":true,"permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"role_ids":["7442678451937742086"],"tenant_id":"7442551216804781021","user_id":"7442550215703679004"}},"GetGroupResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Group ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"name":{"type":"string","title":"Name","description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Group description.","examples":["Support staff group."]}},"type":"object","required":["id","tenant_id","name"],"title":"GetGroupResponse","example":{"description":"Support staff group.","id":"7442550215703679004","name":"Support Team","tenant_id":"7442551216804781021"}},"GetNumbersTableChatEntry":{"properties":{"chat_id":{"type":"string","title":"Chat Id","description":"ID of the chat.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Title of the chat.","examples":["Support Chat"]},"latest_output_timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Latest Output Timestamp","description":"Timestamp of the latest chat output.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]}},"type":"object","required":["chat_id"],"title":"GetNumbersTableChatEntry","example":{"chat_id":"7442550215703679004","latest_output_timestamp":"2027-02-10T11:22:33Z","title":"Support Chat"}},"GetNumbersTableResponse":{"properties":{"phone_numbers":{"additionalProperties":{"items":{"$ref":"#/components/schemas/GetNumbersTableChatEntry"},"type":"array"},"type":"object","title":"Phone Numbers","description":"A dictionary where keys are phone numbers and values are lists of chat information.","examples":[["491701234567","4917611122233","4915112349876","492211234560"]]}},"type":"object","required":["phone_numbers"],"title":"GetNumbersTableResponse","example":{"phone_numbers":{"['491701234567', '4917611122233', '4915112349876', '492211234560']":[{"chat_id":"7442550215703679004","latest_output_timestamp":"2027-02-10T11:22:33Z","title":"Support Chat"}]}}},"GetRoleResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Role ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Role description.","examples":["Can manage tenant resources.","Supervises support operations.","Handles day-to-day platform tasks.","Can read and write files."]}},"type":"object","required":["id","tenant_id","name"],"title":"GetRoleResponse","example":{"description":"Can manage tenant resources.","id":"7443001845129083411","name":"Administrator","tenant_id":"7442550215703679004"}},"GetTenantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"]},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["id","name"],"title":"GetTenantResponse","example":{"domain":"sprizzy.de","id":"7442550215703679004","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"}},"GetUserEffectivePermissionsResponse":{"properties":{"user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"User Id","description":"Resolved user ID, if user-bound.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"tenant_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Tenant Id","description":"Resolved tenant ID, if tenant-bound.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether the resolved user is a superuser.","examples":[true,false]},"role_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Role Ids","description":"Resolved role IDs.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"group_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Group Ids","description":"Resolved group IDs.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"Resolved permissions.","examples":[["agents.read","agents.read.any","knowledgefile.read.granted"],["users.read","users.update","groups.read"],["roles.create","roles.update","roles.delete.any"],["agents.read.own","groups.read","users.read"]]}},"type":"object","required":["is_superuser"],"title":"GetUserEffectivePermissionsResponse","example":{"group_ids":["7443001845129083411"],"is_superuser":true,"permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"role_ids":["7442678451937742086"],"tenant_id":"7442551216804781021","user_id":"7442550215703679004"}},"GetUserResponse":{"properties":{"id":{"type":"string","title":"Id","description":"User ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the user is active.","examples":[true,false]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether the user is a superuser.","examples":[true,false]}},"type":"object","required":["id","is_active","is_superuser"],"title":"GetUserResponse","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","full_name":"Sprizzy Musterassistent","id":"7442550215703679004","is_active":true,"is_superuser":true,"last_name":"Musterassistent","phone_number":"+491701234567"}},"GroupMembershipItemModel":{"properties":{"id":{"type":"string","title":"Id","description":"Group membership row ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"group_id":{"type":"string","title":"Group Id","description":"Group ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the membership is active.","examples":[true,false]}},"type":"object","required":["id","group_id","user_id","tenant_id","is_active"],"title":"GroupMembershipItemModel","example":{"group_id":"7442550215703679004","id":"7442678451937742086","is_active":true,"tenant_id":"7443001845129083411","user_id":"7442551216804781021"}},"GroupRoleItemModel":{"properties":{"group_id":{"type":"string","title":"Group Id","description":"Group ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"role_id":{"type":"string","title":"Role Id","description":"Role ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["group_id","role_id"],"title":"GroupRoleItemModel","example":{"group_id":"7442550215703679004","role_id":"7442551216804781021"}},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeaderDocumentParam":{"properties":{"type":{"type":"string","const":"HEADER_DOCUMENT","title":"Type","description":"Runtime document header parameter type.","examples":["HEADER_DOCUMENT"]},"document":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"Document","description":"Document link or media ID for a document header param.","examples":["https://cdn.example.com/contract.pdf",[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]},"filename":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Filename","description":"Optional filename for document header params.","examples":["contract.pdf","pricing-overview.pdf"]},"mime_type":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Mime Type","description":"Optional MIME type for media header params.","examples":["application/pdf"]}},"additionalProperties":false,"type":"object","required":["type","document"],"title":"HeaderDocumentParam"},"HeaderGIFParam":{"properties":{"type":{"type":"string","const":"HEADER_GIF","title":"Type","description":"Runtime GIF header parameter type.","examples":["HEADER_GIF"]},"gif":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"Gif","description":"GIF link or media ID for a GIF header param.","examples":["https://cdn.example.com/celebration.gif",[744128060820239091]]},"mime_type":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Mime Type","description":"Optional MIME type for media header params.","examples":["image/gif"]}},"additionalProperties":false,"type":"object","required":["type","gif"],"title":"HeaderGIFParam"},"HeaderImageParam":{"properties":{"type":{"type":"string","const":"HEADER_IMAGE","title":"Type","description":"Runtime image header parameter type.","examples":["HEADER_IMAGE"]},"image":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"Image","description":"Image link or media ID for an image header param.","examples":["https://cdn.example.com/banner.jpg",[744128060820239091]]},"mime_type":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Mime Type","description":"Optional MIME type for media header params.","examples":["image/jpeg","image/png"]}},"additionalProperties":false,"type":"object","required":["type","image"],"title":"HeaderImageParam"},"HeaderLocationParam":{"properties":{"type":{"type":"string","const":"HEADER_LOCATION","title":"Type","description":"Runtime location header parameter type.","examples":["HEADER_LOCATION"]},"lat":{"type":"number","title":"Lat","description":"Latitude for header location params.","examples":[51.39462700207981]},"lon":{"type":"number","title":"Lon","description":"Longitude for header location params.","examples":[8.136012551231019]},"name":{"type":"string","minLength":1,"title":"Name","description":"Display name for header location params.","examples":[["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]]},"address":{"type":"string","minLength":1,"title":"Address","description":"Display address for header location params.","examples":["KirchstraÃŸe 44, 59823 Arnsberg"]}},"additionalProperties":false,"type":"object","required":["type","lat","lon","name","address"],"title":"HeaderLocationParam"},"HeaderProductParam":{"properties":{"type":{"type":"string","const":"HEADER_PRODUCT","title":"Type","description":"Runtime product header parameter type.","examples":["HEADER_PRODUCT"]},"catalog_id":{"type":"string","minLength":1,"title":"Catalog Id","description":"Catalog ID for header product params.","examples":[744128060820239091]},"sku":{"type":"string","minLength":1,"title":"Sku","description":"Product retailer ID for header product params.","examples":["SKU-1001","SKU-2001"]}},"additionalProperties":false,"type":"object","required":["type","catalog_id","sku"],"title":"HeaderProductParam"},"HeaderTextParam":{"properties":{"type":{"type":"string","const":"HEADER_TEXT","title":"Type","description":"Runtime header text parameter type.","examples":["HEADER_TEXT"]},"values":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"oneOf":[{"$ref":"#/components/schemas/CurrencyTextValue"},{"$ref":"#/components/schemas/DateTimeTextValue"}],"discriminator":{"propertyName":"type","mapping":{"CURRENCY":"#/components/schemas/CurrencyTextValue","DATE_TIME":"#/components/schemas/DateTimeTextValue"}}}]},"type":"array"},{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"oneOf":[{"$ref":"#/components/schemas/CurrencyTextValue"},{"$ref":"#/components/schemas/DateTimeTextValue"}],"discriminator":{"propertyName":"type","mapping":{"CURRENCY":"#/components/schemas/CurrencyTextValue","DATE_TIME":"#/components/schemas/DateTimeTextValue"}}}]},"type":"object"}],"title":"Values","description":"Text parameter values. Use an array for positional templates and an object for named templates.","examples":[["Max","Tuesday"],{"appointment_day":"Tuesday","customer_name":"Max"}]}},"additionalProperties":false,"type":"object","required":["type","values"],"title":"HeaderTextParam"},"HeaderVideoParam":{"properties":{"type":{"type":"string","const":"HEADER_VIDEO","title":"Type","description":"Runtime video header parameter type.","examples":["HEADER_VIDEO"]},"video":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"Video","description":"Video link or media ID for a video header param.","examples":["https://cdn.example.com/intro.mp4",[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]},"mime_type":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Mime Type","description":"Optional MIME type for media header params.","examples":["video/mp4","video/webm"]}},"additionalProperties":false,"type":"object","required":["type","video"],"title":"HeaderVideoParam"},"HistoryAttachmentReference":{"properties":{"storage_object_id":{"type":"string","title":"Storage Object Id","examples":["7442550215703679873"]},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"size":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Size"}},"additionalProperties":false,"type":"object","required":["storage_object_id"],"title":"HistoryAttachmentReference"},"HistoryDataPayload":{"$ref":"#/components/schemas/JsonValue"},"HistoryEntry":{"properties":{"history_entry_id":{"type":"string","title":"History Entry Id","examples":["7442550215703679873"]},"chat_id":{"type":"string","title":"Chat Id","examples":["7442550215703679873"]},"sequence":{"type":"integer","minimum":0.0,"title":"Sequence"},"role":{"$ref":"#/components/schemas/ChatHistoryEntryRole"},"type":{"$ref":"#/components/schemas/ChatHistoryEntryType"},"status":{"type":"string","title":"Status"},"agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Id"},"parent_entry_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Parent Entry Id"},"occurred_at":{"type":"string","title":"Occurred At"},"representation":{"$ref":"#/components/schemas/HistoryRepresentation"},"hydration":{"$ref":"#/components/schemas/HistoryHydration"},"parts":{"anyOf":[{"items":{"$ref":"#/components/schemas/HistoryPart"},"type":"array"},{"type":"null"}],"title":"Parts"},"usage":{"anyOf":[{"$ref":"#/components/schemas/HistoryUsage"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["history_entry_id","chat_id","sequence","role","type","status","occurred_at","representation","hydration"],"title":"HistoryEntry"},"HistoryHydration":{"properties":{"parts_included":{"type":"boolean","title":"Parts Included"},"usage_included":{"type":"boolean","title":"Usage Included"},"attachments_included":{"type":"boolean","title":"Attachments Included"},"hidden_content_included":{"type":"boolean","title":"Hidden Content Included"}},"additionalProperties":false,"type":"object","required":["parts_included","usage_included","attachments_included","hidden_content_included"],"title":"HistoryHydration"},"HistoryPart":{"properties":{"history_part_id":{"type":"string","title":"History Part Id","examples":["7442550215703679873"]},"agent_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Agent Id"},"order_index":{"type":"integer","minimum":0.0,"title":"Order Index"},"kind":{"type":"string","title":"Kind"},"content_included":{"type":"boolean","title":"Content Included"},"content":{"$ref":"#/components/schemas/HistoryDataPayload"},"storage_object_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Storage Object Id"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"file_handling":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Handling"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"},"model_visible":{"type":"boolean","title":"Model Visible"},"user_visible":{"type":"boolean","title":"User Visible"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"attachment":{"anyOf":[{"$ref":"#/components/schemas/HistoryAttachmentReference"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["history_part_id","order_index","kind","content_included","model_visible","user_visible"],"title":"HistoryPart"},"HistoryRepresentation":{"type":"string","enum":["summary","display","full"],"title":"HistoryRepresentation"},"HistorySequenceRange":{"properties":{"first":{"type":"integer","minimum":0.0,"title":"First"},"last":{"type":"integer","minimum":0.0,"title":"Last"}},"additionalProperties":false,"type":"object","required":["first","last"],"title":"HistorySequenceRange"},"HistoryUsage":{"properties":{"history_usage_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"History Usage Id"},"input_tokens":{"type":"integer","minimum":0.0,"title":"Input Tokens"},"output_tokens":{"type":"integer","minimum":0.0,"title":"Output Tokens"},"total_tokens":{"type":"integer","minimum":0.0,"title":"Total Tokens"},"cache_write_tokens":{"type":"integer","minimum":0.0,"title":"Cache Write Tokens"},"cache_read_tokens":{"type":"integer","minimum":0.0,"title":"Cache Read Tokens"},"input_audio_tokens":{"type":"integer","minimum":0.0,"title":"Input Audio Tokens"},"output_audio_tokens":{"type":"integer","minimum":0.0,"title":"Output Audio Tokens"},"cache_audio_read_tokens":{"type":"integer","minimum":0.0,"title":"Cache Audio Read Tokens"},"reasoning_tokens":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Reasoning Tokens"},"cost_amount":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Cost Amount"},"cost_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Currency"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"additionalProperties":false,"type":"object","required":["input_tokens","output_tokens","total_tokens","cache_write_tokens","cache_read_tokens","input_audio_tokens","output_audio_tokens","cache_audio_read_tokens"],"title":"HistoryUsage"},"HtmlRenderContentResponse":{"properties":{"history_part_id":{"type":"string","title":"History Part Id","description":"Published tool-return part ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"storage_object_id":{"type":"string","title":"Storage Object Id","description":"Immutable generated storage object ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"html_render":{"$ref":"#/components/schemas/HtmlRenderMetadata","examples":[{"height":600,"title":"Calculator","version":1}]},"html":{"type":"string","title":"Html","description":"Bounded UTF-8 HTML as inert JSON data. Execute only in a separately isolated renderer.","examples":["<!doctype html><html><body>Calculator</body></html>"]}},"type":"object","required":["history_part_id","storage_object_id","html_render","html"],"title":"HtmlRenderContentResponse","example":{"history_part_id":"7442550215703679004","html":"<!doctype html><html><body>Calculator</body></html>","html_render":{"height":600,"title":"Calculator","version":1},"storage_object_id":"7442551216804781021"}},"HtmlRenderMetadata":{"properties":{"version":{"type":"integer","const":1,"title":"Version","description":"Metadata version.","default":1},"title":{"type":"string","maxLength":160,"minLength":1,"title":"Title","description":"Short name of the attachment."},"height":{"type":"integer","maximum":2000.0,"minimum":80.0,"title":"Height","description":"Expected content height in CSS pixels. Use it as the initial frame height and, on phones, as the maximum frame height."}},"additionalProperties":false,"type":"object","required":["title","height"],"title":"HtmlRenderMetadata"},"IntegrationIdentityResponse":{"properties":{"integration_identity_id":{"type":"string","title":"Integration Identity Id","examples":["7442550215703679873"]},"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"provider_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Subject"},"provider_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Email"},"provider_tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Tenant Id"},"provider_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Metadata"},"requested_scopes":{"items":{"type":"string"},"type":"array","title":"Requested Scopes"},"granted_scopes":{"items":{"type":"string"},"type":"array","title":"Granted Scopes"},"status":{"$ref":"#/components/schemas/IntegrationIdentityStatus"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"access_token_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Access Token Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["integration_identity_id","provider","provider_subject","provider_email","provider_tenant_id","provider_metadata","requested_scopes","granted_scopes","status","last_error","access_token_expires_at","created_at","updated_at"],"title":"IntegrationIdentityResponse","example":{"access_token_expires_at":"<access_token_expires_at>","created_at":"<created_at>","granted_scopes":["<granted_scopes>"],"integration_identity_id":"<integration_identity_id>","last_error":"<last_error>","provider":"<provider>","provider_email":"<provider_email>","provider_metadata":"<provider_metadata>","provider_subject":"<provider_subject>","provider_tenant_id":"<provider_tenant_id>","requested_scopes":["<requested_scopes>"],"status":"<status>","updated_at":"<updated_at>"}},"IntegrationIdentityStatus":{"type":"string","enum":["pending","active","error","revoked"],"title":"IntegrationIdentityStatus"},"IntegrationPage_CalendarEvent_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CalendarEvent"},"type":"array","title":"Items","default":[]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"additionalProperties":false,"type":"object","title":"IntegrationPage[CalendarEvent]"},"IntegrationPage_Calendar_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Calendar"},"type":"array","title":"Items","default":[]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"additionalProperties":false,"type":"object","title":"IntegrationPage[Calendar]"},"IntegrationPage_EmailMessageSummary_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EmailMessageSummary"},"type":"array","title":"Items","default":[]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"additionalProperties":false,"type":"object","title":"IntegrationPage[EmailMessageSummary]"},"IntegrationProvider":{"type":"string","enum":["google","microsoft","oauth2"],"title":"IntegrationProvider"},"ItemListView":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SubmittedItem"},"type":"array","title":"Items"}},"type":"object","title":"ItemListView","example":{"items":[{"item_id":"7442678451937742086","status":"pending"}]}},"ItemView":{"properties":{"item_id":{"type":"string","title":"Item Id","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"status":{"$ref":"#/components/schemas/AutomationItemStatus","description":"Running means processing has started and is unsettled, including time waiting for a retry. Cancelled revokes future work without selecting an execution result. It does not confirm process exit.","examples":["pending","cancelled"]},"automation_id":{"type":"string","title":"Automation Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"selected_run_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Selected Run Id","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"runs":{"items":{"$ref":"#/components/schemas/RunView"},"type":"array","title":"Runs"},"content_state":{"$ref":"#/components/schemas/ContentState","default":"prepared"},"preparation_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preparation Error"},"manifest":{"items":{"$ref":"#/components/schemas/PartManifest"},"type":"array","title":"Manifest"},"total_attempts":{"type":"integer","title":"Total Attempts","default":0},"source_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Source Id"}},"type":"object","required":["item_id","status","automation_id","selected_run_id","runs"],"title":"ItemView","example":{"automation_id":"7442551216804781021","item_id":"7442678451937742086","runs":[{"attempt":1,"error_code":"<error_code>","evidence":[{"arguments":{"name":"Example GmbH"},"result":{"customer_id":"C-100"},"tool_name":"lookup_customer"}],"result":{"data":{"customer_id":"C-100"},"outcome":"ready","reason":"Customer matched.","reason_code":""},"run_id":"7443001845129083411"}],"selected_run_id":"7443001845129083411","status":"pending"}},"JoinBase":{"properties":{"target_model":{"type":"string","title":"Target Model","description":"Table name to join with.","examples":["users"]},"on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"On","description":"Join condition in the form '<left_field>=<right_field>'.","examples":["owner_user_id=id"]},"isouter":{"type":"boolean","title":"Isouter","description":"Whether to use LEFT OUTER JOIN.","default":false,"examples":[true]}},"type":"object","required":["target_model"],"title":"JoinBase","example":{"isouter":true,"on":"owner_user_id=id","target_model":"users"}},"JsonObject":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},"JsonValue":{},"KnowledgeFileDeleteBody":{"properties":{"file_ids":{"items":{"type":"integer"},"type":"array","maxItems":100,"minItems":1,"title":"File Ids","description":"Knowledge file IDs to delete.","examples":[[7442551216804781021],[7442551216804781021,7442551216804781198]]}},"type":"object","required":["file_ids"],"title":"KnowledgeFileDeleteBody","example":{"file_ids":["7442551216804781021"]}},"KnowledgeFileDeleteResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Deletion result message.","examples":["2 knowledge files deleted successfully."]}},"type":"object","required":["message"],"title":"KnowledgeFileDeleteResponse","example":{"message":"2 knowledge files deleted successfully."}},"KnowledgeFileDownloadBody":{"properties":{"file_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"File Ids","description":"Knowledge file IDs to download.","examples":[[7442551216804781021],[7442551216804781021,7442551216804781198]]}},"type":"object","required":["file_ids"],"title":"KnowledgeFileDownloadBody","example":{"file_ids":["7442551216804781021"]}},"KnowledgeFileIndexPage":{"properties":{"knowledge_files":{"items":{"$ref":"#/components/schemas/KnowledgeFileLifecycleSnapshot"},"type":"array","title":"Knowledge Files"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"additionalProperties":false,"type":"object","required":["knowledge_files","has_more"],"title":"KnowledgeFileIndexPage"},"KnowledgeFileLifecycleSnapshot":{"properties":{"knowledge_file_id":{"type":"string","title":"Knowledge File Id","examples":["7442550215703679873"]},"storage_object_id":{"type":"string","title":"Storage Object Id","examples":["7442550215703679873"]},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"size":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Size"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"embedding_status":{"type":"string","title":"Embedding Status"},"chunking_strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chunking Strategy"},"embedding_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Embedding Model"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"agent_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Agent Ids"},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"additionalProperties":false,"type":"object","required":["knowledge_file_id","storage_object_id","embedding_status","agent_ids","created_at","updated_at"],"title":"KnowledgeFileLifecycleSnapshot"},"KnowledgeFileUploadBody":{"properties":{"files":{"items":{"$ref":"#/components/schemas/RequireAllowedKnowledgeFileUpload"},"type":"array","minItems":1,"title":"Files","description":"Knowledge files to upload.","examples":[["report.pdf","summary.txt"]]},"agent_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Agent Ids","description":"Optional agent IDs to associate with each uploaded knowledge file.","examples":[[7442550215703679004,7442550215703679137]]}},"type":"object","required":["files"],"title":"KnowledgeFileUploadBody","example":{"agent_ids":["7442550215703679004","7442550215703679137"],"files":["report.pdf","summary.txt"]}},"KnowledgeFileUploadResponse":{"properties":{"uploaded_files":{"additionalProperties":{"type":"string","examples":["7442550215703679873"]},"type":"object","title":"Uploaded Files","description":"Mapping of uploaded file names to knowledge file IDs.","examples":[{"report.pdf":7442551216804781021,"summary.txt":7442551216804781198}]},"processing_tasks":{"anyOf":[{"additionalProperties":{"type":"string","examples":["7442550215703679873"]},"type":"object"},{"type":"null"}],"title":"Processing Tasks","description":"Mapping of uploaded file names to processing task IDs.","examples":[{"report.pdf":7442550215703679004,"summary.txt":7442550215703679137}]}},"type":"object","required":["uploaded_files"],"title":"KnowledgeFileUploadResponse","example":{"processing_tasks":{"report.pdf":"7442550215703679004","summary.txt":"7442550215703679137"},"uploaded_files":{"report.pdf":"7442551216804781021","summary.txt":"7442551216804781198"}}},"LabelAssignBase":{"properties":{"chat_id":{"type":"integer","title":"Chat Id","description":"Chat ID.","examples":[7442550215703679004]},"label_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true,"title":"Label Ids","description":"Label IDs.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","required":["chat_id","label_ids"],"title":"LabelAssignBase","example":{"chat_id":"7442550215703679004","label_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]}},"LabelAssignBody":{"properties":{"assignments":{"items":{"$ref":"#/components/schemas/LabelAssignBase"},"type":"array","minItems":1,"title":"Assignments","description":"Chat-label assignments.","examples":[{"chat_id":7442550215703679004,"label_ids":[7442551216804781021]}]}},"type":"object","required":["assignments"],"title":"LabelAssignBody","example":{"assignments":[{"chat_id":"7442550215703679004","label_ids":["7442551216804781021"]}]}},"LabelAssignResponse":{"properties":{"assigned":{"additionalProperties":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object","title":"Assigned","description":"Mapping of chat IDs to assigned label IDs.","examples":[{"7442550215703679004":[7442551216804781021]}]},"failed":{"anyOf":[{"additionalProperties":{"type":"string"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object"},{"type":"null"}],"title":"Failed","description":"Failed assignment messages.","examples":[{"7442550215703679004":"Chat not found"}]}},"type":"object","required":["assigned"],"title":"LabelAssignResponse","example":{"assigned":{"7442550215703679004":["7442551216804781021"]},"failed":{"7442550215703679004":"Chat not found"}}},"LabelBase":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Label name.","examples":["Urgent"]},"description":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Description","description":"Label description.","examples":["Requires same-day customer follow-up."]},"color_code":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Color Code","description":"RGBA hex color code.","default":"#FFFFFFFF","examples":["#FF3B30FF"]}},"type":"object","required":["name"],"title":"LabelBase","example":{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","name":"Urgent"}},"LabelCreateBody":{"properties":{"labels":{"items":{"$ref":"#/components/schemas/LabelBase"},"type":"array","minItems":1,"title":"Labels","description":"Labels to create.","examples":[{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","name":"Urgent"}]}},"type":"object","required":["labels"],"title":"LabelCreateBody","example":{"labels":[{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","name":"Urgent"}]}},"LabelCreateResponse":{"properties":{"created":{"items":{"$ref":"#/components/schemas/LabelResponse"},"type":"array","title":"Created","description":"Created labels."},"failed":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Failed","description":"Names of labels that already exist."}},"type":"object","required":["created","failed"],"title":"LabelCreateResponse","example":{"created":[{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","label_id":"7442550215703679004","name":"Urgent"}],"failed":["<failed>"]}},"LabelDeleteBody":{"properties":{"label_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Label Ids","description":"Label IDs to delete.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]]}},"type":"object","required":["label_ids"],"title":"LabelDeleteBody","example":{"label_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]}},"LabelDeleteResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Deletion message.","examples":["Deleted 2 labels."]},"deleted_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Deleted Ids","description":"Deleted label IDs.","examples":[[7442550215703679004]]}},"type":"object","required":["message","deleted_ids"],"title":"LabelDeleteResponse","example":{"deleted_ids":["7442550215703679004"],"message":"Deleted 2 labels."}},"LabelResponse":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Label name.","examples":["Urgent"]},"description":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Description","description":"Label description.","examples":["Requires same-day customer follow-up."]},"color_code":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Color Code","description":"RGBA hex color code.","default":"#FFFFFFFF","examples":["#FF3B30FF"]},"label_id":{"type":"string","title":"Label Id","description":"Label ID.","examples":[7442550215703679004]}},"type":"object","required":["name","label_id"],"title":"LabelResponse","example":{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","label_id":"7442550215703679004","name":"Urgent"}},"LabelUnassignBody":{"properties":{"unassignments":{"items":{"$ref":"#/components/schemas/LabelAssignBase"},"type":"array","minItems":1,"title":"Unassignments","description":"Chat-label unassignments.","examples":[{"chat_id":7442550215703679004,"label_ids":[7442551216804781021]}]}},"type":"object","required":["unassignments"],"title":"LabelUnassignBody","example":{"unassignments":[{"chat_id":"7442550215703679004","label_ids":["7442551216804781021"]}]}},"LabelUnassignResponse":{"properties":{"unassigned":{"additionalProperties":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object","title":"Unassigned","description":"Mapping of chat IDs to unassigned label IDs.","examples":[{"7442550215703679004":[7442551216804781021]}]},"failed":{"anyOf":[{"additionalProperties":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object"},{"type":"null"}],"title":"Failed","description":"Failed unassignment messages.","examples":[{"7442550215703679004":[7442551216804781021,7442551216804781198]}]}},"type":"object","required":["unassigned"],"title":"LabelUnassignResponse","example":{"failed":{"7442550215703679004":["7442551216804781021","7442551216804781198"]},"unassigned":{"7442550215703679004":["7442551216804781021"]}}},"LabelUpdateBody":{"properties":{"updates":{"items":{"$ref":"#/components/schemas/LabelUpdateItem"},"type":"array","minItems":1,"title":"Updates","description":"Label updates.","examples":[{"color_code":"#34C759FF","label_id":7442550215703679004,"name":"Follow-up"}]}},"type":"object","required":["updates"],"title":"LabelUpdateBody","example":{"updates":[{"color_code":"#34C759FF","label_id":"7442550215703679004","name":"Follow-up"}]}},"LabelUpdateItem":{"properties":{"label_id":{"type":"integer","title":"Label Id","description":"Label ID.","examples":[7442550215703679004]},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name","description":"Updated name.","examples":["Follow-up"]},"description":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Description","description":"Updated description.","examples":["Needs a response within two business days."]},"color_code":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Color Code","description":"Updated color code.","examples":["#34C759FF"]}},"type":"object","required":["label_id"],"title":"LabelUpdateItem","example":{"color_code":"#34C759FF","description":"Needs a response within two business days.","label_id":"7442550215703679004","name":"Follow-up"}},"LabelUpdateResponse":{"properties":{"updated":{"items":{"$ref":"#/components/schemas/LabelResponse"},"type":"array","title":"Updated","description":"Updated labels."}},"type":"object","required":["updated"],"title":"LabelUpdateResponse","example":{"updated":[{"color_code":"#FF3B30FF","description":"Requires same-day customer follow-up.","label_id":"7442550215703679004","name":"Urgent"}]}},"LimitedTimeOfferParam":{"properties":{"type":{"type":"string","const":"LIMITED_TIME_OFFER","title":"Type","description":"Runtime limited-time-offer parameter type.","examples":["LIMITED_TIME_OFFER"]},"expiration_time":{"type":"string","format":"date-time","title":"Expiration Time","description":"Expiration timestamp for limited-time-offer params.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]}},"additionalProperties":false,"type":"object","required":["type","expiration_time"],"title":"LimitedTimeOfferParam"},"ListAgentMcpClientsResponse":{"properties":{"clients":{"items":{"$ref":"#/components/schemas/AgentMcpClientResponse"},"type":"array","title":"Clients"}},"type":"object","title":"ListAgentMcpClientsResponse","example":{"clients":[{"agent_id":"7442550215703679004","enabled":"<enabled>","mcp_client_id":"7442551216804781021","mcp_server_id":"7442551216804781198","name":"accounting"}]}},"ListApiKeysResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApiKeyListItemModel"},"type":"array","title":"Items","description":"Visible API keys."}},"type":"object","title":"ListApiKeysResponse","example":{"items":[{"expires_at":"2027-02-10T11:22:33Z","id":"7442550215703679004","instance":"dev","is_active":true,"is_superuser":true,"kind":"sk","last_used_at":"2027-01-23T05:18:42Z","name":"Local Dev Key","permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"revoked_at":"2027-12-01T07:55:09Z","tenant_id":"7442551216804781021","user_id":"7442678451937742086"}]}},"ListChatsBase":{"properties":{"chat_id":{"type":"string","title":"Chat Id","description":"ID of the chat.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"platform":{"type":"string","title":"Platform","description":"Platform of the chat.","examples":["Whatsapp","API"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Title of the chat.","examples":["Support Chat","Sales Chat"]},"last_activity":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity","description":"Last activity timestamp of the chat.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]},"identifier":{"additionalProperties":{"type":"string"},"type":"object","title":"Identifier","description":"Identifier of the chat.","examples":[{"user_email":"musterassistent@p-cation.de","user_phone_number":"+4917611122233","whatsapp_phone_number":"+4915112349876","whatsapp_verified_name":"Sales Business Name"}]}},"type":"object","required":["chat_id","platform","identifier"],"title":"ListChatsBase","example":{"chat_id":"7442550215703679004","identifier":{"user_email":"musterassistent@p-cation.de","user_phone_number":"+4917611122233","whatsapp_phone_number":"+4915112349876","whatsapp_verified_name":"Sales Business Name"},"last_activity":"2027-02-10T11:22:33Z","platform":"Whatsapp","title":"Support Chat"}},"ListChatsResponse":{"properties":{"chats":{"items":{"$ref":"#/components/schemas/ListChatsBase"},"type":"array","title":"Chats","description":"List of chat entries."}},"type":"object","required":["chats"],"title":"ListChatsResponse","example":{"chats":[{"chat_id":"7442550215703679004","identifier":{"user_email":"musterassistent@p-cation.de","user_phone_number":"+4917611122233","whatsapp_phone_number":"+4915112349876","whatsapp_verified_name":"Sales Business Name"},"last_activity":"2027-02-10T11:22:33Z","platform":"Whatsapp","title":"Support Chat"}]}},"ListDatevInboxDocumentsResponse":{"properties":{"inbox_document_ids":{"items":{"type":"string"},"type":"array","title":"Inbox Document Ids","description":"Inbox document IDs available for download.","examples":[["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","f02bb6a2-7a2f-4c9e-91c9-1d4a2b6f3c10"]]}},"type":"object","required":["inbox_document_ids"],"title":"ListDatevInboxDocumentsResponse","example":{"inbox_document_ids":["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","f02bb6a2-7a2f-4c9e-91c9-1d4a2b6f3c10"]}},"ListDatevInvoicePreviewsResponse":{"properties":{"previews":{"items":{"$ref":"#/components/schemas/DatevInvoicePreviewItem"},"type":"array","title":"Previews","description":"Invoice previews in current scope."}},"type":"object","required":["previews"],"title":"ListDatevInvoicePreviewsResponse","example":{"previews":[{"created_at":"2026-02-10T12:00:00+00:00","datev_profile_id":"7442550215703679004","id":"7442551216804781021","invoice_number":"RE-2026-001","status":"pending","traffiqx_id":"1234567890123","updated_at":"2026-02-10T12:00:00+00:00"}]}},"ListDatevOutboxDocumentsResponse":{"properties":{"outbox_document_ids":{"items":{"type":"string"},"type":"array","title":"Outbox Document Ids","description":"Outbox document IDs available for download.","examples":[["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","f02bb6a2-7a2f-4c9e-91c9-1d4a2b6f3c10"]]},"outbox_documents":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Outbox Documents","description":"Optional outbox document metadata from TRAFFIQX.","examples":[[{"document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","status":"SENT"}]]}},"type":"object","required":["outbox_document_ids"],"title":"ListDatevOutboxDocumentsResponse","example":{"outbox_document_ids":["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","f02bb6a2-7a2f-4c9e-91c9-1d4a2b6f3c10"],"outbox_documents":[{"document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","status":"SENT"}]}},"ListDatevProfilesResponse":{"properties":{"profiles":{"items":{"$ref":"#/components/schemas/DatevProfileListItem"},"type":"array","title":"Profiles","description":"DATEV profiles available in current scope."}},"type":"object","required":["profiles"],"title":"ListDatevProfilesResponse","example":{"profiles":[{"assigned_agent_count":1,"assigned_agent_ids":["7442551216804781198"],"created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","id":"7442550215703679004","name":"Steuerberater","refresh_at":"2026-03-13T09:00:00+00:00","revoked":false,"tokens_expired":false}]}},"ListEmailOfficeIntegrationsResponse":{"properties":{"integrations":{"items":{"$ref":"#/components/schemas/EmailOfficeIntegrationResponse"},"type":"array","title":"Integrations"}},"type":"object","title":"ListEmailOfficeIntegrationsResponse","example":{"integrations":[{"created_at":"2027-02-10T11:22:33Z","email_office_integration_id":"7442550215703679137","enabled":true,"exclude_filters":[{"sender_name":"Automated Notifications"}],"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"integration_identity_id":"7442550215703679004","last_run_started_at":"2028-06-18T04:45:12Z","last_scan_completed_at":"2029-09-29T19:08:54Z","run_interval":30,"run_interval_unit":"seconds","updated_at":"2028-06-18T04:45:12Z"}]}},"ListGroupMembersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GroupMembershipItemModel"},"type":"array","title":"Items","description":"Group memberships."}},"type":"object","title":"ListGroupMembersResponse","example":{"items":[{"group_id":"7442550215703679004","id":"7442678451937742086","is_active":true,"tenant_id":"7443001845129083411","user_id":"7442551216804781021"}]}},"ListGroupRolesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GroupRoleItemModel"},"type":"array","title":"Items","description":"Group role assignments."}},"type":"object","title":"ListGroupRolesResponse","example":{"items":[{"group_id":"7442550215703679004","role_id":"7442551216804781021"}]}},"ListGroupsItem":{"properties":{"id":{"type":"string","title":"Id","description":"Group ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"name":{"type":"string","title":"Name","description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Group description.","examples":["Support staff group."]}},"type":"object","required":["id","tenant_id","name"],"title":"ListGroupsItem","example":{"description":"Support staff group.","id":"7442550215703679004","name":"Support Team","tenant_id":"7442551216804781021"}},"ListGroupsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ListGroupsItem"},"type":"array","title":"Items","description":"Visible groups."}},"type":"object","title":"ListGroupsResponse","example":{"items":[{"description":"Support staff group.","id":"7442550215703679004","name":"Support Team","tenant_id":"7442551216804781021"}]}},"ListIntegrationIdentitiesResponse":{"properties":{"identities":{"items":{"$ref":"#/components/schemas/IntegrationIdentityResponse"},"type":"array","title":"Identities"}},"type":"object","title":"ListIntegrationIdentitiesResponse","example":{"identities":[{"access_token_expires_at":"<access_token_expires_at>","created_at":"<created_at>","granted_scopes":["<granted_scopes>"],"integration_identity_id":"<integration_identity_id>","last_error":"<last_error>","provider":"<provider>","provider_email":"<provider_email>","provider_metadata":"<provider_metadata>","provider_subject":"<provider_subject>","provider_tenant_id":"<provider_tenant_id>","requested_scopes":["<requested_scopes>"],"status":"<status>","updated_at":"<updated_at>"}]}},"ListMcpCatalogResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/McpCatalogEntryResponse"},"type":"array","title":"Entries"}},"type":"object","title":"ListMcpCatalogResponse","example":{"entries":[{"auth_modes":["user_oauth"],"id":"notion","title":"Notion","url":"https://mcp.notion.com/mcp","website_url":"https://www.notion.com"}]}},"ListMcpServerToolsResponse":{"properties":{"tools":{"items":{"$ref":"#/components/schemas/McpServerToolResponse"},"type":"array","title":"Tools"}},"type":"object","title":"ListMcpServerToolsResponse","example":{"tools":[{"effective_policy":"<effective_policy>","name":"search"}]}},"ListMcpServersResponse":{"properties":{"servers":{"items":{"$ref":"#/components/schemas/McpServerResponse"},"type":"array","title":"Servers"}},"type":"object","title":"ListMcpServersResponse","example":{"servers":[{"auth_mode":"<auth_mode>","enabled":"<enabled>","header_names":["Authorization"],"include_instructions":"<include_instructions>","include_return_schema":"<include_return_schema>","init_timeout":"<init_timeout>","max_retries":"<max_retries>","mcp_server_id":"7442551216804781198","name":"<name>","read_timeout":"<read_timeout>","tool_error_behavior":"<tool_error_behavior>","url":"<url>"}]}},"ListPermissionsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PermissionCatalogItemModel"},"type":"array","title":"Items","description":"Permission catalog."}},"type":"object","title":"ListPermissionsResponse","example":{"items":[{"permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"resource":"roles"}]}},"ListResourceGrantsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ResourceGrantListItem"},"type":"array","title":"Items","description":"Visible resource grants."}},"type":"object","title":"ListResourceGrantsResponse","example":{"items":[{"id":"7443001845129083411","permission":"agents.read.granted","resource_id":"7442551216804781021","resource_kind":"knowledgefile","subject_id":"7442678451937742086","subject_kind":"user","tenant_id":"7442550215703679004"}]}},"ListRolePermissionsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RolePermissionListItem"},"type":"array","title":"Items","description":"Role permissions."}},"type":"object","title":"ListRolePermissionsResponse","example":{"items":[{"id":"7442678451937742086","permission":"agents.read.any","role_id":"7443001845129083411"}]}},"ListRoleUsersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RoleUserListItem"},"type":"array","title":"Items","description":"Users assigned to the role."}},"type":"object","title":"ListRoleUsersResponse","example":{"items":[{"role_id":"7442551216804781021","tenant_id":"7442550215703679004","user_id":"7442678451937742086"}]}},"ListRolesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RoleListItem"},"type":"array","title":"Items","description":"Visible roles."}},"type":"object","title":"ListRolesResponse","example":{"items":[{"description":"Can manage tenant resources.","id":"7443001845129083411","name":"Administrator","tenant_id":"7442550215703679004"}]}},"ListTenantMembershipsItem":{"properties":{"id":{"type":"string","title":"Id","description":"Membership ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the membership is active.","examples":[true,false]},"joined_at":{"type":"string","format":"date-time","title":"Joined At","description":"Joined timestamp.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]},"left_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Left At","description":"Left timestamp.","examples":["2027-12-01T07:55:09Z","2028-08-14T13:20:48Z","2029-05-22T21:44:30Z","2030-10-30T02:11:16Z"]}},"type":"object","required":["id","tenant_id","user_id","is_active","joined_at"],"title":"ListTenantMembershipsItem","example":{"id":"7442678451937742086","is_active":true,"joined_at":"2027-02-10T11:22:33Z","left_at":"2027-12-01T07:55:09Z","tenant_id":"7442550215703679004","user_id":"7442551216804781021"}},"ListTenantMembershipsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ListTenantMembershipsItem"},"type":"array","title":"Items","description":"Tenant memberships."}},"type":"object","title":"ListTenantMembershipsResponse","example":{"items":[{"id":"7442678451937742086","is_active":true,"joined_at":"2027-02-10T11:22:33Z","left_at":"2027-12-01T07:55:09Z","tenant_id":"7442550215703679004","user_id":"7442551216804781021"}]}},"ListTenantsItem":{"properties":{"id":{"type":"string","title":"Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"]},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["id","name"],"title":"ListTenantsItem","example":{"domain":"sprizzy.de","id":"7442550215703679004","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"}},"ListTenantsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ListTenantsItem"},"type":"array","title":"Items","description":"Visible tenants."}},"type":"object","title":"ListTenantsResponse","example":{"items":[{"domain":"sprizzy.de","id":"7442550215703679004","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"}]}},"ListUserGroupsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UserGroupMembershipItemModel"},"type":"array","title":"Items","description":"Groups assigned to the user."}},"type":"object","title":"ListUserGroupsResponse","example":{"items":[{"group_id":"7442551216804781021","group_membership_id":"7443001845129083411","is_active":true,"tenant_id":"7442678451937742086","user_id":"7442550215703679004"}]}},"ListUserRolesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UserRoleAssignmentItemModel"},"type":"array","title":"Items","description":"Roles assigned to the user."}},"type":"object","title":"ListUserRolesResponse","example":{"items":[{"role_id":"7442551216804781021","tenant_id":"7442678451937742086","user_id":"7442550215703679004"}]}},"ListUsersItem":{"properties":{"id":{"type":"string","title":"Id","description":"User ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the user is active.","examples":[true,false]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether the user is a superuser.","examples":[true,false]}},"type":"object","required":["id","is_active","is_superuser"],"title":"ListUsersItem","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","full_name":"Sprizzy Musterassistent","id":"7442550215703679004","is_active":true,"is_superuser":true,"last_name":"Musterassistent","phone_number":"+491701234567"}},"ListUsersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ListUsersItem"},"type":"array","title":"Items","description":"Visible users."}},"type":"object","title":"ListUsersResponse","example":{"items":[{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","full_name":"Sprizzy Musterassistent","id":"7442550215703679004","is_active":true,"is_superuser":true,"last_name":"Musterassistent","phone_number":"+491701234567"}]}},"MPMParam":{"properties":{"type":{"type":"string","const":"MPM","title":"Type","description":"Runtime multi-product button parameter type.","examples":["MPM"]},"index":{"type":"integer","minimum":0.0,"title":"Index","description":"Zero-based button index.","examples":[0,1,2]},"thumbnail_product_sku":{"type":"string","minLength":1,"title":"Thumbnail Product Sku","description":"Thumbnail product SKU for MPM buttons.","examples":["SKU-1001","SKU-2001"]},"product_sections":{"items":{"$ref":"#/components/schemas/TemplateSendProductSection"},"type":"array","minItems":1,"title":"Product Sections","description":"MPM button product sections.","examples":[[{"skus":["SKU-1001","SKU-1002"],"title":"Recommended products"},{"skus":["SKU-2001"],"title":"Top sellers"}]]}},"additionalProperties":false,"type":"object","required":["type","index","thumbnail_product_sku","product_sections"],"title":"MPMParam"},"MailboxFilter":{"oneOf":[{"$ref":"#/components/schemas/MailboxSenderFilter"},{"$ref":"#/components/schemas/MailboxTagFilter"}],"discriminator":{"propertyName":"kind","mapping":{"sender":"#/components/schemas/MailboxSenderFilter","tag":"#/components/schemas/MailboxTagFilter"}}},"MailboxFilters":{"properties":{"mailbox":{"$ref":"#/components/schemas/EmailMailbox","default":"inbox"},"include":{"items":{"$ref":"#/components/schemas/MailboxFilter"},"type":"array","maxItems":64,"title":"Include"},"exclude":{"items":{"$ref":"#/components/schemas/MailboxFilter"},"type":"array","maxItems":64,"title":"Exclude"}},"additionalProperties":false,"type":"object","title":"MailboxFilters"},"MailboxIdentity":{"properties":{"namespace":{"type":"string","enum":["microsoft.root-folder.v1","google.oidc-sub.v1"],"title":"Namespace"},"provider_tenant":{"type":"string","title":"Provider Tenant","default":""},"mailbox_id":{"type":"string","maxLength":2048,"minLength":1,"title":"Mailbox Id"}},"additionalProperties":false,"type":"object","required":["namespace","mailbox_id"],"title":"MailboxIdentity"},"MailboxSenderFilter":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"kind":{"type":"string","const":"sender","title":"Kind","default":"sender"}},"additionalProperties":false,"type":"object","title":"MailboxSenderFilter"},"MailboxTagFilter":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"kind":{"type":"string","const":"tag","title":"Kind","default":"tag"}},"additionalProperties":false,"type":"object","title":"MailboxTagFilter"},"McpAppMessageOrigin":{"properties":{"mcp_client_id":{"type":"integer","title":"Mcp Client Id","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"app_history_part_id":{"type":"integer","title":"App History Part Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"client_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Client Message Id"},"prompt_digest":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Digest"}},"type":"object","required":["mcp_client_id","app_history_part_id"],"title":"McpAppMessageOrigin","example":{"app_history_part_id":"7442551216804781021","mcp_client_id":"7442550215703679004"}},"McpAuthMode":{"type":"string","enum":["registration","user_oauth","livoi_identity"]},"McpCatalogEntryResponse":{"properties":{"id":{"type":"string","title":"Id","examples":["notion"]},"title":{"type":"string","title":"Title","description":"Display name.","examples":["Notion"]},"url":{"type":"string","minLength":1,"format":"uri","title":"Url","examples":["https://mcp.notion.com/mcp"]},"website_url":{"type":"string","minLength":1,"format":"uri","title":"Website Url","description":"Vendor website.","examples":["https://www.notion.com"]},"auth_modes":{"items":{"$ref":"#/components/schemas/McpAuthMode"},"type":"array","title":"Auth Modes","description":"Auth modes this server supports. The first one is the default.","examples":[["user_oauth"]]},"documentation_url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Documentation Url","description":"Vendor documentation for this MCP server."},"tool_defaults":{"additionalProperties":{"$ref":"#/components/schemas/McpToolPolicy"},"type":"object","title":"Tool Defaults","description":"Default tool policies. Tools that are not listed are allowed."}},"type":"object","required":["id","title","url","website_url","auth_modes"],"title":"McpCatalogEntryResponse","example":{"auth_modes":["user_oauth"],"id":"notion","title":"Notion","url":"https://mcp.notion.com/mcp","website_url":"https://www.notion.com"}},"McpChatAppMessageBody":{"properties":{"app_history_part_id":{"type":"integer","title":"App History Part Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"client_message_id":{"type":"string","format":"uuid","title":"Client Message Id"},"prompt":{"type":"string","maxLength":8192,"minLength":1,"title":"Prompt","examples":["Summarize this view."]}},"type":"object","required":["app_history_part_id","client_message_id","prompt"],"title":"McpChatAppMessageBody","example":{"app_history_part_id":"7442551216804781021","client_message_id":"<client_message_id>","prompt":"Summarize this view."}},"McpChatAppMessageResponse":{"properties":{"client_message_id":{"type":"string","format":"uuid","title":"Client Message Id"},"status":{"type":"string","enum":["pending","completed","failed","unknown"],"title":"Status"},"chat_id":{"type":"string","title":"Chat Id","examples":["7442550215703679873"]},"history_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"History Id"},"result":{"anyOf":[{"$ref":"#/components/schemas/ChatAwaitResponse"},{"type":"null"}]}},"type":"object","required":["client_message_id","status","chat_id"],"title":"McpChatAppMessageResponse","example":{"chat_id":"<chat_id>","client_message_id":"<client_message_id>","result":{"chat_id":"7442550215703679004","history_id":"7442551216804781021","history_part_types":{"7442551216804781021":"text","7442551216804781198":"tool_call","7442551216804781344":"tool_return","7442551216804781509":"text"},"html_render":{"height":600,"history_part_id":"7442551216804781344","title":"Calculator","version":1},"message":"Hello! How can I help?","type":"text"},"status":"<status>"}},"McpChatDiscoveryResponse":{"properties":{"mcp_client_id":{"type":"string","title":"Mcp Client Id","examples":["7442550215703679873"]},"configuration_version":{"type":"integer","minimum":0.0,"title":"Configuration Version","description":"Current server configuration version. Compare with the app instance before enabling actions."},"integration_identity_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Integration Identity Id","description":"Current user OAuth identity. Null for other auth modes."},"tools":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tools"},"resources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Resources"}},"type":"object","required":["mcp_client_id","configuration_version"],"title":"McpChatDiscoveryResponse","example":{"configuration_version":"<configuration_version>","mcp_client_id":"<mcp_client_id>"}},"McpChatModelContextBody":{"properties":{"app_history_part_id":{"type":"integer","title":"App History Part Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"content":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Content"},"structuredContent":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structuredcontent"}},"type":"object","required":["app_history_part_id"],"title":"McpChatModelContextBody","example":{"app_history_part_id":"7442551216804781021"}},"McpChatModelContextResponse":{"properties":{"history_entry_id":{"type":"string","title":"History Entry Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["history_entry_id"],"title":"McpChatModelContextResponse","example":{"history_entry_id":"7442551216804781021"}},"McpChatResourceBody":{"properties":{"uri":{"type":"string","maxLength":2048,"minLength":1,"title":"Uri"},"app_history_part_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"App History Part Id","description":"Visible tool-return part publishing this UI resource. Required for chat viewers."}},"type":"object","required":["uri"],"title":"McpChatResourceBody","example":{"uri":"<uri>"}},"McpChatResourceResponse":{"properties":{"read_only":{"type":"boolean","title":"Read Only","description":"The caller may display this document without app actions or further server reads.","default":false},"configuration_version":{"type":"integer","minimum":0.0,"title":"Configuration Version","description":"Current server configuration version. Compare with the app instance before enabling actions."},"integration_identity_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Integration Identity Id","description":"Current user OAuth identity. Null for other auth modes."},"contents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Contents"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["configuration_version"],"title":"McpChatResourceResponse","example":{"configuration_version":"<configuration_version>"}},"McpChatToolCallBody":{"properties":{"app_history_part_id":{"type":"integer","title":"App History Part Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"client_call_id":{"type":"string","title":"Client Call Id","examples":["5799e4d0-f7e2-46f7-97c0-4ae276a5f999"]},"tool_name":{"type":"string","maxLength":256,"minLength":1,"title":"Tool Name"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments"}},"type":"object","required":["app_history_part_id","client_call_id","tool_name"],"title":"McpChatToolCallBody","example":{"app_history_part_id":"7442551216804781021","client_call_id":"5799e4d0-f7e2-46f7-97c0-4ae276a5f999","tool_name":"<tool_name>"}},"McpChatToolCallResponse":{"properties":{"client_call_id":{"type":"string","title":"Client Call Id","examples":["5799e4d0-f7e2-46f7-97c0-4ae276a5f999"]},"status":{"type":"string","enum":["completed","pending","unknown"],"title":"Status","examples":["completed"]},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"}},"type":"object","required":["client_call_id","status"],"title":"McpChatToolCallResponse","example":{"client_call_id":"5799e4d0-f7e2-46f7-97c0-4ae276a5f999","status":"completed"}},"McpServerResponse":{"properties":{"mcp_server_id":{"type":"string","title":"Mcp Server Id","description":"MCP server ID.","examples":[7442551216804781198]},"catalog_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Id","description":"Catalog entry this server was installed from. Null for a custom URL."},"integration_identity_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Integration Identity Id","description":"The authenticated user's OAuth identity for this server, if connected."},"name":{"type":"string","title":"Name"},"url":{"type":"string","minLength":1,"format":"uri","title":"Url","description":"Server URL. For custom servers, readers without update permission receive only the origin."},"enabled":{"type":"boolean","title":"Enabled"},"auth_mode":{"$ref":"#/components/schemas/McpAuthMode"},"include_instructions":{"type":"boolean","title":"Include Instructions"},"include_return_schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Return Schema"},"max_retries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Retries"},"tool_error_behavior":{"$ref":"#/components/schemas/McpToolErrorBehavior"},"init_timeout":{"type":"number","title":"Init Timeout"},"read_timeout":{"type":"number","title":"Read Timeout"},"header_names":{"items":{"type":"string"},"type":"array","title":"Header Names","description":"Names of configured HTTP headers. Header values are never returned.","examples":[["Authorization"]]},"tool_policies":{"additionalProperties":{"$ref":"#/components/schemas/McpToolPolicy"},"type":"object","title":"Tool Policies","description":"Tool policy overrides by tool name."},"catalog_tool_defaults":{"additionalProperties":{"$ref":"#/components/schemas/McpToolPolicy"},"type":"object","title":"Catalog Tool Defaults","description":"Tool policy defaults from the catalog entry, also while the entry is disabled. Empty for custom servers."}},"type":"object","required":["mcp_server_id","name","url","enabled","auth_mode","include_instructions","include_return_schema","max_retries","tool_error_behavior","init_timeout","read_timeout"],"title":"McpServerResponse","example":{"auth_mode":"<auth_mode>","enabled":"<enabled>","header_names":["Authorization"],"include_instructions":"<include_instructions>","include_return_schema":"<include_return_schema>","init_timeout":"<init_timeout>","max_retries":"<max_retries>","mcp_server_id":"7442551216804781198","name":"<name>","read_timeout":"<read_timeout>","tool_error_behavior":"<tool_error_behavior>","url":"<url>"}},"McpServerTestBody":{"properties":{"url":{"type":"string","minLength":1,"format":"uri","title":"Url","description":"Remote streamable-HTTP or SSE MCP endpoint to test.","examples":["https://mcp.example.com/mcp"]},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"HTTP headers to send; an empty object sends none. When omitted with an mcp_server_id of a registration server that has stored headers, the stored headers are sent; a URL on another origin then returns 400. Otherwise none are sent.","examples":[{"Authorization":"Bearer mcp_token"}]},"mcp_server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mcp Server Id","description":"Installed server being edited. An omitted headers field reuses its stored registration headers."},"init_timeout":{"type":"number","maximum":120.0,"exclusiveMinimum":0.0,"title":"Init Timeout","description":"MCP session negotiation timeout in seconds.","default":5.0},"read_timeout":{"type":"number","maximum":3600.0,"exclusiveMinimum":0.0,"title":"Read Timeout","description":"Read timeout in seconds for listing the server's tools.","default":300.0}},"additionalProperties":false,"type":"object","required":["url"],"title":"McpServerTestBody","example":{"headers":{"Authorization":"Bearer mcp_token"},"url":"https://mcp.example.com/mcp"}},"McpServerTestResponse":{"properties":{"outcome":{"type":"string","enum":["connected","unauthorized","failed"],"title":"Outcome","description":"connected: the server listed its tools; unauthorized: the test failed after the server answered 401 or 403; failed: any other error."},"http_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Http Status","description":"Status of the rejected HTTP response when unauthorized."},"auth_scheme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Scheme","description":"First scheme of the server's WWW-Authenticate challenge when recognized, such as Bearer.","examples":["Bearer"]}},"type":"object","required":["outcome"],"title":"McpServerTestResponse","example":{"auth_scheme":"Bearer","outcome":"<outcome>"}},"McpServerToolResponse":{"properties":{"name":{"type":"string","title":"Name","examples":["search"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"annotations":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Annotations","description":"Tool annotations reported by the MCP server."},"policy_override":{"anyOf":[{"$ref":"#/components/schemas/McpToolPolicy"},{"type":"null"}],"description":"Policy stored on this server. Null uses the default."},"effective_policy":{"$ref":"#/components/schemas/McpToolPolicy","description":"Policy agents apply: the override, else the catalog default, else allow."}},"type":"object","required":["name","effective_policy"],"title":"McpServerToolResponse","example":{"effective_policy":"<effective_policy>","name":"search"}},"McpToolErrorBehavior":{"type":"string","enum":["failed","retry","error"]},"McpToolName":{"type":"string","maxLength":256,"minLength":1},"McpToolPolicy":{"type":"string","enum":["allow","block"]},"MeResponse":{"properties":{"authenticated":{"type":"boolean","title":"Authenticated","description":"Whether the request is authenticated.","default":true,"examples":[true,false]},"effective_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Effective User Id","description":"Effective user ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"effective_tenant_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Effective Tenant Id","description":"Effective tenant ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"real_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Real User Id","description":"Real user ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"real_tenant_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Real Tenant Id","description":"Real tenant ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"request_id":{"type":"string","title":"Request Id","description":"Request ID.","examples":["req_8f3a21c4","req_b71d90aa","req_c2047ef1","req_f93ab882"]}},"type":"object","required":["request_id"],"title":"MeResponse","example":{"authenticated":true,"effective_tenant_id":"7442551216804781021","effective_user_id":"7442550215703679004","real_tenant_id":"7443001845129083411","real_user_id":"7442678451937742086","request_id":"req_8f3a21c4"}},"MovePromptsBody":{"properties":{"prompt_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true,"title":"Prompt Ids","description":"Identifiers of prompt entries to move.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]},"folder_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Folder Id","description":"Target folder identifier. Set to null to move prompts to root.","examples":[7442678451937742214,null]}},"type":"object","required":["prompt_ids"],"title":"MovePromptsBody","example":{"folder_id":"7442678451937742214","prompt_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]}},"MovePromptsResponse":{"properties":{"moves":{"items":{"$ref":"#/components/schemas/MoveResult"},"type":"array","title":"Moves","description":"List of prompt move operations and their folder transitions.","examples":[[{"folder_id":{"new":"7442678451937742214","previous":"7442678451937742389"},"prompt_ids":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]}],[{"folder_id":{"new":"7442678451937742086","previous":null},"prompt_ids":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}],[{"folder_id":{"new":null,"previous":"7442678451937742214"},"prompt_ids":[744128060820239091]}]]}},"type":"object","required":["moves"],"title":"MovePromptsResponse","example":{"moves":[{"folder_id":{"new":"7442678451937742214","previous":"7442678451937742389"},"prompt_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]}]}},"MoveResult":{"properties":{"prompt_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Prompt Ids","description":"Identifiers of moved prompt entries grouped by previous folder.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]},"folder_id":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__library_models__FieldChange"},{"type":"null"}],"description":"Change details for the folder assignment."}},"type":"object","required":["prompt_ids"],"title":"MoveResult","example":{"folder_id":{"new":"Sales_Outdated","previous":"Sales"},"prompt_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]}},"OAuth2ClientAuthMethod":{"type":"string","enum":["none","client_secret_post","client_secret_basic"]},"OAuth2Provider":{"type":"string","enum":["google","microsoft"],"title":"OAuth2Provider"},"OTPParam":{"properties":{"type":{"type":"string","const":"OTP","title":"Type","description":"Runtime generic OTP button parameter type.","examples":["OTP"]},"otp":{"type":"string","minLength":1,"title":"Otp","description":"OTP value for the authentication body.","examples":["0220292","94604798"]}},"additionalProperties":false,"type":"object","required":["type","otp"],"title":"OTPParam"},"OfficeAccountingSide":{"type":"string","enum":["creditor"],"title":"OfficeAccountingSide"},"OfficeAddNoteAction":{"properties":{"type":{"type":"string","const":"add_note","title":"Type","description":"Add a note to the case. Notes are internal unless they are allowed for AI use."},"content":{"type":"string","maxLength":20000,"minLength":1,"title":"Content"},"allow_ai_use":{"type":"boolean","title":"Allow Ai Use","default":false}},"additionalProperties":false,"type":"object","required":["type","content"],"title":"OfficeAddNoteAction"},"OfficeAddress":{"properties":{"lines":{"items":{"type":"string","maxLength":20000,"minLength":1},"type":"array","maxItems":8,"title":"Lines"},"postal_code":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Postal Code"},"city":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"City"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country"}},"additionalProperties":false,"type":"object","title":"OfficeAddress"},"OfficeAnalysisStatus":{"type":"string","enum":["pending","completed","blocked"],"title":"OfficeAnalysisStatus"},"OfficeAnalysisUncertainty":{"properties":{"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"},"field_name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Field Name"}},"additionalProperties":false,"type":"object","required":["reason"],"title":"OfficeAnalysisUncertainty"},"OfficeAnalysisView":{"properties":{"status":{"$ref":"#/components/schemas/OfficeAnalysisStatus","examples":["completed"]},"evidence":{"items":{"$ref":"#/components/schemas/OfficeFieldEvidence"},"type":"array","title":"Evidence","examples":[[{"artifact_id":7442550215703679137,"excerpt":"Please confirm delivery by 26 October 2026.","field_name":"letter.response_deadline","page_number":1}]]},"uncertainties":{"items":{"$ref":"#/components/schemas/OfficeAnalysisUncertainty"},"type":"array","title":"Uncertainties","examples":[[]]},"failure_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Code","examples":[null]},"failure_explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Explanation","examples":[null]}},"additionalProperties":false,"type":"object","required":["status","evidence","uncertainties","failure_code","failure_explanation"],"title":"OfficeAnalysisView","example":{"evidence":[{"artifact_id":7442550215703679137,"excerpt":"Please confirm delivery by 26 October 2026.","field_name":"letter.response_deadline","page_number":1}],"failure_code":null,"failure_explanation":null,"status":"completed","uncertainties":[]}},"OfficeApplyCreditAction":{"properties":{"type":{"type":"string","const":"apply_credit","title":"Type","description":"Apply the available credit of this credit note to an open invoice of the same supplier and currency."},"invoice_case_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Invoice Case Id"},"idempotency_key":{"type":"string","format":"uuid","title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["type","invoice_case_id","idempotency_key"],"title":"OfficeApplyCreditAction"},"OfficeApproveAction":{"properties":{"type":{"type":"string","const":"approve","title":"Type","description":"Approve the reviewed values. The case continues with letter, invoice or credit note handling, or with completion for other documents. An invoice with nothing left to pay is completed directly."},"acknowledged_reason_keys":{"items":{"type":"string"},"type":"array","title":"Acknowledged Reason Keys"},"invoice_override_reasons":{"additionalProperties":{"type":"string"},"type":"object","maxProperties":32,"title":"Invoice Override Reasons","description":"One explanation per acknowledgement-required invoice finding, keyed by its current review reason key. An explanation for the company assignment confirmation is optional. Include those keys in acknowledged_reason_keys."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeApproveAction"},"OfficeApproveLetterDraftAction":{"properties":{"type":{"type":"string","const":"approve_letter_draft","title":"Type","description":"Approve the previewed letter reply so that it can be sent."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeApproveLetterDraftAction"},"OfficeArchiveAction":{"properties":{"type":{"type":"string","const":"archive","title":"Type","description":"Move a completed case to the archive."},"origin":{"$ref":"#/components/schemas/OfficeArchiveOrigin","default":"manual"}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeArchiveAction"},"OfficeArchiveOrigin":{"type":"string","enum":["manual","automatic"],"title":"OfficeArchiveOrigin"},"OfficeArtifactOrigin":{"type":"string","enum":["received","generated"],"title":"OfficeArtifactOrigin"},"OfficeArtifactParticipation":{"type":"string","enum":["analysis_input","generated_output"],"title":"OfficeArtifactParticipation"},"OfficeArtifactView":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679137]},"parent_artifact_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Parent Artifact Id","description":"Source PDF artifact in the same case for embedded XML; null when no parent is recorded."},"origin":{"$ref":"#/components/schemas/OfficeArtifactOrigin","examples":["received"]},"participation":{"$ref":"#/components/schemas/OfficeArtifactParticipation","examples":["analysis_input"]},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","examples":["delivery-request.pdf"]},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type","examples":["application/pdf"]},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size","examples":[2048]},"content_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Url","description":"Temporary download URL when available. Download original invoice XML with downloadOfficeInvoiceXml using the case and document IDs.","examples":["https://storage.example.test/office/delivery-request.pdf"]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["id","origin","participation","file_name","content_type","size","content_url","created_at"],"title":"OfficeArtifactView","example":{"content_type":"application/pdf","content_url":"https://storage.example.test/office/delivery-request.pdf","created_at":"2026-10-19T09:00:00Z","file_name":"delivery-request.pdf","id":"7442550215703679137","origin":"received","participation":"analysis_input","size":2048}},"OfficeBranchRoute":{"type":"string","enum":["letter","creditor_document","other"],"title":"OfficeBranchRoute"},"OfficeCaseActionType":{"type":"string","enum":["set_invoice_controls","retry_analysis","save_review","approve","save_recommendations","set_recommendation_completion","add_note","set_note_ai_use","resolve_duplicate","dismiss_semantic_duplicates","link_case","unlink_case","generate_letter_draft","save_letter_draft","revise_letter_draft","render_letter_draft","approve_letter_draft","record_letter_dispatch","complete_letter","complete_letter_without_reply","record_payment","resolve_credit","apply_credit","reverse_credit_application","complete_other","correct_completed_case","archive","unarchive"],"title":"OfficeCaseActionType"},"OfficeCaseCorrectionConfirmationRequired":{"properties":{"type":{"type":"string","const":"correction_confirmation_required","title":"Type","default":"correction_confirmation_required","examples":["correction_confirmation_required"]},"message":{"type":"string","title":"Message","examples":["Confirm reopening the affected invoice before correcting this credit."]},"consequences":{"items":{"$ref":"#/components/schemas/OfficeCaseStateChange"},"type":"array","minItems":1,"title":"Consequences"}},"additionalProperties":false,"type":"object","required":["message","consequences"],"title":"OfficeCaseCorrectionConfirmationRequired","example":{"consequences":[{"case_id":"7442550215703679137","current_state":"completed","reason":"Removing the credit makes an invoice balance payable again.","resulting_state":"in_progress"}],"message":"Confirm reopening the affected invoice before correcting this credit.","type":"correction_confirmation_required"}},"OfficeCaseCreateItem":{"properties":{"case_id":{"type":"string","title":"Case Id","examples":[7442550215703679004]},"exact_duplicate":{"type":"boolean","title":"Exact Duplicate","examples":[false]},"document_count":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Document Count","description":"Omitted when per_document creates one case per document."}},"additionalProperties":false,"type":"object","required":["case_id","exact_duplicate"],"title":"OfficeCaseCreateItem","example":{"case_id":"7442550215703679004","exact_duplicate":false}},"OfficeCaseCreateResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OfficeCaseCreateItem"},"type":"array","title":"Items","description":"One entry per created case."}},"additionalProperties":false,"type":"object","required":["items"],"title":"OfficeCaseCreateResponse","example":{"items":[{"case_id":"7442550215703679004","exact_duplicate":false}]}},"OfficeCaseDeleteBody":{"properties":{"confirm_permanent_deletion":{"type":"boolean","title":"Confirm Permanent Deletion","description":"Set to false to assess deletion or true to permanently delete the case.","examples":[false]}},"type":"object","required":["confirm_permanent_deletion"],"title":"OfficeCaseDeleteBody","example":{"confirm_permanent_deletion":false}},"OfficeCaseDeletionAllowed":{"properties":{"allowed":{"type":"boolean","const":true,"title":"Allowed","default":true,"examples":[true]},"message":{"type":"string","title":"Message","examples":["The case can be permanently deleted."]},"consequences":{"$ref":"#/components/schemas/OfficeCaseDeletionConsequences"}},"additionalProperties":false,"type":"object","required":["message","consequences"],"title":"OfficeCaseDeletionAllowed","example":{"allowed":true,"consequences":{"analysis_processing_stopped":false,"case_state_changes":[],"documents_deleted":1,"draft_processing_stopped":false,"relationships_removed":[]},"message":"The case can be permanently deleted."}},"OfficeCaseDeletionBlocked":{"properties":{"allowed":{"type":"boolean","const":false,"title":"Allowed","default":false,"examples":[false]},"message":{"type":"string","title":"Message","examples":["The case cannot be permanently deleted."]},"blockers":{"items":{"oneOf":[{"$ref":"#/components/schemas/OfficeFinalizedCreditDependencyDeletionBlocker"},{"$ref":"#/components/schemas/OfficeThreadMembersDeletionBlocker"},{"$ref":"#/components/schemas/OfficeRelatedCaseUpdateDeletionBlocker"},{"$ref":"#/components/schemas/OfficeFinancialRecordDeletionBlocker"}],"discriminator":{"propertyName":"type","mapping":{"authoritative_thread_has_members":"#/components/schemas/OfficeThreadMembersDeletionBlocker","finalized_credit_dependency":"#/components/schemas/OfficeFinalizedCreditDependencyDeletionBlocker","financial_record_exists":"#/components/schemas/OfficeFinancialRecordDeletionBlocker","related_case_update_required":"#/components/schemas/OfficeRelatedCaseUpdateDeletionBlocker"}}},"type":"array","minItems":1,"title":"Blockers"}},"additionalProperties":false,"type":"object","required":["message","blockers"],"title":"OfficeCaseDeletionBlocked","example":{"allowed":false,"blockers":[{"message":"A finalized invoice depends on this credit.","related_cases":[{"id":"7442550215703679137","state":"completed","title":"Invoice INV-2026-1042"}],"type":"finalized_credit_dependency"}],"message":"The case cannot be permanently deleted."}},"OfficeCaseDeletionConsequences":{"properties":{"documents_deleted":{"type":"integer","minimum":0.0,"title":"Documents Deleted","examples":[1]},"analysis_processing_stopped":{"type":"boolean","title":"Analysis Processing Stopped","examples":[false]},"draft_processing_stopped":{"type":"boolean","title":"Draft Processing Stopped","examples":[false]},"relationships_removed":{"items":{"$ref":"#/components/schemas/OfficeDeletionRelationship"},"type":"array","title":"Relationships Removed","examples":[[]]},"case_state_changes":{"items":{"$ref":"#/components/schemas/OfficeCaseStateChange"},"type":"array","title":"Case State Changes","examples":[[]]}},"additionalProperties":false,"type":"object","required":["documents_deleted","analysis_processing_stopped","draft_processing_stopped","relationships_removed","case_state_changes"],"title":"OfficeCaseDeletionConsequences","example":{"analysis_processing_stopped":false,"case_state_changes":[],"documents_deleted":1,"draft_processing_stopped":false,"relationships_removed":[]}},"OfficeCaseDocumentsBody":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/RequireAllowedOfficeDocumentUpload"},"type":"array","minItems":1,"title":"Documents","description":"One or more source documents, including XML and PDF when enabled by the upload configuration. Acceptance confirms intake, not invoice validity.","examples":[["delivery-request.pdf"]]},"per_document":{"type":"boolean","title":"Per Document","description":"For case creation, create one case per uploaded document when true, or group the documents when false. When adding documents to an existing case, all documents belong to that case regardless of this value.","default":true,"examples":[true]}},"type":"object","required":["documents"],"title":"OfficeCaseDocumentsBody","example":{"documents":["delivery-request.pdf"],"per_document":true}},"OfficeCaseEventType":{"type":"string","enum":["case_created","case_archived","case_corrected","case_reopened","document_added","analysis_retry_requested","analysis_completed","analysis_blocked","review_saved","case_approved","case_auto_approved","recommendations_changed","recommendation_completion_changed","note_created","note_ai_consent_changed","duplicate_detected","duplicate_dismissed","duplicate_discarded","duplicate_replaced","case_linked","case_unlinked","letter_draft_requested","letter_draft_ready","letter_draft_failed","letter_draft_approved","letter_dispatch_recorded","letter_completed","letter_completed_without_reply","invoice_payment_recorded","credit_resolved","other_completed","case_unarchived"],"title":"OfficeCaseEventType"},"OfficeCaseListItem":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679004]},"state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["review_required"]},"document_type":{"anyOf":[{"$ref":"#/components/schemas/OfficeDocumentType"},{"type":"null"}],"examples":["letter"]},"route":{"anyOf":[{"$ref":"#/components/schemas/OfficeBranchRoute"},{"type":"null"}],"examples":["letter"]},"analysis_status":{"anyOf":[{"$ref":"#/components/schemas/OfficeAnalysisStatus"},{"type":"null"}],"examples":["completed"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","examples":["Request for delivery confirmation"]},"key_recommendation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Recommendation","description":"First recommended action; null when case values are unavailable or no substantive user action is supported.","examples":["Confirm the delivery date."]},"sender":{"anyOf":[{"$ref":"#/components/schemas/OfficeParty"},{"type":"null"}],"examples":[{"email":"office@example.test","organization":"Example Supplies GmbH"}]},"payable_amount":{"anyOf":[{"$ref":"#/components/schemas/OfficeMoney"},{"type":"null"}],"description":"Amount due and currency stated by the invoice: the approved value once approved, otherwise the current analysis or review value. Prepayments stated on the invoice are already deducted; recorded payments and linked credits are not. Null for non-invoice documents or when no amount is known.","examples":[{"amount":"125.00","currency":"EUR"}]},"handling_step":{"$ref":"#/components/schemas/OfficeHandlingStep","examples":["review"]},"queues":{"items":{"$ref":"#/components/schemas/OfficeCaseQueue"},"type":"array","title":"Queues","description":"All calculated dashboard queues matched by this case, in effective queue priority order.","examples":[["review","deadlines"]]},"next_action_deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Next Action Deadline","examples":["2026-10-26"]},"overdue":{"type":"boolean","title":"Overdue","examples":[false]},"change_history":{"items":{"$ref":"#/components/schemas/OfficeHistoryEntry"},"type":"array","title":"Change History","examples":[[{"changed_at":"2026-10-19T09:00:00Z","user_id":null}]]},"last_activity":{"type":"string","format":"date-time","title":"Last Activity","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["id","state","document_type","route","analysis_status","title","key_recommendation","sender","payable_amount","handling_step","queues","next_action_deadline","overdue","change_history","last_activity"],"title":"OfficeCaseListItem","example":{"analysis_status":"completed","change_history":[{"changed_at":"2026-10-19T09:00:00Z","user_id":null}],"document_type":"letter","handling_step":"review","id":"7442550215703679004","key_recommendation":"Confirm the delivery date.","last_activity":"2026-10-19T09:00:00Z","next_action_deadline":"2026-10-26","overdue":false,"payable_amount":{"amount":"125.00","currency":"EUR"},"queues":["review","deadlines"],"route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}},"OfficeCaseListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OfficeCaseListItem"},"type":"array","title":"Items"},"counts":{"$ref":"#/components/schemas/OfficeOperationalCounts"},"page":{"$ref":"#/components/schemas/PageResponse","examples":[{"has_next":false,"number":"1","size":"50","total":"1"}]}},"additionalProperties":false,"type":"object","required":["items","counts","page"],"title":"OfficeCaseListResponse","example":{"counts":{"archived":0,"completed":0,"creditor_documents":0,"deadlines":1,"errors":0,"in_progress":0,"review":1,"system_processing":0},"items":[{"analysis_status":"completed","change_history":[{"changed_at":"2026-10-19T09:00:00Z","user_id":null}],"document_type":"letter","handling_step":"review","id":"7442550215703679004","key_recommendation":"Confirm the delivery date.","last_activity":"2026-10-19T09:00:00Z","next_action_deadline":"2026-10-26","overdue":false,"payable_amount":{"amount":"125.00","currency":"EUR"},"queues":["review","deadlines"],"route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}],"page":{"has_next":false,"number":"1","size":"50","total":"1"}}},"OfficeCaseQueue":{"type":"string","enum":["errors","deadlines","review","creditor_documents","system_processing","in_progress","completed","archived"],"title":"OfficeCaseQueue","description":"Calculated, overlapping dashboard categories for Office cases."},"OfficeCaseState":{"type":"string","enum":["analysis_pending","review_required","in_progress","completed","archived"],"title":"OfficeCaseState"},"OfficeCaseStateChange":{"properties":{"case_id":{"type":"string","title":"Case Id","examples":[7442550215703679137]},"current_state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["completed"]},"resulting_state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["in_progress"]},"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason","examples":["Removing the credit makes an invoice balance payable again."]}},"additionalProperties":false,"type":"object","required":["case_id","current_state","resulting_state","reason"],"title":"OfficeCaseStateChange","example":{"case_id":"7442550215703679137","current_state":"completed","reason":"Removing the credit makes an invoice balance payable again.","resulting_state":"in_progress"}},"OfficeCaseThreadView":{"properties":{"root_case_id":{"type":"string","title":"Root Case Id","examples":[7442550215703679004]},"role":{"type":"string","enum":["root","member"],"title":"Role","examples":["root"]},"is_active":{"type":"boolean","title":"Is Active","description":"True when at least one case in the thread has a non-terminal lifecycle state.","examples":[true]},"member_count":{"type":"integer","minimum":1.0,"title":"Member Count","examples":[1]},"members":{"items":{"$ref":"#/components/schemas/OfficeThreadCaseSummary"},"type":"array","title":"Members"}},"additionalProperties":false,"type":"object","required":["root_case_id","role","is_active","member_count","members"],"title":"OfficeCaseThreadView","example":{"is_active":true,"member_count":1,"members":[{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","state":"review_required","title":"Request for delivery confirmation"}],"role":"root","root_case_id":"7442550215703679004"}},"OfficeCaseValues":{"properties":{"document_type":{"$ref":"#/components/schemas/OfficeDocumentType","description":"{'letter': 'General business or personal correspondence whose primary purpose is to communicate information, make a request, provide a reply, or issue a notice. Use only when no more specific document type such as invoice, tax, bank, insurance, or legal matter applies.', 'invoice': 'Invoice requesting payment for supplied goods or services when the document cannot be reliably identified as an incoming supplier or creditor invoice. Typically contains invoice number, amounts, taxes, due date, and payment details. Excludes receipts and credit notes.', 'credit_note': 'Incoming supplier credit note, credit memo, or Gutschrift that reduces, cancels, refunds, or corrects amounts from an earlier supplier invoice. Typically references a previous invoice or transaction and represents a credit, not a new payment request.', 'creditor_invoice': 'Incoming supplier invoice that creates an amount payable to a vendor or creditor for goods or services received. Classify here only when the supplier relationship is clear. Excludes customer invoices, receipts, supplier credit notes, and invoices with unclear direction.', 'receipt': 'Proof that a purchase or payment has already been completed, usually issued at the point of sale. Typically shows merchant, date, paid amount, payment method, and purchased items or services. Excludes unpaid invoices, payment requests, and supplier credit notes.', 'insurance': 'Document concerning insurance policies, premiums, claims, coverage, benefits, contracts, renewals, cancellations, or communication with an insurer. Use for non-health insurance only. Excludes health insurance documents and unrelated financial or legal correspondence.', 'health_insurance': 'Document specifically concerning German or other health insurance, including membership, contributions, coverage, benefits, claims, reimbursements, certificates, or communication with a health insurer. Excludes other insurance types and general medical documents.', 'tax': 'Document concerning taxes, tax authorities, tax obligations, assessments, returns, payments, refunds, deductions, audits, notices, or related correspondence. Use for tax matters that are not specifically German income tax when a more precise tax type is unavailable.', 'income_tax': 'Document specifically concerning German income tax, including income tax returns, tax assessments, advance payments, refunds, objections, deadlines, requested evidence, or correspondence with the tax office. Excludes other taxes such as VAT or trade tax.', 'bank_account_statement': 'Periodic bank account statement for a defined reporting period showing account holder or account data, opening or closing balance, and multiple transactions. Classify here only for account statements. Excludes single-event bank notices or transaction alerts.', 'bank_notification': 'Bank-issued notice concerning a specific banking event, transaction, fee, account change, security issue, payment action, financing matter, or required response. Use when the document is not a periodic account statement and focuses on one event or issue.', 'fleet': 'Document concerning company-owned, leased, rented, or otherwise managed vehicles and fleet administration. Includes vehicle data, leasing, fuel, maintenance, repairs, registration, insurance references, usage, costs, or driver assignments when the fleet context is primary.', 'delivery_note': 'Delivery note or Lieferschein confirming goods that were shipped, delivered, or received. Typically lists sender, recipient, delivery date, item names, quantities, and order references. Its primary purpose is proof of delivery, not requesting payment for the goods.', 'legal_matter': 'Document whose primary subject is a legal matter, dispute, claim, court case, lawyer activity, formal legal notice, enforcement action, contract dispute, or legal obligation. Use when legal proceedings or legal rights are central, not merely because a document contains legal wording.', 'certificate': 'Official or formal certificate whose primary purpose is to confirm, attest, or certify a status, qualification, authorization, completion, origin, condition, membership, or other verifiable fact. Excludes ordinary letters, invoices, contracts, and informational notices.', 'real_estate': 'Document primarily concerning real estate, land, buildings, rental units, leases, tenancy, property ownership, property management, utilities, maintenance, valuation, sale, purchase, or related property administration. Use only when the property context is the main subject.', 'personnel': 'Document primarily concerning employees, applicants, or employment relationships, including employment contracts, payroll, working time, leave, benefits, applications, warnings, certificates, personnel changes, or HR administration. Excludes unrelated general business correspondence.', 'advertising': 'Promotional or marketing material whose primary purpose is to advertise, promote, sell, or generate interest in products, services, offers, events, or a brand. Includes unsolicited promotional mail and brochures. Excludes transactional notices, invoices, and ordinary correspondence.', 'other': 'Fallback category for documents that cannot be classified reliably into any supported type after considering their primary purpose and content. Use only when no specific category clearly applies or the document lacks enough information for a confident classification.'}"},"accounting_side":{"anyOf":[{"$ref":"#/components/schemas/OfficeAccountingSide"},{"type":"null"}],"description":"Accounting classification; creditor for incoming invoices and incoming credit notes."},"title":{"type":"string","maxLength":160,"minLength":1,"title":"Title","description":"One concise user-facing overview sentence identifying the case by its most distinguishing document-supported point, without generic boilerplate. Include a party, subject, reference, amount, deadline, or required action only when it distinguishes the case."},"summary":{"type":"string","maxLength":20000,"minLength":1,"title":"Summary","description":"A clear, factual Markdown summary optimized for skim reading. Adapt the use of short paragraphs, and bullet points to the document. No use of headings."},"document_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Document Date","description":"Date of the source document; null when no document date is sufficiently supported."},"received_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Received On","description":"Best document-supported inbound date, preferring a postal receipt stamp, then an email receipt or extraction date, then a scan date. This is distinct from the document date and technical creation or upload timestamps; null when no inbound date is sufficiently supported."},"correspondence_reference":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Correspondence Reference","description":"Stable external case, file, or correspondence reference stated by the document. This is distinct from invoice numbers and payment references; null when no such identifier is sufficiently supported."},"next_action_deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Next Action Deadline","description":"Earliest supported date governing a current, material action expected from the user. The required action must be explicit; its date may be stated directly or calculated from a supported relative period. It is distinct from document dates, invoice due dates, and letter response dates. Automatic direct debit and explicitly completed payment do not create a payment action deadline, but a separate objection or response deadline qualifies when it requires current user action. Use null when no sufficiently supported action deadline exists."},"sender":{"anyOf":[{"$ref":"#/components/schemas/OfficeParty"},{"type":"null"}],"description":"Party that sent the incoming document and, for a reply letter, receives the outgoing draft."},"recipients":{"items":{"$ref":"#/components/schemas/OfficeParty"},"type":"array","maxItems":30,"title":"Recipients","description":"Parties to whom the incoming document is addressed."},"letter":{"anyOf":[{"$ref":"#/components/schemas/OfficeLetterData"},{"type":"null"}]},"creditor_document":{"anyOf":[{"$ref":"#/components/schemas/OfficeCreditorDocumentData"},{"type":"null"}]},"other_outcome":{"anyOf":[{"$ref":"#/components/schemas/OfficeOtherOutcomeData"},{"type":"null"}]},"additional_facts":{"patternProperties":{"^[a-z][a-z0-9_]{0,99}$":{"type":"string","maxLength":20000,"minLength":1}},"type":"object","maxProperties":30,"title":"Additional Facts","description":"Case facts that are materially useful for understanding, handling, or responding to the case and have no available typed field for the selected document type. Keep the mapping sparse: omit incidental details, speculation, summary restatements, and duplicates of typed values."}},"additionalProperties":false,"type":"object","required":["document_type","title","summary","next_action_deadline"],"title":"OfficeCaseValues"},"OfficeCaseValuesPatch":{"properties":{"document_type":{"anyOf":[{"$ref":"#/components/schemas/OfficeDocumentType"},{"type":"null"}],"description":"A document type change may be combined with other review edits. The type change transfers existing facts first; explicitly supplied fields then update the transferred values in the same save."},"accounting_side":{"anyOf":[{"$ref":"#/components/schemas/OfficeAccountingSide"},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":160,"minLength":1,"description":"One concise user-facing overview sentence identifying the case by its most distinguishing document-supported point, without generic boilerplate. Include a party, subject, reference, amount, deadline, or required action only when it distinguishes the case."},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string","maxLength":20000,"minLength":1},{"type":"null"}],"title":"Summary"},"document_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Document Date","description":"Date of the source document; null means no document date is established."},"received_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Received On","description":"Document-supported postal receipt, email receipt or extraction, or scan date. Null clears the reviewed value; technical creation and upload timestamps are not receipt dates."},"correspondence_reference":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Correspondence Reference","description":"External case, file, or correspondence reference. This is distinct from invoice numbers and payment references; null clears the reviewed value."},"next_action_deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Next Action Deadline","description":"Earliest supported date governing a current, material action expected from the user. The required action must be explicit; its date may be stated directly or calculated from a supported relative period. It is distinct from document dates, invoice due dates, and letter response dates. Automatic direct debit and explicitly completed payment do not create a payment action deadline, but a separate objection or response deadline qualifies when it requires current user action. Null means no sufficiently supported action deadline is established."},"sender":{"anyOf":[{"$ref":"#/components/schemas/OfficePartyPatch"},{"type":"null"}],"description":"Party that sent the incoming document and, for a reply letter, receives the outgoing draft."},"recipients":{"anyOf":[{"items":{"$ref":"#/components/schemas/OfficeParty"},"type":"array","maxItems":30},{"type":"null"}],"title":"Recipients","description":"Parties to whom the incoming document is addressed."},"letter":{"anyOf":[{"$ref":"#/components/schemas/OfficeLetterFacts"},{"type":"null"}]},"creditor_document":{"anyOf":[{"$ref":"#/components/schemas/OfficeCreditorDocumentFactsPatch"},{"type":"null"}]},"additional_facts":{"anyOf":[{"patternProperties":{"^[a-z][a-z0-9_]{0,99}$":{"anyOf":[{"type":"string","maxLength":20000,"minLength":1},{"type":"null"}]}},"type":"object","maxProperties":30},{"type":"null"}],"title":"Additional Facts","description":"Edits to material case facts that have no canonical typed field. A supplied mapping adds or updates individual entries; omitted keys remain unchanged and a null entry value removes that key. Omit the field or send an empty object to keep the mapping unchanged; null clears the entire mapping."}},"additionalProperties":false,"type":"object","title":"OfficeCaseValuesPatch"},"OfficeCaseView":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679004]},"state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["review_required"]},"archive_origin":{"anyOf":[{"$ref":"#/components/schemas/OfficeArchiveOrigin"},{"type":"null"}],"description":"Whether an archived case was archived manually or automatically; null unless archived.","examples":[null]},"invoice_controls":{"anyOf":[{"$ref":"#/components/schemas/OfficeInvoiceControls"},{"type":"null"}],"description":"Payment controls of an invoice case, also shown while retained controls block reclassification; null otherwise.","examples":[{"approval_required":false,"obligation_exception":null,"payment_hold":false}]},"financial_status":{"anyOf":[{"type":"string","enum":["open","settled","overpaid"]},{"type":"null"}],"title":"Financial Status","description":"Balance status after credits and recorded payments. `open` means an amount remains due, `settled` means the balance is zero, and `overpaid` means payments exceed the amount due. Null when no invoice balance is available. Case completion can still depend on pending credits or payment controls.","examples":["open"]},"financial_review_required":{"type":"boolean","title":"Financial Review Required","description":"True when an approved invoice has active payment controls, an overpayment, or an outstanding balance while archived.","default":false,"examples":[false]},"route":{"anyOf":[{"$ref":"#/components/schemas/OfficeBranchRoute"},{"type":"null"}],"examples":["letter"]},"allowed_actions":{"items":{"$ref":"#/components/schemas/OfficeCaseActionType"},"type":"array","title":"Allowed Actions","examples":[["save_review","approve","add_note"]]},"process_overview":{"$ref":"#/components/schemas/OfficeProcessOverviewView"},"values":{"anyOf":[{"$ref":"#/components/schemas/OfficeCaseValues"},{"type":"null"}],"examples":[{"document_date":"2026-10-19","document_type":"letter","letter":{"reply_required":true,"response_deadline":"2026-10-26","subject":"Request for delivery confirmation"},"next_action_deadline":"2026-10-26","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"summary":"The supplier requests delivery confirmation by 26 October 2026.","title":"Request for delivery confirmation"}]},"analysis":{"anyOf":[{"$ref":"#/components/schemas/OfficeAnalysisView"},{"type":"null"}]},"review":{"anyOf":[{"$ref":"#/components/schemas/OfficeReviewView"},{"type":"null"}]},"approved_by_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Approved By User Id","examples":[null]},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At","examples":[null]},"documents":{"items":{"$ref":"#/components/schemas/OfficeArtifactView"},"type":"array","title":"Documents"},"duplicate_candidates":{"items":{"$ref":"#/components/schemas/OfficeDuplicateCandidate"},"type":"array","title":"Duplicate Candidates","examples":[[]]},"thread":{"$ref":"#/components/schemas/OfficeCaseThreadView"},"thread_link_suggestions":{"items":{"oneOf":[{"$ref":"#/components/schemas/OfficeCorrespondenceThreadLinkSuggestion"},{"$ref":"#/components/schemas/OfficeSemanticThreadLinkSuggestion"}],"discriminator":{"propertyName":"type","mapping":{"correspondence_reference":"#/components/schemas/OfficeCorrespondenceThreadLinkSuggestion","semantic_analysis":"#/components/schemas/OfficeSemanticThreadLinkSuggestion"}}},"type":"array","title":"Thread Link Suggestions","examples":[[]]},"letter":{"anyOf":[{"$ref":"#/components/schemas/OfficeLetterView"},{"type":"null"}]},"creditor_document":{"anyOf":[{"$ref":"#/components/schemas/OfficeCreditorDocumentView"},{"type":"null"}],"examples":[null]},"other":{"anyOf":[{"$ref":"#/components/schemas/OfficeOtherView"},{"type":"null"}],"examples":[null]},"recommendations":{"items":{"$ref":"#/components/schemas/OfficeRecommendationView"},"type":"array","title":"Recommendations"},"notes":{"items":{"$ref":"#/components/schemas/OfficeNoteView"},"type":"array","title":"Notes"},"history":{"items":{"$ref":"#/components/schemas/OfficeHistoryItem"},"type":"array","title":"History"},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2026-10-19T09:00:00Z"]},"updated_at":{"type":"string","format":"date-time","title":"Updated At","examples":["2026-10-19T09:00:00Z"]},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","examples":[null]}},"additionalProperties":false,"type":"object","required":["id","state","route","allowed_actions","process_overview","values","analysis","review","approved_by_user_id","approved_at","documents","duplicate_candidates","thread","thread_link_suggestions","letter","creditor_document","other","recommendations","notes","history","created_at","updated_at","completed_at"],"title":"OfficeCaseView","example":{"allowed_actions":["save_review","approve","add_note"],"analysis":{"evidence":[{"artifact_id":7442550215703679137,"excerpt":"Please confirm delivery by 26 October 2026.","field_name":"letter.response_deadline","page_number":1}],"failure_code":null,"failure_explanation":null,"status":"completed","uncertainties":[]},"approved_at":null,"approved_by_user_id":null,"completed_at":null,"created_at":"2026-10-19T09:00:00Z","creditor_document":null,"documents":[{"content_type":"application/pdf","content_url":"https://storage.example.test/office/delivery-request.pdf","created_at":"2026-10-19T09:00:00Z","file_name":"delivery-request.pdf","id":"7442550215703679137","origin":"received","participation":"analysis_input","size":2048}],"duplicate_candidates":[],"financial_review_required":false,"financial_status":"open","history":[{"actor_user_id":"7442551216804781021","id":"7442550215703679137","occurred_at":"2026-10-19T09:00:00Z","type":"case_created"}],"id":"7442550215703679004","invoice_controls":{"approval_required":false,"obligation_exception":null,"payment_hold":false},"letter":{"accepted_body":null,"accepted_subject":null,"approved_reply_id":null,"completed_without_reply_reason":null,"draft":null,"replies":[],"reply_required":true},"notes":[{"allow_ai_use":false,"content":"Check the delivery receipt before replying.","created_at":"2026-10-19T09:00:00Z","created_by_user_id":"7442551216804781021","id":"7442550215703679137"}],"other":null,"process_overview":{"current":{"state":"review_required","step":"review"},"next":[{"availability":"available","state":"in_progress","step":"letter_draft","via_action":"approve"}],"previous":{"occurred_at":"2026-10-19T09:00:00Z","step":"analysis"},"terminal":false},"recommendations":[{"completed":false,"completed_at":null,"completed_by_user_id":null,"completion_note":null,"created_at":"2026-10-19T09:00:00Z","created_by_user_id":null,"id":"7442550215703679137","position":0,"text":"Confirm the delivery date.","updated_at":"2026-10-19T09:00:00Z"}],"review":{"provenance":{"letter.response_deadline":"analysis","summary":"analysis"},"reasons":[]},"route":"letter","state":"review_required","thread":{"is_active":true,"member_count":1,"members":[{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","state":"review_required","title":"Request for delivery confirmation"}],"role":"root","root_case_id":"7442550215703679004"},"thread_link_suggestions":[],"updated_at":"2026-10-19T09:00:00Z","values":{"document_date":"2026-10-19","document_type":"letter","letter":{"reply_required":true,"response_deadline":"2026-10-26","subject":"Request for delivery confirmation"},"next_action_deadline":"2026-10-26","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"summary":"The supplier requests delivery confirmation by 26 October 2026.","title":"Request for delivery confirmation"}}},"OfficeCompleteLetterAction":{"properties":{"type":{"type":"string","const":"complete_letter","title":"Type","description":"Complete a letter case after its reply was sent."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeCompleteLetterAction"},"OfficeCompleteLetterWithoutReplyAction":{"properties":{"type":{"type":"string","const":"complete_letter_without_reply","title":"Type","description":"Complete a letter case that needs no reply, optionally with a reason."},"reason":{"anyOf":[{"type":"string","maxLength":20000,"minLength":1},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeCompleteLetterWithoutReplyAction"},"OfficeCompleteOtherAction":{"properties":{"type":{"type":"string","const":"complete_other","title":"Type","description":"Complete a case that is neither a letter nor an invoice or credit note, and record why no further handling is needed."},"disposition":{"$ref":"#/components/schemas/OfficeOtherDisposition"},"explanation":{"anyOf":[{"type":"string","maxLength":20000,"minLength":1},{"type":"null"}],"title":"Explanation"}},"additionalProperties":false,"type":"object","required":["type","disposition"],"title":"OfficeCompleteOtherAction"},"OfficeConfigurationAssetsBody":{"properties":{"template":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Template","description":"Optional current DOCX template.","examples":["letter-template.docx"]},"signature":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Signature","description":"Optional PNG/JPEG signature.","examples":["signature.png"]}},"type":"object","title":"OfficeConfigurationAssetsBody","example":{"signature":"signature.png","template":"letter-template.docx"}},"OfficeConfigurationPatch":{"properties":{"sender":{"anyOf":[{"$ref":"#/components/schemas/OfficePartyPatch"},{"type":"null"}],"description":"Omit to keep the sender unchanged, null to clear it, or provide only the sender fields to update."},"payment_methods":{"anyOf":[{"items":{"$ref":"#/components/schemas/OfficeConfigurationPaymentMethodPatch"},"type":"array"},{"type":"null"}],"title":"Payment Methods"},"required_review_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/OfficeRequiredReviewField"},"type":"array"},{"type":"null"}],"title":"Required Review Fields"},"letter_date_format":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Letter Date Format","description":"Generated-letter date format using Python strftime syntax.","examples":["%d.%m.%Y"]},"auto_approve_optimistic":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Approve Optimistic","description":"Omit to keep the current setting. Enables automatic approval when analysis completes without blocking review reasons."},"clear_signature":{"type":"boolean","title":"Clear Signature","default":false}},"additionalProperties":false,"type":"object","title":"OfficeConfigurationPatch"},"OfficeConfigurationPaymentMethod":{"properties":{"name":{"type":"string","maxLength":300,"minLength":1,"title":"Name"},"kind":{"$ref":"#/components/schemas/OfficePaymentMethodKind"},"iban":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iban","description":"Tenant-owned IBAN; required only for bank accounts."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Tenant PayPal email; required only for PayPal methods."},"id":{"type":"string","title":"Id","examples":["7442550215703679873"]}},"additionalProperties":false,"type":"object","required":["name","kind","id"],"title":"OfficeConfigurationPaymentMethod"},"OfficeConfigurationPaymentMethodPatch":{"properties":{"name":{"type":"string","maxLength":300,"minLength":1,"title":"Name"},"kind":{"$ref":"#/components/schemas/OfficePaymentMethodKind"},"iban":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iban","description":"Tenant-owned IBAN; required only for bank accounts."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Tenant PayPal email; required only for PayPal methods."}},"additionalProperties":false,"type":"object","required":["name","kind"],"title":"OfficeConfigurationPaymentMethodPatch"},"OfficeConfigurationResponse":{"properties":{"sender":{"anyOf":[{"$ref":"#/components/schemas/OfficeParty"},{"type":"null"}],"examples":[{"email":"hello@example.test","organization":"Example Services GmbH"}]},"template_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Url","examples":["https://storage.example.test/office/template.docx"]},"signature_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature Url","examples":[null]},"payment_methods":{"items":{"$ref":"#/components/schemas/OfficeConfigurationPaymentMethod"},"type":"array","title":"Payment Methods","examples":[[{"iban":"DE89370400440532013000","id":7442550215703679137,"kind":"bank_account","name":"Business account"}]]},"required_review_fields":{"items":{"$ref":"#/components/schemas/OfficeRequiredReviewField"},"type":"array","title":"Required Review Fields","examples":[["document_type","summary"]]},"letter_date_format":{"type":"string","title":"Letter Date Format","examples":["%d.%m.%Y"]},"auto_approve_optimistic":{"type":"boolean","title":"Auto Approve Optimistic","description":"When true, a case whose analysis completes without blocking review reasons is approved automatically without a manual approve action.","examples":[false]}},"additionalProperties":false,"type":"object","required":["sender","template_url","signature_url","payment_methods","required_review_fields","letter_date_format","auto_approve_optimistic"],"title":"OfficeConfigurationResponse","example":{"auto_approve_optimistic":false,"letter_date_format":"%d.%m.%Y","payment_methods":[{"iban":"DE89370400440532013000","id":7442550215703679137,"kind":"bank_account","name":"Business account"}],"required_review_fields":["document_type","summary"],"sender":{"email":"hello@example.test","organization":"Example Services GmbH"},"signature_url":null,"template_url":"https://storage.example.test/office/template.docx"}},"OfficeCorrectCompletedCaseAction":{"properties":{"type":{"type":"string","const":"correct_completed_case","title":"Type","description":"Correct the values or the recorded outcome of a completed case. A correction must change at least one fact."},"changes":{"anyOf":[{"$ref":"#/components/schemas/OfficeCaseValuesPatch"},{"type":"null"}]},"correction_reason":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Correction Reason","description":"Required when changing an existing value supported by invoice XML. The original XML remains unchanged."},"completion":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/OfficeRecordLetterDispatchAction"},{"$ref":"#/components/schemas/OfficeCompleteLetterWithoutReplyAction"},{"$ref":"#/components/schemas/OfficeRecordPaymentAction"},{"$ref":"#/components/schemas/OfficeResolveCreditAction"},{"$ref":"#/components/schemas/OfficeCompleteOtherAction"}],"discriminator":{"propertyName":"type","mapping":{"complete_letter_without_reply":"#/components/schemas/OfficeCompleteLetterWithoutReplyAction","complete_other":"#/components/schemas/OfficeCompleteOtherAction","record_letter_dispatch":"#/components/schemas/OfficeRecordLetterDispatchAction","record_payment":"#/components/schemas/OfficeRecordPaymentAction","resolve_credit":"#/components/schemas/OfficeResolveCreditAction"}}},{"type":"null"}],"title":"Completion"},"acknowledged_reason_keys":{"items":{"type":"string"},"type":"array","title":"Acknowledged Reason Keys"},"invoice_override_reasons":{"additionalProperties":{"type":"string"},"type":"object","maxProperties":32,"title":"Invoice Override Reasons","description":"One explanation per current invoice finding accepted for this correction, keyed by its review reason key. An explanation for the company assignment confirmation is optional."},"confirm_consequences":{"type":"boolean","title":"Confirm Consequences","default":false}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeCorrectCompletedCaseAction"},"OfficeCorrespondenceThreadLinkSuggestion":{"properties":{"type":{"type":"string","const":"correspondence_reference","title":"Type","default":"correspondence_reference","examples":["correspondence_reference"]},"authoritative_case":{"$ref":"#/components/schemas/OfficeThreadCaseSummary"},"correspondence_reference":{"type":"string","maxLength":500,"minLength":1,"title":"Correspondence Reference","examples":["DELIVERY-2026-1042"]},"party_match":{"type":"string","enum":["same","missing","conflict"],"title":"Party Match","description":"Organization-level corroboration for the exact correspondence-reference match.","examples":["same"]}},"additionalProperties":false,"type":"object","required":["authoritative_case","correspondence_reference","party_match"],"title":"OfficeCorrespondenceThreadLinkSuggestion","example":{"authoritative_case":{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","state":"review_required","title":"Request for delivery confirmation"},"correspondence_reference":"DELIVERY-2026-1042","party_match":"same","type":"correspondence_reference"}},"OfficeCreditApplicationView":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679004]},"invoice_case_id":{"type":"string","title":"Invoice Case Id","examples":[7442550215703679137]},"amount":{"$ref":"#/components/schemas/OfficeMoney","examples":[{"amount":"25.00","currency":"EUR"}]},"applied_on":{"type":"string","format":"date","title":"Applied On","examples":["2026-10-19"]},"status":{"type":"string","enum":["reserved","applied","reversed"],"title":"Status","examples":["applied"]},"reversed_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Reversed On","examples":[null]},"can_reverse":{"type":"boolean","title":"Can Reverse","default":false,"examples":[true]}},"additionalProperties":false,"type":"object","required":["id","invoice_case_id","amount","applied_on","status","reversed_on"],"title":"OfficeCreditApplicationView","example":{"amount":{"amount":"25.00","currency":"EUR"},"applied_on":"2026-10-19","can_reverse":true,"id":"7442550215703679004","invoice_case_id":"7442550215703679137","reversed_on":null,"status":"applied"}},"OfficeCreditBalance":{"properties":{"total":{"$ref":"#/components/schemas/OfficeMoney"},"applied":{"$ref":"#/components/schemas/OfficeMoney"},"reserved":{"$ref":"#/components/schemas/OfficeMoney"},"settled":{"$ref":"#/components/schemas/OfficeMoney"},"available":{"$ref":"#/components/schemas/OfficeMoney"}},"additionalProperties":false,"type":"object","required":["total","applied","reserved","settled","available"],"title":"OfficeCreditBalance"},"OfficeCreditInvoiceCandidate":{"properties":{"case_id":{"type":"string","title":"Case Id","examples":[7442550215703679137]},"invoice_number":{"type":"string","maxLength":500,"minLength":1,"title":"Invoice Number","examples":["INV-2026-1042"]},"creditor":{"$ref":"#/components/schemas/OfficeParty","examples":[{"email":"office@example.test","organization":"Example Supplies GmbH"}]},"original_payable_amount":{"$ref":"#/components/schemas/OfficeMoney","examples":[{"amount":"125.00","currency":"EUR"}]}},"additionalProperties":false,"type":"object","required":["case_id","invoice_number","creditor","original_payable_amount"],"title":"OfficeCreditInvoiceCandidate","example":{"case_id":"7442550215703679137","creditor":{"email":"office@example.test","organization":"Example Supplies GmbH"},"invoice_number":"INV-2026-1042","original_payable_amount":{"amount":"125.00","currency":"EUR"}}},"OfficeCreditResolutionData":{"properties":{"id":{"type":"string","title":"Id","examples":["7442550215703679873"]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"resolution":{"$ref":"#/components/schemas/OfficeCreditResolutionKind"},"resolved_on":{"type":"string","format":"date","title":"Resolved On"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"relation_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Relation Id"}},"additionalProperties":false,"type":"object","required":["id","created_at","resolution","resolved_on"],"title":"OfficeCreditResolutionData"},"OfficeCreditResolutionKind":{"type":"string","enum":["refund_received","applied_to_balance","handled_externally"],"title":"OfficeCreditResolutionKind"},"OfficeCreditResolutionSnapshot":{"properties":{"resolution":{"$ref":"#/components/schemas/OfficeCreditResolutionKind"},"resolved_on":{"type":"string","format":"date","title":"Resolved On"},"invoice_case_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Invoice Case Id"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","required":["resolution","resolved_on","invoice_case_id","note"],"title":"OfficeCreditResolutionSnapshot"},"OfficeCreditorDocumentData":{"properties":{"record":{"anyOf":[{"$ref":"#/components/schemas/OfficeRecord"},{"type":"null"}],"description":"Existing detail identity and timestamps; null before a detail record has been created."},"payment_record":{"anyOf":[{"$ref":"#/components/schemas/OfficePaymentRecordData"},{"type":"null"}]},"subsequent_payments":{"items":{"$ref":"#/components/schemas/OfficePaymentRecordData"},"type":"array","title":"Subsequent Payments"},"credit_resolution":{"anyOf":[{"$ref":"#/components/schemas/OfficeCreditResolutionData"},{"type":"null"}]},"creditor":{"anyOf":[{"$ref":"#/components/schemas/OfficeParty"},{"type":"null"}],"description":"Supplier or creditor that issued the incoming invoice or credit note."},"invoice_number":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Invoice Number","description":"Invoice identifier, or for a credit note the exact identifier of the invoice being credited."},"credit_note_number":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Credit Note Number","description":"The credit note's own identifier; unset for invoices."},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date","description":"Payment due date stated by the creditor document or calculated from a supported relative payment period; null when no such date is sufficiently supported."},"payable":{"anyOf":[{"$ref":"#/components/schemas/OfficeMoney"},{"type":"null"}],"description":"Signed amount due for an invoice; credit notes retain a non-negative credited magnitude."},"tax_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Amount","description":"Signed total tax amount explicitly stated by the creditor document, in the payable currency; null when no tax amount is sufficiently supported."},"account_holder":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Account Holder"},"iban":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Iban"},"bic":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Bic"},"paypal_account":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Paypal Account"},"payment_reference":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Payment Reference"},"direct_debit_indicated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Direct Debit Indicated","description":"True only when the document explicitly states that the creditor will collect the payment automatically by direct debit. A manual transfer instruction is not direct debit; use null when direct debit is not sufficiently supported."},"payment_already_confirmed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Payment Already Confirmed","description":"True only when the document explicitly confirms that payment has already been completed or received. A payment request, due date, or payment instruction is not confirmation; use null when completed payment is not sufficiently supported."}},"additionalProperties":false,"type":"object","title":"OfficeCreditorDocumentData"},"OfficeCreditorDocumentFactsPatch":{"properties":{"creditor":{"anyOf":[{"$ref":"#/components/schemas/OfficePartyPatch"},{"type":"null"}],"description":"Supplier or creditor that issued the incoming invoice or credit note."},"invoice_number":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Invoice Number","description":"Invoice identifier, or for a credit note the exact identifier of the invoice being credited."},"credit_note_number":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Credit Note Number","description":"The credit note's own identifier; unset for invoices."},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date","description":"Explicit payment due date stated by the creditor document; null means no such date is established."},"payable":{"anyOf":[{"$ref":"#/components/schemas/OfficeMoneyPatch"},{"type":"null"}],"description":"Signed amount due for an invoice; credit notes retain a non-negative credited magnitude."},"tax_amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Tax Amount","description":"Signed total tax amount stated by the creditor document, in the payable currency; null means no tax amount is established."},"account_holder":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Account Holder"},"iban":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Iban"},"bic":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Bic"},"paypal_account":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Paypal Account"},"payment_reference":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Payment Reference"},"direct_debit_indicated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Direct Debit Indicated","description":"True only when the document states that the creditor will collect the payment automatically by direct debit. A manual transfer instruction is not direct debit; null means no direct-debit indication is established."},"payment_already_confirmed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Payment Already Confirmed","description":"True only when the document confirms that payment has already been completed or received. A payment request, due date, or instruction is not confirmation; null means completed payment is not established."}},"additionalProperties":false,"type":"object","title":"OfficeCreditorDocumentFactsPatch"},"OfficeCreditorDocumentView":{"properties":{"allowed_payment_routes":{"items":{"$ref":"#/components/schemas/OfficePaymentRoute"},"type":"array","title":"Allowed Payment Routes","examples":[["bank_transfer"]]},"eligible_payment_methods":{"items":{"$ref":"#/components/schemas/OfficePaymentMethodSnapshot"},"type":"array","title":"Eligible Payment Methods","description":"Current tenant payment methods compatible with this invoice.","examples":[[{"id":7442550215703679137,"kind":"bank_account","name":"Business account"}]]},"suggested_payment_method_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Suggested Payment Method Id","description":"Analysis-suggested eligible payment method, or null when no current suggestion is valid.","examples":[7442550215703679137]},"proposals":{"items":{"$ref":"#/components/schemas/OfficePaymentProposal"},"type":"array","title":"Proposals","examples":[[{"account_holder":"Example Supplies GmbH","amount":"125.00","beneficiary":"Example Supplies GmbH","bic":null,"currency":"EUR","iban":"DE89370400440532013000","paypal_account":null,"reference":"INV-2026-1042"}]]},"payment_record":{"anyOf":[{"$ref":"#/components/schemas/OfficePaymentRecordView"},{"type":"null"}],"examples":[null]},"payments":{"items":{"$ref":"#/components/schemas/OfficePaymentRecordView"},"type":"array","title":"Payments","description":"Every recorded payment, original first.","examples":[[]]},"credit_resolution":{"anyOf":[{"$ref":"#/components/schemas/OfficeCreditResolutionSnapshot"},{"type":"null"}],"examples":[null]},"linked_invoice_case_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Linked Invoice Case Id","examples":[null]},"linked_credit_case_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Linked Credit Case Ids","description":"Linked credit cases visible to the caller.","examples":[[]]},"pending_credit_case_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","title":"Pending Credit Case Ids","description":"Unresolved linked credit cases visible to the caller.","examples":[[]]},"has_pending_credits":{"type":"boolean","title":"Has Pending Credits","description":"Whether this invoice has any unresolved linked credits, including credits from cases the caller cannot view.","default":false,"examples":[false]},"invoice_candidates":{"items":{"$ref":"#/components/schemas/OfficeCreditInvoiceCandidate"},"type":"array","title":"Invoice Candidates","examples":[[]]},"original_payable_amount":{"anyOf":[{"$ref":"#/components/schemas/OfficeMoney"},{"type":"null"}],"examples":[{"amount":"125.00","currency":"EUR"}]},"total_linked_credit_amount":{"anyOf":[{"$ref":"#/components/schemas/OfficeMoney"},{"type":"null"}],"description":"Total linked credit counted toward this invoice's balance, including reserved amounts and credits from cases the caller cannot view.","examples":[{"amount":"0.00","currency":"EUR"}]},"remaining_payable_amount":{"anyOf":[{"$ref":"#/components/schemas/OfficeMoney"},{"type":"null"}],"examples":[{"amount":"125.00","currency":"EUR"}]},"overpaid_amount":{"anyOf":[{"$ref":"#/components/schemas/OfficeMoney"},{"type":"null"}],"description":"Amount by which recorded payments exceed the payable balance after credits.","examples":[null]},"credit_balance":{"anyOf":[{"$ref":"#/components/schemas/OfficeCreditBalance"},{"type":"null"}],"examples":[null]},"credit_applications":{"items":{"$ref":"#/components/schemas/OfficeCreditApplicationView"},"type":"array","title":"Credit Applications","examples":[[]]}},"additionalProperties":false,"type":"object","required":["allowed_payment_routes","eligible_payment_methods","suggested_payment_method_id","proposals","payment_record","credit_resolution","linked_invoice_case_id","linked_credit_case_ids","pending_credit_case_ids","invoice_candidates","original_payable_amount","total_linked_credit_amount","remaining_payable_amount"],"title":"OfficeCreditorDocumentView","example":{"allowed_payment_routes":["bank_transfer"],"credit_applications":[],"credit_resolution":null,"eligible_payment_methods":[{"id":7442550215703679137,"kind":"bank_account","name":"Business account"}],"has_pending_credits":false,"invoice_candidates":[],"linked_credit_case_ids":[],"linked_invoice_case_id":null,"original_payable_amount":{"amount":"125.00","currency":"EUR"},"payment_record":null,"payments":[],"pending_credit_case_ids":[],"proposals":[{"account_holder":"Example Supplies GmbH","amount":"125.00","beneficiary":"Example Supplies GmbH","bic":null,"currency":"EUR","iban":"DE89370400440532013000","paypal_account":null,"reference":"INV-2026-1042"}],"remaining_payable_amount":{"amount":"125.00","currency":"EUR"},"suggested_payment_method_id":"7442550215703679137","total_linked_credit_amount":{"amount":"0.00","currency":"EUR"}}},"OfficeDeadlineFilter":{"type":"string","enum":["overdue","today","next_7_days","none"],"title":"OfficeDeadlineFilter"},"OfficeDeletionRelationship":{"properties":{"type":{"type":"string","enum":["semantic_duplicate","credit_invoice","thread_candidate","thread_member"],"title":"Type","examples":["credit_invoice"]},"related_case":{"$ref":"#/components/schemas/OfficeRelatedCaseSummary"}},"additionalProperties":false,"type":"object","required":["type","related_case"],"title":"OfficeDeletionRelationship","example":{"related_case":{"id":"7442550215703679137","state":"completed","title":"Invoice INV-2026-1042"},"type":"credit_invoice"}},"OfficeDismissSemanticDuplicatesAction":{"properties":{"type":{"type":"string","const":"dismiss_semantic_duplicates","title":"Type","description":"Confirm that the suggested similar cases are not duplicates of this case."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeDismissSemanticDuplicatesAction"},"OfficeDocumentType":{"type":"string","enum":["letter","invoice","credit_note","creditor_invoice","receipt","insurance","health_insurance","tax","income_tax","bank_account_statement","bank_notification","fleet","delivery_note","legal_matter","certificate","real_estate","personnel","advertising","other"],"title":"OfficeDocumentType"},"OfficeDocumentsAddedResponse":{"properties":{"case_id":{"type":"string","title":"Case Id","examples":[7442550215703679004]},"added_document_count":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Added Document Count","examples":[1]},"unchanged":{"type":"boolean","title":"Unchanged","examples":[false]}},"additionalProperties":false,"type":"object","required":["case_id","added_document_count","unchanged"],"title":"OfficeDocumentsAddedResponse","example":{"added_document_count":1,"case_id":"7442550215703679004","unchanged":false}},"OfficeDraftStatus":{"type":"string","enum":["pending","ready","failed"],"title":"OfficeDraftStatus"},"OfficeDuplicateCandidate":{"properties":{"case_id":{"type":"string","title":"Case Id","examples":[7442550215703679137]},"state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["review_required"]},"document_type":{"anyOf":[{"$ref":"#/components/schemas/OfficeDocumentType"},{"type":"null"}],"examples":["letter"]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","examples":["A second scan of the delivery confirmation request."]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["case_id","state","document_type","summary","created_at"],"title":"OfficeDuplicateCandidate","example":{"case_id":"7442550215703679137","created_at":"2026-10-19T09:00:00Z","document_type":"letter","state":"review_required","summary":"A second scan of the delivery confirmation request."}},"OfficeExportError":{"properties":{"code":{"type":"string","enum":["document_unavailable","document_invalid","export_unavailable"],"title":"Code","examples":["document_unavailable"]},"message":{"type":"string","title":"Message","examples":["A document could not be included in the export."]},"case_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Case Id","examples":[7442550215703679004]},"artifact_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Artifact Id","examples":[7442550215703679137]}},"type":"object","required":["code","message"],"title":"OfficeExportError","example":{"artifact_id":"7442550215703679137","case_id":"7442550215703679004","code":"document_unavailable","message":"A document could not be included in the export."}},"OfficeExportRequest":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date","description":"First document date to include.","examples":["2026-10-01"]},"end_date":{"type":"string","format":"date","title":"End Date","description":"Last document date to include.","examples":["2026-10-14"]},"document_types":{"anyOf":[{"items":{"type":"string","enum":["creditor_invoice","invoice","credit_note"]},"type":"array","minItems":1},{"type":"null"}],"title":"Document Types","description":"Document types to include. Omit to include invoices; select credit notes explicitly.","examples":[["creditor_invoice","credit_note"]]},"payment_status":{"anyOf":[{"type":"string","enum":["paid","unpaid"]},{"type":"null"}],"title":"Payment Status","examples":["paid"]},"export_status":{"type":"string","enum":["exported","not_exported"],"title":"Export Status","description":"Select documents by export history. Defaults to not_exported; select exported to include previously exported documents.","default":"not_exported","examples":["not_exported"]},"allow_partial_export":{"type":"boolean","title":"Allow Partial Export","description":"Allow a partial export after explicit confirmation when individual documents cannot be read.","default":false,"examples":[false]}},"additionalProperties":false,"type":"object","required":["start_date","end_date"],"title":"OfficeExportRequest","example":{"allow_partial_export":false,"document_types":["creditor_invoice","credit_note"],"end_date":"2026-10-14","export_status":"not_exported","payment_status":"paid","start_date":"2026-10-01"}},"OfficeExportResultResponse":{"properties":{"export_id":{"type":"string","title":"Export Id","examples":[7442550215703679004]},"status":{"type":"string","enum":["pending","running","success","failure","partial_success","no_matches"],"title":"Status","examples":["success"]},"exported_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Exported Count","description":"Number of PDF files included in the ZIP, available after the export finishes.","examples":[1]},"errors":{"items":{"$ref":"#/components/schemas/OfficeExportError"},"type":"array","title":"Errors","examples":[[]]},"notices":{"items":{"type":"string"},"type":"array","title":"Notices","examples":[[]]}},"additionalProperties":false,"type":"object","required":["export_id","status"],"title":"OfficeExportResultResponse","example":{"errors":[],"export_id":"7442550215703679004","exported_count":1,"notices":[],"status":"success"}},"OfficeFieldEvidence":{"properties":{"field_name":{"type":"string","maxLength":200,"minLength":1,"title":"Field Name"},"artifact_id":{"type":"string","title":"Artifact Id","examples":["7442550215703679873"]},"excerpt":{"type":"string","maxLength":2000,"minLength":1,"title":"Excerpt","description":"Short, verbatim excerpt from the source artifact that supports the named field."},"page_number":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Page Number"},"xml_path":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Xml Path","description":"Location of the supporting value within the XML artifact, including namespace context, element occurrences and any attribute name needed to identify it unambiguously. Identifies the source location, not the validation status of the value."},"relative_date":{"anyOf":[{"$ref":"#/components/schemas/OfficeRelativeDateEvidence"},{"type":"null"}],"description":"Calculation evidence used only when the final date is not stated explicitly for next_action_deadline, letter.response_deadline, or creditor_document.due_date."}},"additionalProperties":false,"type":"object","required":["field_name","artifact_id","excerpt"],"title":"OfficeFieldEvidence"},"OfficeFieldSource":{"type":"string","enum":["xml","derived","analysis","human"],"title":"OfficeFieldSource"},"OfficeFinalizedCreditDependencyDeletionBlocker":{"properties":{"type":{"type":"string","const":"finalized_credit_dependency","title":"Type","default":"finalized_credit_dependency","examples":["finalized_credit_dependency"]},"related_cases":{"items":{"$ref":"#/components/schemas/OfficeRelatedCaseSummary"},"type":"array","minItems":1,"title":"Related Cases"},"message":{"type":"string","title":"Message","examples":["A finalized invoice depends on this credit."]}},"additionalProperties":false,"type":"object","required":["related_cases","message"],"title":"OfficeFinalizedCreditDependencyDeletionBlocker","example":{"message":"A finalized invoice depends on this credit.","related_cases":[{"id":"7442550215703679137","state":"completed","title":"Invoice INV-2026-1042"}],"type":"finalized_credit_dependency"}},"OfficeFinancialRecordDeletionBlocker":{"properties":{"type":{"type":"string","const":"financial_record_exists","title":"Type","default":"financial_record_exists","examples":["financial_record_exists"]},"message":{"type":"string","title":"Message","examples":["This case has a financial record that prevents deletion."]}},"additionalProperties":false,"type":"object","required":["message"],"title":"OfficeFinancialRecordDeletionBlocker","example":{"message":"This case has a financial record that prevents deletion.","type":"financial_record_exists"}},"OfficeGenerateLetterDraftAction":{"properties":{"type":{"type":"string","const":"generate_letter_draft","title":"Type","description":"Ask Office to write a reply draft for a letter, optionally following your instructions."},"instructions":{"anyOf":[{"type":"string","maxLength":10000,"minLength":1},{"type":"null"}],"title":"Instructions"}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeGenerateLetterDraftAction"},"OfficeHandlingStep":{"type":"string","enum":["analysis","review","duplicate_resolution","letter_draft","letter_completion","letter_dispatch","payment","credit_resolution","other_completion","completed","archived"],"title":"OfficeHandlingStep"},"OfficeHistoryEntry":{"properties":{"user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"User Id"},"changed_at":{"type":"string","format":"date-time","title":"Changed At"}},"additionalProperties":false,"type":"object","required":["changed_at"],"title":"OfficeHistoryEntry","description":"Note:\n    A null `user_id` indicates that the last change was made by the AI."},"OfficeHistoryItem":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679137]},"type":{"$ref":"#/components/schemas/OfficeCaseEventType","examples":["case_created"]},"actor_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Actor User Id","examples":[7442551216804781021]},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At","examples":["2026-10-19T09:00:00Z"]},"details":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"title":"Details","examples":[null]}},"additionalProperties":false,"type":"object","required":["id","type","actor_user_id","occurred_at"],"title":"OfficeHistoryItem","example":{"actor_user_id":"7442551216804781021","id":"7442550215703679137","occurred_at":"2026-10-19T09:00:00Z","type":"case_created"}},"OfficeInvoiceControls":{"properties":{"obligation_exception":{"anyOf":[{"type":"string","enum":["cancelled","extinguished","disputed","written_off","material_credit_adjustment","invoice_changed","overpaid","other"]},{"type":"null"}],"title":"Obligation Exception"},"payment_hold":{"type":"boolean","title":"Payment Hold","default":false},"approval_required":{"type":"boolean","title":"Approval Required","default":false}},"additionalProperties":false,"type":"object","title":"OfficeInvoiceControls"},"OfficeLetterConfigurationSnapshot":{"properties":{"sender":{"$ref":"#/components/schemas/OfficeParty"},"template_storage_object_id":{"type":"string","title":"Template Storage Object Id","examples":["7442550215703679873"]},"signature_storage_object_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Signature Storage Object Id"},"letter_date_format":{"type":"string","maxLength":100,"minLength":1,"title":"Letter Date Format"}},"additionalProperties":false,"type":"object","required":["sender","template_storage_object_id","letter_date_format"],"title":"OfficeLetterConfigurationSnapshot"},"OfficeLetterData":{"properties":{"subject":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Subject","description":"Subject of the incoming correspondence; null when no subject is sufficiently supported."},"response_deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Response Deadline","description":"Date by which the source requests a response, either stated explicitly or calculated from a supported relative period; null when no such date is sufficiently supported."},"reply_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reply Required","description":"Whether the incoming correspondence requires a reply from the user; null when the reply requirement is not sufficiently supported."},"record":{"anyOf":[{"$ref":"#/components/schemas/OfficeRecord"},{"type":"null"}],"description":"Existing detail identity and timestamps; null before a detail record has been created."},"draft_job_id":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Draft Job Id"},"draft_status":{"anyOf":[{"$ref":"#/components/schemas/OfficeDraftStatus"},{"type":"null"}]},"draft_failure_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Failure Code"},"draft_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Instructions"},"draft_persistent_task_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Draft Persistent Task Id"},"draft_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Subject"},"draft_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Body"},"draft_configuration_snapshot":{"anyOf":[{"$ref":"#/components/schemas/OfficeLetterConfigurationSnapshot"},{"type":"null"}]},"accepted_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted Subject"},"accepted_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted Body"},"approved_reply_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Approved Reply Id"},"docx_artifact_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Docx Artifact Id"},"pdf_artifact_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Pdf Artifact Id"},"configuration_snapshot":{"anyOf":[{"$ref":"#/components/schemas/OfficeLetterConfigurationSnapshot"},{"type":"null"}]},"replies":{"items":{"$ref":"#/components/schemas/OfficeSentLetterReplyData"},"type":"array","title":"Replies"},"completed_without_reply_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed Without Reply Reason"}},"additionalProperties":false,"type":"object","title":"OfficeLetterData"},"OfficeLetterDispatchChannel":{"type":"string","enum":["email","post","fax","courier","other"],"title":"OfficeLetterDispatchChannel"},"OfficeLetterDraftView":{"properties":{"status":{"$ref":"#/components/schemas/OfficeDraftStatus","examples":["ready"]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","examples":["Delivery confirmation for order 1042"]},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","examples":["We confirm that order 1042 was delivered on 19 October 2026."]},"render_available":{"type":"boolean","title":"Render Available","examples":[true]},"docx_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docx Url","examples":["https://storage.example.test/office/reply.docx"]},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url","examples":["https://storage.example.test/office/reply.pdf"]},"failure_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Code","examples":[null]}},"additionalProperties":false,"type":"object","required":["status","render_available"],"title":"OfficeLetterDraftView","example":{"body":"We confirm that order 1042 was delivered on 19 October 2026.","docx_url":"https://storage.example.test/office/reply.docx","pdf_url":"https://storage.example.test/office/reply.pdf","render_available":true,"status":"ready","subject":"Delivery confirmation for order 1042"}},"OfficeLetterFacts":{"properties":{"subject":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Subject","description":"Subject of the incoming correspondence; null when no subject is sufficiently supported."},"response_deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Response Deadline","description":"Date by which the source requests a response, either stated explicitly or calculated from a supported relative period; null when no such date is sufficiently supported."},"reply_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reply Required","description":"Whether the incoming correspondence requires a reply from the user; null when the reply requirement is not sufficiently supported."}},"additionalProperties":false,"type":"object","title":"OfficeLetterFacts"},"OfficeLetterView":{"properties":{"reply_required":{"type":"boolean","title":"Reply Required","examples":[true]},"draft":{"anyOf":[{"$ref":"#/components/schemas/OfficeLetterDraftView"},{"type":"null"}],"examples":[null]},"accepted_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted Subject","examples":[null]},"accepted_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted Body","examples":[null]},"approved_reply_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Approved Reply Id","examples":[null]},"replies":{"items":{"$ref":"#/components/schemas/OfficeSentLetterReplyView"},"type":"array","title":"Replies","examples":[[]]},"completed_without_reply_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed Without Reply Reason","examples":[null]}},"additionalProperties":false,"type":"object","required":["reply_required","draft","accepted_subject","accepted_body","approved_reply_id","completed_without_reply_reason"],"title":"OfficeLetterView","example":{"accepted_body":null,"accepted_subject":null,"approved_reply_id":null,"completed_without_reply_reason":null,"draft":null,"replies":[],"reply_required":true}},"OfficeLinkCaseAction":{"properties":{"type":{"type":"string","const":"link_case","title":"Type","description":"Add this case to the correspondence of another case."},"authoritative_case_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Authoritative Case Id"}},"additionalProperties":false,"type":"object","required":["type","authoritative_case_id"],"title":"OfficeLinkCaseAction"},"OfficeMoney":{"properties":{"amount":{"type":"string","title":"Amount"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","title":"Currency"}},"additionalProperties":false,"type":"object","required":["amount","currency"],"title":"OfficeMoney"},"OfficeMoneyPatch":{"properties":{"amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount"},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}],"title":"Currency"}},"additionalProperties":false,"type":"object","title":"OfficeMoneyPatch"},"OfficeNoteView":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679137]},"content":{"type":"string","title":"Content","examples":["Check the delivery receipt before replying."]},"allow_ai_use":{"type":"boolean","title":"Allow Ai Use","examples":[false]},"created_by_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Created By User Id","examples":[7442551216804781021]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["id","content","allow_ai_use","created_by_user_id","created_at"],"title":"OfficeNoteView","example":{"allow_ai_use":false,"content":"Check the delivery receipt before replying.","created_at":"2026-10-19T09:00:00Z","created_by_user_id":"7442551216804781021","id":"7442550215703679137"}},"OfficeOperationalCounts":{"properties":{"errors":{"type":"integer","minimum":0.0,"title":"Errors","description":"Active cases whose analysis or letter-draft processing failed.","examples":[0]},"deadlines":{"type":"integer","minimum":0.0,"title":"Deadlines","description":"Active cases with an effective user-action deadline.","examples":[1]},"review":{"type":"integer","minimum":0.0,"title":"Review","description":"Cases whose lifecycle state requires human review.","examples":[1]},"creditor_documents":{"type":"integer","minimum":0.0,"title":"Creditor Documents","description":"In-progress invoices and credit notes in the creditor-document workflow.","examples":[0]},"system_processing":{"type":"integer","minimum":0.0,"title":"System Processing","description":"Active cases whose analysis or letter-draft processing is pending.","examples":[0]},"in_progress":{"type":"integer","minimum":0.0,"title":"In Progress","description":"Broad queue of cases whose lifecycle state is in_progress.","examples":[0]},"completed":{"type":"integer","minimum":0.0,"title":"Completed","description":"Cases whose lifecycle state is completed.","examples":[0]},"archived":{"type":"integer","minimum":0.0,"title":"Archived","description":"Cases whose lifecycle state is archived.","examples":[0]}},"additionalProperties":false,"type":"object","required":["errors","deadlines","review","creditor_documents","system_processing","in_progress","completed","archived"],"title":"OfficeOperationalCounts","description":"Overlapping queue counts; values are not expected to sum to the total case count.","example":{"archived":0,"completed":0,"creditor_documents":0,"deadlines":1,"errors":0,"in_progress":0,"review":1,"system_processing":0}},"OfficeOtherDisposition":{"type":"string","enum":["no_further_action","handled_externally","other"],"title":"OfficeOtherDisposition"},"OfficeOtherOutcomeData":{"properties":{"id":{"type":"string","title":"Id","examples":["7442550215703679873"]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"disposition":{"$ref":"#/components/schemas/OfficeOtherDisposition"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation"},"completed_by_user_id":{"type":"string","title":"Completed By User Id","examples":["7442550215703679873"]},"completed_at":{"type":"string","format":"date-time","title":"Completed At"}},"additionalProperties":false,"type":"object","required":["id","created_at","updated_at","disposition","completed_by_user_id","completed_at"],"title":"OfficeOtherOutcomeData"},"OfficeOtherView":{"properties":{"disposition":{"anyOf":[{"$ref":"#/components/schemas/OfficeOtherDisposition"},{"type":"null"}],"examples":["no_further_action"]},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","examples":["The document is informational and requires no action."]}},"additionalProperties":false,"type":"object","required":["disposition","explanation"],"title":"OfficeOtherView","example":{"disposition":"no_further_action","explanation":"The document is informational and requires no action."}},"OfficeParty":{"properties":{"organization":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Organization"},"person":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Person"},"address":{"anyOf":[{"$ref":"#/components/schemas/OfficeAddress"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":320,"minLength":3},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64,"minLength":3},{"type":"null"}],"title":"Phone"}},"additionalProperties":false,"type":"object","title":"OfficeParty"},"OfficePartyPatch":{"properties":{"organization":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Organization"},"person":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Person"},"address":{"anyOf":[{"$ref":"#/components/schemas/OfficeAddress"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":320,"minLength":3},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64,"minLength":3},{"type":"null"}],"title":"Phone"}},"additionalProperties":false,"type":"object","title":"OfficePartyPatch"},"OfficePaymentMethodKind":{"type":"string","enum":["bank_account","paypal","card"],"title":"OfficePaymentMethodKind"},"OfficePaymentMethodSnapshot":{"properties":{"id":{"type":"string","title":"Id","examples":["7442550215703679873"]},"name":{"type":"string","maxLength":300,"minLength":1,"title":"Name"},"kind":{"$ref":"#/components/schemas/OfficePaymentMethodKind"}},"additionalProperties":false,"type":"object","required":["id","name","kind"],"title":"OfficePaymentMethodSnapshot"},"OfficePaymentProposal":{"properties":{"beneficiary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Beneficiary"},"amount":{"type":"string","title":"Amount","gt":"0"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","title":"Currency"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"account_holder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Holder"},"iban":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iban"},"bic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bic"},"paypal_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paypal Account"},"epc_payload":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Epc Payload"}},"additionalProperties":false,"type":"object","required":["beneficiary","amount","currency","reference","account_holder","iban","bic","paypal_account"],"title":"OfficePaymentProposal"},"OfficePaymentRecordData":{"properties":{"id":{"type":"string","title":"Id","examples":["7442550215703679873"]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"idempotency_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Idempotency Key"},"amount":{"type":"string","title":"Amount","gt":"0"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","title":"Currency"},"paid_on":{"type":"string","format":"date","title":"Paid On"},"payment_route":{"$ref":"#/components/schemas/OfficePaymentRoute"},"external_reference":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"External Reference"},"payment_method_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Payment Method Id"},"payment_method_name":{"anyOf":[{"type":"string","maxLength":300,"minLength":1},{"type":"null"}],"title":"Payment Method Name"},"payment_method_kind":{"anyOf":[{"$ref":"#/components/schemas/OfficePaymentMethodKind"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["id","created_at","amount","currency","paid_on","payment_route"],"title":"OfficePaymentRecordData"},"OfficePaymentRecordView":{"properties":{"amount":{"$ref":"#/components/schemas/OfficeMoney","examples":[{"amount":"125.00","currency":"EUR"}]},"paid_on":{"type":"string","format":"date","title":"Paid On","examples":["2026-10-19"]},"payment_route":{"$ref":"#/components/schemas/OfficePaymentRoute","examples":["bank_transfer"]},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference","examples":["TRANSFER-1042"]},"payment_method":{"anyOf":[{"$ref":"#/components/schemas/OfficePaymentMethodSnapshot"},{"type":"null"}],"examples":[{"id":7442550215703679137,"kind":"bank_account","name":"Business account"}]}},"additionalProperties":false,"type":"object","required":["amount","paid_on","payment_route","external_reference","payment_method"],"title":"OfficePaymentRecordView","example":{"amount":{"amount":"125.00","currency":"EUR"},"external_reference":"TRANSFER-1042","paid_on":"2026-10-19","payment_method":{"id":7442550215703679137,"kind":"bank_account","name":"Business account"},"payment_route":"bank_transfer"}},"OfficePaymentRoute":{"type":"string","enum":["bank_transfer","direct_debit","card","paypal","cash","other"],"title":"OfficePaymentRoute"},"OfficeProcessCurrentStepView":{"properties":{"step":{"$ref":"#/components/schemas/OfficeHandlingStep","examples":["review"]},"state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["review_required"]}},"additionalProperties":false,"type":"object","required":["step","state"],"title":"OfficeProcessCurrentStepView","example":{"state":"review_required","step":"review"}},"OfficeProcessMilestoneView":{"properties":{"step":{"$ref":"#/components/schemas/OfficeHandlingStep","examples":["analysis"]},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["step","occurred_at"],"title":"OfficeProcessMilestoneView","example":{"occurred_at":"2026-10-19T09:00:00Z","step":"analysis"}},"OfficeProcessNextStepView":{"properties":{"step":{"$ref":"#/components/schemas/OfficeHandlingStep","examples":["letter_draft"]},"state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["in_progress"]},"via_action":{"anyOf":[{"$ref":"#/components/schemas/OfficeCaseActionType"},{"type":"null"}],"examples":["approve"]},"availability":{"$ref":"#/components/schemas/OfficeProcessStepAvailability","examples":["available"]}},"additionalProperties":false,"type":"object","required":["step","state","via_action","availability"],"title":"OfficeProcessNextStepView","example":{"availability":"available","state":"in_progress","step":"letter_draft","via_action":"approve"}},"OfficeProcessOverviewView":{"properties":{"previous":{"anyOf":[{"$ref":"#/components/schemas/OfficeProcessMilestoneView"},{"type":"null"}]},"current":{"$ref":"#/components/schemas/OfficeProcessCurrentStepView"},"next":{"items":{"$ref":"#/components/schemas/OfficeProcessNextStepView"},"type":"array","title":"Next"},"terminal":{"type":"boolean","title":"Terminal","examples":[false]}},"additionalProperties":false,"type":"object","required":["previous","current","next","terminal"],"title":"OfficeProcessOverviewView","example":{"current":{"state":"review_required","step":"review"},"next":[{"availability":"available","state":"in_progress","step":"letter_draft","via_action":"approve"}],"previous":{"occurred_at":"2026-10-19T09:00:00Z","step":"analysis"},"terminal":false}},"OfficeProcessStepAvailability":{"type":"string","enum":["available","waiting"],"title":"OfficeProcessStepAvailability"},"OfficeRecommendationInput":{"properties":{"id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Id"},"text":{"type":"string","maxLength":20000,"minLength":1,"title":"Text"}},"additionalProperties":false,"type":"object","required":["text"],"title":"OfficeRecommendationInput"},"OfficeRecommendationView":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679137]},"text":{"type":"string","title":"Text","examples":["Confirm the delivery date."]},"position":{"type":"integer","exclusiveMaximum":30.0,"minimum":0.0,"title":"Position","examples":[0]},"completed":{"type":"boolean","title":"Completed","examples":[false]},"completion_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Note","examples":[null]},"completed_by_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Completed By User Id","examples":[null]},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","examples":[null]},"created_by_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Created By User Id","examples":[null]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2026-10-19T09:00:00Z"]},"updated_at":{"type":"string","format":"date-time","title":"Updated At","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["id","text","position","completed","completion_note","completed_by_user_id","completed_at","created_by_user_id","created_at","updated_at"],"title":"OfficeRecommendationView","example":{"completed":false,"completed_at":null,"completed_by_user_id":null,"completion_note":null,"created_at":"2026-10-19T09:00:00Z","created_by_user_id":null,"id":"7442550215703679137","position":0,"text":"Confirm the delivery date.","updated_at":"2026-10-19T09:00:00Z"}},"OfficeRecord":{"properties":{"id":{"type":"string","title":"Id","examples":["7442550215703679873"]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"additionalProperties":false,"type":"object","required":["id","created_at","updated_at"],"title":"OfficeRecord"},"OfficeRecordLetterDispatchAction":{"properties":{"type":{"type":"string","const":"record_letter_dispatch","title":"Type","description":"Record that an approved letter reply was sent, with channel and time. Office does not send the letter."},"approved_reply_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Approved Reply Id"},"reply_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Reply Id"},"channel":{"$ref":"#/components/schemas/OfficeLetterDispatchChannel"},"dispatched_at":{"type":"string","format":"date-time","title":"Dispatched At"},"external_reference":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"External Reference"}},"additionalProperties":false,"type":"object","required":["type","channel","dispatched_at"],"title":"OfficeRecordLetterDispatchAction"},"OfficeRecordPaymentAction":{"properties":{"type":{"type":"string","const":"record_payment","title":"Type","description":"Record a payment for an invoice that was made outside Office. Office does not initiate any payment."},"idempotency_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Idempotency Key"},"paid_on":{"type":"string","format":"date","title":"Paid On"},"payment_route":{"$ref":"#/components/schemas/OfficePaymentRoute"},"payment_method_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Payment Method Id","description":"Current tenant payment method used for a configurable payment route."},"external_reference":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"External Reference"}},"additionalProperties":false,"type":"object","required":["type","paid_on","payment_route"],"title":"OfficeRecordPaymentAction"},"OfficeRelatedCaseSummary":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679137]},"state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["completed"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","examples":["Invoice INV-2026-1042"]}},"additionalProperties":false,"type":"object","required":["id","state","title"],"title":"OfficeRelatedCaseSummary","example":{"id":"7442550215703679137","state":"completed","title":"Invoice INV-2026-1042"}},"OfficeRelatedCaseUpdateDeletionBlocker":{"properties":{"type":{"type":"string","const":"related_case_update_required","title":"Type","default":"related_case_update_required","examples":["related_case_update_required"]},"related_cases":{"items":{"$ref":"#/components/schemas/OfficeRelatedCaseSummary"},"type":"array","minItems":1,"title":"Related Cases"},"message":{"type":"string","title":"Message","examples":["Updating the related invoice requires additional permission."]}},"additionalProperties":false,"type":"object","required":["related_cases","message"],"title":"OfficeRelatedCaseUpdateDeletionBlocker","example":{"message":"Updating the related invoice requires additional permission.","related_cases":[{"id":"7442550215703679137","state":"completed","title":"Invoice INV-2026-1042"}],"type":"related_case_update_required"}},"OfficeRelativeDateBaseSource":{"type":"string","enum":["postal_receipt","email_received","scan_date","document_date","other_explicit_date"],"title":"OfficeRelativeDateBaseSource"},"OfficeRelativeDateEvidence":{"properties":{"base_date":{"type":"string","format":"date","title":"Base Date","description":"Document-supported date from which the relative period is calculated."},"base_source":{"$ref":"#/components/schemas/OfficeRelativeDateBaseSource","description":"Semantic source of the selected base date."},"duration":{"type":"integer","exclusiveMinimum":0.0,"title":"Duration","description":"Positive number of complete units to add to the base date."},"unit":{"$ref":"#/components/schemas/OfficeRelativeDateUnit"}},"additionalProperties":false,"type":"object","required":["base_date","base_source","duration","unit"],"title":"OfficeRelativeDateEvidence"},"OfficeRelativeDateUnit":{"type":"string","enum":["calendar_days","weeks","calendar_months"],"title":"OfficeRelativeDateUnit"},"OfficeRenderLetterDraftAction":{"properties":{"type":{"type":"string","const":"render_letter_draft","title":"Type","description":"Create the document preview of the letter reply draft."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeRenderLetterDraftAction"},"OfficeRequiredReviewField":{"type":"string","enum":["document_type","summary","document_date","next_action_deadline","sender","sender.organization","sender.person","sender.address","sender.address.lines","sender.address.postal_code","sender.address.city","sender.address.country","sender.email","sender.phone","recipients","letter","letter.subject","letter.response_deadline","correspondence_reference","letter.reply_required","creditor_document","creditor_document.creditor","creditor_document.creditor.organization","creditor_document.creditor.person","creditor_document.creditor.address","creditor_document.creditor.address.lines","creditor_document.creditor.address.postal_code","creditor_document.creditor.address.city","creditor_document.creditor.address.country","creditor_document.creditor.email","creditor_document.creditor.phone","creditor_document.invoice_number","creditor_document.credit_note_number","creditor_document.due_date","creditor_document.payable","creditor_document.payable.amount","creditor_document.payable.currency","creditor_document.tax_amount","creditor_document.account_holder","creditor_document.iban","creditor_document.bic","creditor_document.paypal_account","creditor_document.payment_reference","creditor_document.direct_debit_indicated","creditor_document.payment_already_confirmed","additional_facts"],"title":"OfficeRequiredReviewField"},"OfficeResolveCreditAction":{"properties":{"type":{"type":"string","const":"resolve_credit","title":"Type","description":"Record how a credit note was settled, for example by a refund or outside Office."},"resolution":{"$ref":"#/components/schemas/OfficeCreditResolutionKind"},"resolved_on":{"type":"string","format":"date","title":"Resolved On"},"invoice_case_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Invoice Case Id","description":"Legacy linked-credit invoice; omit for an independent settlement. Use apply_credit for new financial applications."},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","required":["type","resolution","resolved_on"],"title":"OfficeResolveCreditAction"},"OfficeResolveDuplicateAction":{"properties":{"type":{"type":"string","const":"resolve_duplicate","title":"Type","description":"Resolve this case as a duplicate of an existing case. This case is removed: keep_existing discards its documents, replace_existing moves them to the existing case and analyzes that case again."},"existing_case_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Existing Case Id"},"resolution":{"type":"string","enum":["keep_existing","replace_existing"],"title":"Resolution"}},"additionalProperties":false,"type":"object","required":["type","existing_case_id","resolution"],"title":"OfficeResolveDuplicateAction"},"OfficeRetryAnalysisAction":{"properties":{"type":{"type":"string","const":"retry_analysis","title":"Type","description":"Start the document analysis again after it could not be completed."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeRetryAnalysisAction"},"OfficeReverseCreditApplicationAction":{"properties":{"type":{"type":"string","const":"reverse_credit_application","title":"Type","description":"Undo an application of credit to an invoice so that the credit becomes available again."},"application_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Application Id"},"idempotency_key":{"type":"string","format":"uuid","title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["type","application_id","idempotency_key"],"title":"OfficeReverseCreditApplicationAction"},"OfficeReviewReasonSeverity":{"type":"string","enum":["blocking","acknowledgement_required"],"title":"OfficeReviewReasonSeverity"},"OfficeReviewView":{"properties":{"provenance":{"additionalProperties":{"$ref":"#/components/schemas/OfficeFieldSource"},"type":"object","title":"Provenance","description":"Source of each effective field: xml for a value read directly from invoice XML, derived for a deterministic calculation or mapping, analysis for AI extraction, or human for user input. Source alone does not establish validity or approval.","examples":[{"letter.response_deadline":"analysis","summary":"analysis"}]},"reasons":{"items":{"$ref":"#/components/schemas/OfficeValidationReason"},"type":"array","title":"Reasons","examples":[[]]}},"additionalProperties":false,"type":"object","required":["provenance","reasons"],"title":"OfficeReviewView","example":{"provenance":{"letter.response_deadline":"analysis","summary":"analysis"},"reasons":[]}},"OfficeReviseLetterDraftAction":{"properties":{"subject":{"type":"string","maxLength":500,"minLength":1,"title":"Subject"},"body":{"type":"string","maxLength":50000,"minLength":1,"title":"Body"},"type":{"type":"string","const":"revise_letter_draft","title":"Type","description":"Ask Office to revise the letter reply draft according to your instructions."},"instructions":{"type":"string","maxLength":10000,"minLength":1,"title":"Instructions"}},"additionalProperties":false,"type":"object","required":["subject","body","type","instructions"],"title":"OfficeReviseLetterDraftAction"},"OfficeSaveLetterDraftAction":{"properties":{"subject":{"type":"string","maxLength":500,"minLength":1,"title":"Subject"},"body":{"type":"string","maxLength":50000,"minLength":1,"title":"Body"},"type":{"type":"string","const":"save_letter_draft","title":"Type","description":"Save your own subject and body for the letter reply draft."}},"additionalProperties":false,"type":"object","required":["subject","body","type"],"title":"OfficeSaveLetterDraftAction"},"OfficeSaveRecommendationsAction":{"properties":{"type":{"type":"string","const":"save_recommendations","title":"Type","description":"Replace the list of recommended next steps for the case."},"recommendations":{"items":{"$ref":"#/components/schemas/OfficeRecommendationInput"},"type":"array","maxItems":30,"title":"Recommendations"}},"additionalProperties":false,"type":"object","required":["type","recommendations"],"title":"OfficeSaveRecommendationsAction"},"OfficeSaveReviewAction":{"properties":{"type":{"type":"string","const":"save_review","title":"Type","description":"Save corrections to the analyzed values of a case under review. Changed fields are marked as edited by a person."},"correction_reason":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Correction Reason","description":"Required when changing an existing value supported by invoice XML. The original XML remains unchanged."},"changes":{"$ref":"#/components/schemas/OfficeCaseValuesPatch","description":"Review edits. A document_type change may be combined with other edits in one save. The type change initializes the target details, preserves outgoing document facts in additional_facts, and transfers recognized unambiguous additional facts into empty compatible fields. Explicit edits are applied after the transfer; omitted fields retain their transferred values. Missing required facts block approval, not saving."}},"additionalProperties":false,"type":"object","required":["type","changes"],"title":"OfficeSaveReviewAction"},"OfficeSemanticThreadLinkSuggestion":{"properties":{"type":{"type":"string","const":"semantic_analysis","title":"Type","default":"semantic_analysis","examples":["semantic_analysis"]},"authoritative_case":{"$ref":"#/components/schemas/OfficeThreadCaseSummary"},"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason","examples":["Both letters concern the delivery date for order 1042."]}},"additionalProperties":false,"type":"object","required":["authoritative_case","reason"],"title":"OfficeSemanticThreadLinkSuggestion","example":{"authoritative_case":{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","state":"review_required","title":"Request for delivery confirmation"},"reason":"Both letters concern the delivery date for order 1042.","type":"semantic_analysis"}},"OfficeSentLetterReplyData":{"properties":{"id":{"type":"string","title":"Id","examples":["7442550215703679873"]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"approved_reply_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Approved Reply Id"},"accepted_subject":{"type":"string","title":"Accepted Subject"},"accepted_body":{"type":"string","title":"Accepted Body"},"docx_artifact_id":{"type":"string","title":"Docx Artifact Id","examples":["7442550215703679873"]},"pdf_artifact_id":{"type":"string","title":"Pdf Artifact Id","examples":["7442550215703679873"]},"configuration_snapshot":{"$ref":"#/components/schemas/OfficeLetterConfigurationSnapshot"},"dispatch_channel":{"$ref":"#/components/schemas/OfficeLetterDispatchChannel"},"dispatched_at":{"type":"string","format":"date-time","title":"Dispatched At"},"dispatch_external_reference":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Dispatch External Reference"}},"additionalProperties":false,"type":"object","required":["id","created_at","accepted_subject","accepted_body","docx_artifact_id","pdf_artifact_id","configuration_snapshot","dispatch_channel","dispatched_at"],"title":"OfficeSentLetterReplyData"},"OfficeSentLetterReplyView":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679004]},"approved_reply_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Approved Reply Id","examples":[7442550215703679137]},"accepted_subject":{"type":"string","title":"Accepted Subject","examples":["Delivery confirmation for order 1042"]},"accepted_body":{"type":"string","title":"Accepted Body","examples":["We confirm that order 1042 was delivered on 19 October 2026."]},"docx_artifact_id":{"type":"string","title":"Docx Artifact Id","examples":[7442550215703679004]},"pdf_artifact_id":{"type":"string","title":"Pdf Artifact Id","examples":[7442550215703679137]},"dispatch_channel":{"$ref":"#/components/schemas/OfficeLetterDispatchChannel","examples":["email"]},"dispatched_at":{"type":"string","format":"date-time","title":"Dispatched At","examples":["2026-10-19T09:00:00Z"]},"dispatch_external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dispatch External Reference","examples":["message-1042"]}},"additionalProperties":false,"type":"object","required":["id","approved_reply_id","accepted_subject","accepted_body","docx_artifact_id","pdf_artifact_id","dispatch_channel","dispatched_at","dispatch_external_reference"],"title":"OfficeSentLetterReplyView","example":{"accepted_body":"We confirm that order 1042 was delivered on 19 October 2026.","accepted_subject":"Delivery confirmation for order 1042","approved_reply_id":"7442550215703679137","dispatch_channel":"email","dispatch_external_reference":"message-1042","dispatched_at":"2026-10-19T09:00:00Z","docx_artifact_id":"7442550215703679004","id":"7442550215703679004","pdf_artifact_id":"7442550215703679137"}},"OfficeSetInvoiceControlsAction":{"properties":{"type":{"type":"string","const":"set_invoice_controls","title":"Type","description":"Set the payment hold, required payment approval, or obligation exception of an invoice, or clear a payment hold or obligation exception, and record the reason. A required payment approval is resolved by approving the invoice."},"controls":{"$ref":"#/components/schemas/OfficeInvoiceControls"},"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"}},"additionalProperties":false,"type":"object","required":["type","controls","reason"],"title":"OfficeSetInvoiceControlsAction"},"OfficeSetNoteAIUseAction":{"properties":{"type":{"type":"string","const":"set_note_ai_use","title":"Type","description":"Allow or disallow the use of a note when Office drafts a letter reply."},"note_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Note Id"},"allow_ai_use":{"type":"boolean","title":"Allow Ai Use"}},"additionalProperties":false,"type":"object","required":["type","note_id","allow_ai_use"],"title":"OfficeSetNoteAIUseAction"},"OfficeSetRecommendationCompletionAction":{"properties":{"type":{"type":"string","const":"set_recommendation_completion","title":"Type","description":"Mark a recommended next step as done or open again, optionally with a note."},"recommendation_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Recommendation Id"},"completed":{"type":"boolean","title":"Completed"},"note":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","required":["type","recommendation_id","completed"],"title":"OfficeSetRecommendationCompletionAction"},"OfficeSortBy":{"type":"string","enum":["created_at","updated_at"],"title":"OfficeSortBy"},"OfficeSortOrder":{"type":"string","enum":["asc","desc"],"title":"OfficeSortOrder"},"OfficeThreadCaseSummary":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679004]},"state":{"$ref":"#/components/schemas/OfficeCaseState","examples":["review_required"]},"document_type":{"anyOf":[{"$ref":"#/components/schemas/OfficeDocumentType"},{"type":"null"}],"examples":["letter"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","examples":["Request for delivery confirmation"]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["id","state","document_type","title","created_at"],"title":"OfficeThreadCaseSummary","example":{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","state":"review_required","title":"Request for delivery confirmation"}},"OfficeThreadListItem":{"properties":{"root":{"$ref":"#/components/schemas/OfficeThreadRootListItem"},"is_active":{"type":"boolean","title":"Is Active","description":"True when at least one case in the thread has a non-terminal lifecycle state.","examples":[true]},"member_count":{"type":"integer","minimum":1.0,"title":"Member Count","examples":[1]},"cases":{"items":{"$ref":"#/components/schemas/OfficeCaseListItem"},"type":"array","title":"Cases","description":"All cases in the thread, regardless of their queue or lifecycle state."},"active_cases":{"items":{"$ref":"#/components/schemas/OfficeCaseListItem"},"type":"array","title":"Active Cases","description":"Cases that currently own analysis or workflow work. Actions are applied to these case IDs, not the root ID."},"queues":{"items":{"$ref":"#/components/schemas/OfficeCaseQueue"},"type":"array","title":"Queues","examples":[["review","deadlines"]]},"next_action_deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Next Action Deadline","examples":["2026-10-26"]},"overdue":{"type":"boolean","title":"Overdue","examples":[false]},"last_activity":{"type":"string","format":"date-time","title":"Last Activity","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["root","is_active","member_count","cases","active_cases","queues","next_action_deadline","overdue","last_activity"],"title":"OfficeThreadListItem","example":{"active_cases":[{"analysis_status":"completed","change_history":[{"changed_at":"2026-10-19T09:00:00Z","user_id":null}],"document_type":"letter","handling_step":"review","id":"7442550215703679004","key_recommendation":"Confirm the delivery date.","last_activity":"2026-10-19T09:00:00Z","next_action_deadline":"2026-10-26","overdue":false,"payable_amount":{"amount":"125.00","currency":"EUR"},"queues":["review","deadlines"],"route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}],"cases":[{"analysis_status":"completed","change_history":[{"changed_at":"2026-10-19T09:00:00Z","user_id":null}],"document_type":"letter","handling_step":"review","id":"7442550215703679004","key_recommendation":"Confirm the delivery date.","last_activity":"2026-10-19T09:00:00Z","next_action_deadline":"2026-10-26","overdue":false,"payable_amount":{"amount":"125.00","currency":"EUR"},"queues":["review","deadlines"],"route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}],"is_active":true,"last_activity":"2026-10-19T09:00:00Z","member_count":1,"next_action_deadline":"2026-10-26","overdue":false,"queues":["review","deadlines"],"root":{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","last_activity":"2026-10-19T09:00:00Z","route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}}},"OfficeThreadListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OfficeThreadListItem"},"type":"array","title":"Items"},"counts":{"$ref":"#/components/schemas/OfficeThreadOperationalCounts"},"page":{"$ref":"#/components/schemas/PageResponse","examples":[{"has_next":false,"number":"1","size":"50","total":"1"}]}},"additionalProperties":false,"type":"object","required":["items","counts","page"],"title":"OfficeThreadListResponse","example":{"counts":{"archived":0,"completed":0,"creditor_documents":0,"deadlines":1,"errors":0,"in_progress":0,"review":1,"system_processing":0},"items":[{"active_cases":[{"analysis_status":"completed","change_history":[{"changed_at":"2026-10-19T09:00:00Z","user_id":null}],"document_type":"letter","handling_step":"review","id":"7442550215703679004","key_recommendation":"Confirm the delivery date.","last_activity":"2026-10-19T09:00:00Z","next_action_deadline":"2026-10-26","overdue":false,"payable_amount":{"amount":"125.00","currency":"EUR"},"queues":["review","deadlines"],"route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}],"cases":[{"analysis_status":"completed","change_history":[{"changed_at":"2026-10-19T09:00:00Z","user_id":null}],"document_type":"letter","handling_step":"review","id":"7442550215703679004","key_recommendation":"Confirm the delivery date.","last_activity":"2026-10-19T09:00:00Z","next_action_deadline":"2026-10-26","overdue":false,"payable_amount":{"amount":"125.00","currency":"EUR"},"queues":["review","deadlines"],"route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}],"is_active":true,"last_activity":"2026-10-19T09:00:00Z","member_count":1,"next_action_deadline":"2026-10-26","overdue":false,"queues":["review","deadlines"],"root":{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","last_activity":"2026-10-19T09:00:00Z","route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}}],"page":{"has_next":false,"number":"1","size":"50","total":"1"}}},"OfficeThreadMembersDeletionBlocker":{"properties":{"type":{"type":"string","const":"authoritative_thread_has_members","title":"Type","default":"authoritative_thread_has_members","examples":["authoritative_thread_has_members"]},"related_cases":{"items":{"$ref":"#/components/schemas/OfficeRelatedCaseSummary"},"type":"array","minItems":1,"title":"Related Cases"},"message":{"type":"string","title":"Message","examples":["Unlink the thread members before deleting its root."]}},"additionalProperties":false,"type":"object","required":["related_cases","message"],"title":"OfficeThreadMembersDeletionBlocker","example":{"message":"Unlink the thread members before deleting its root.","related_cases":[{"id":"7442550215703679137","state":"completed","title":"Invoice INV-2026-1042"}],"type":"authoritative_thread_has_members"}},"OfficeThreadOperationalCounts":{"properties":{"errors":{"type":"integer","minimum":0.0,"title":"Errors","description":"Active threads containing a case with a processing error.","examples":[0]},"deadlines":{"type":"integer","minimum":0.0,"title":"Deadlines","description":"Active threads with at least one effective user-action deadline.","examples":[1]},"review":{"type":"integer","minimum":0.0,"title":"Review","description":"Active threads containing a case that requires human review.","examples":[1]},"creditor_documents":{"type":"integer","minimum":0.0,"title":"Creditor Documents","description":"Active threads containing an in-progress creditor document.","examples":[0]},"system_processing":{"type":"integer","minimum":0.0,"title":"System Processing","description":"Active threads containing pending analysis or letter-draft processing.","examples":[0]},"in_progress":{"type":"integer","minimum":0.0,"title":"In Progress","description":"Active threads containing an in-progress case.","examples":[0]},"completed":{"type":"integer","minimum":0.0,"title":"Completed","description":"Inactive threads whose authoritative root is completed.","examples":[0]},"archived":{"type":"integer","minimum":0.0,"title":"Archived","description":"Inactive threads whose authoritative root is archived.","examples":[0]}},"additionalProperties":false,"type":"object","required":["errors","deadlines","review","creditor_documents","system_processing","in_progress","completed","archived"],"title":"OfficeThreadOperationalCounts","description":"Overlapping thread counts; active threads are not also counted as completed or archived.","example":{"archived":0,"completed":0,"creditor_documents":0,"deadlines":1,"errors":0,"in_progress":0,"review":1,"system_processing":0}},"OfficeThreadRootListItem":{"properties":{"id":{"type":"string","title":"Id","examples":[7442550215703679004]},"state":{"$ref":"#/components/schemas/OfficeCaseState","description":"Lifecycle state of the authoritative root case; not thread activity.","examples":["review_required"]},"document_type":{"anyOf":[{"$ref":"#/components/schemas/OfficeDocumentType"},{"type":"null"}],"examples":["letter"]},"route":{"anyOf":[{"$ref":"#/components/schemas/OfficeBranchRoute"},{"type":"null"}],"examples":["letter"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","examples":["Request for delivery confirmation"]},"sender":{"anyOf":[{"$ref":"#/components/schemas/OfficeParty"},{"type":"null"}],"examples":[{"email":"office@example.test","organization":"Example Supplies GmbH"}]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2026-10-19T09:00:00Z"]},"last_activity":{"type":"string","format":"date-time","title":"Last Activity","examples":["2026-10-19T09:00:00Z"]}},"additionalProperties":false,"type":"object","required":["id","state","document_type","route","title","sender","created_at","last_activity"],"title":"OfficeThreadRootListItem","example":{"created_at":"2026-10-19T09:00:00Z","document_type":"letter","id":"7442550215703679004","last_activity":"2026-10-19T09:00:00Z","route":"letter","sender":{"email":"office@example.test","organization":"Example Supplies GmbH"},"state":"review_required","title":"Request for delivery confirmation"}},"OfficeUnarchiveAction":{"properties":{"type":{"type":"string","const":"unarchive","title":"Type","description":"Restore an archived case to the completed cases."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeUnarchiveAction"},"OfficeUnlinkCaseAction":{"properties":{"type":{"type":"string","const":"unlink_case","title":"Type","description":"Remove this case from its correspondence."}},"additionalProperties":false,"type":"object","required":["type"],"title":"OfficeUnlinkCaseAction"},"OfficeValidationReason":{"properties":{"key":{"type":"string","maxLength":300,"minLength":1,"title":"Key"},"code":{"type":"string","maxLength":100,"minLength":1,"title":"Code"},"field":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Field"},"severity":{"$ref":"#/components/schemas/OfficeReviewReasonSeverity"},"explanation":{"type":"string","maxLength":2000,"minLength":1,"title":"Explanation"}},"additionalProperties":false,"type":"object","required":["key","code","severity","explanation"],"title":"OfficeValidationReason"},"OneTapOTPParam":{"properties":{"type":{"type":"string","const":"ONE_TAP_OTP","title":"Type","description":"Runtime one-tap OTP button parameter type.","examples":["ONE_TAP_OTP"]},"otp":{"type":"string","minLength":1,"title":"Otp","description":"OTP value for one-tap OTP buttons.","examples":["576146","942147"]}},"additionalProperties":false,"type":"object","required":["type","otp"],"title":"OneTapOTPParam"},"PageRequest":{"properties":{"number":{"type":"integer","minimum":1.0,"title":"Number","default":1},"size":{"type":"integer","minimum":1.0,"title":"Size","default":50},"cursor":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cursor"}},"type":"object","title":"PageRequest"},"PageResponse":{"properties":{"number":{"type":"string","title":"Number"},"size":{"type":"string","title":"Size"},"total":{"type":"string","title":"Total"},"cursor":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cursor"},"has_next":{"type":"boolean","title":"Has Next","default":false}},"type":"object","required":["number","size","total"],"title":"PageResponse"},"ParamFormat":{"type":"string","enum":["POSITIONAL","NAMED","UNKNOWN"],"title":"ParamFormat","description":"The type of parameter formatting the HEADER and BODY components of the template will use.\n\nAttributes:\n    POSITIONAL: The component uses positional parameters, e.g. ``{{1}}``, ``{{2}}``, etc.\n    NAMED: The component uses named parameters, e.g. ``{{param_name}}``."},"PartManifest":{"properties":{"part_id":{"type":"string","title":"Part Id"},"file_name":{"type":"string","title":"File Name"},"media_type":{"type":"string","title":"Media Type"},"outcome":{"type":"string","enum":["pending","read","partial","excluded","unsupported","empty","encrypted","failed"],"title":"Outcome"},"detail":{"type":"string","title":"Detail","default":""},"extraction_version":{"type":"string","title":"Extraction Version","default":"mailbox-v1"}},"type":"object","required":["part_id","file_name","media_type","outcome"],"title":"PartManifest"},"PermissionCatalogItemModel":{"properties":{"resource":{"type":"string","title":"Resource","description":"Resource/table name.","examples":["roles"]},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"Valid permissions for the resource.","examples":[["agents.read","agents.read.any","knowledgefile.read.granted"],["users.read","users.update","groups.read"],["roles.create","roles.update","roles.delete.any"],["agents.read.own","groups.read","users.read"]]}},"type":"object","required":["resource"],"title":"PermissionCatalogItemModel","example":{"permissions":["agents.read","agents.read.any","knowledgefile.read.granted"],"resource":"roles"}},"PhoneNumberStatusBase":{"properties":{"number_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number Status","description":"Phone number status","examples":["CONNECTED"]},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status","description":"WhatsApp business account review status","examples":["APPROVED"]},"webhook_subscribed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Subscribed","description":"Webhook subscription status","examples":["TRUE"]}},"type":"object","title":"PhoneNumberStatusBase","example":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE"}},"PreparationPolicy":{"properties":{"images":{"type":"string","enum":["include","exclude"],"title":"Images","default":"include"}},"additionalProperties":false,"type":"object","title":"PreparationPolicy"},"PreparedItemBody":{"properties":{"text":{"type":"string","maxLength":200000,"minLength":1,"title":"Text"}},"additionalProperties":false,"type":"object","required":["text"],"title":"PreparedItemBody","example":{"text":"<text>"}},"PreviewCustomToolRequestBody":{"properties":{"tool_name":{"type":"string","maxLength":128,"minLength":1,"title":"Tool Name","description":"Tool name.","examples":["lookup_customer"]},"tool_description":{"type":"string","minLength":1,"title":"Tool Description","description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."]},"request_config":{"$ref":"#/components/schemas/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/components/schemas/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Retries","description":"Max retries.","examples":[1]},"read_only":{"type":"boolean","title":"Read Only","description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","default":false},"defer_loading":{"type":"boolean","title":"Defer Loading","description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","default":false,"examples":[true]},"input_schema":{"$ref":"#/components/schemas/CustomToolInputSchema-Input","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Api Key","description":"Omit to use the saved tool's stored API key (requires agent_tool_id). Send null to build the request without a key, or a string to use that key. Key values are never returned.","examples":["sk_tool_live_123456"]},"agent_tool_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Tool Id","description":"Saved custom tool of this agent. When set, an omitted api_key or request_config.body_template uses the stored value, as in updateCustomToolForAgent.","examples":[7442551216804781021]},"arguments":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Arguments","description":"Sample arguments exactly as the agent would send them. They are validated like a real tool call.","examples":[{"name":"Acme"}]}},"type":"object","required":["tool_name","tool_description","request_config"],"title":"PreviewCustomToolRequestBody","example":{"agent_tool_id":"7442551216804781021","arguments":{"name":"Acme"},"input_schema":{"parameters":[{"description":"Company name to search for.","location":"body","name":"name","type":"string"}]},"request_config":{"additional_headers":{"X-Workspace-Id":"example"},"api_url":"https://api.example.com/v1/contacts/search","body_template":{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10},"http_method":"POST"},"tool_description":"Searches companies by name and returns their ID, name, and email address.","tool_name":"search_companies"}},"PreviewCustomToolRequestResponse":{"properties":{"validated_arguments":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Validated Arguments","description":"Arguments after validation, with defaults applied, exactly as used to build the request.","examples":[{"name":"Acme"}]},"request":{"$ref":"#/components/schemas/CustomToolRequestSnapshot","description":"Request as it would be sent. API keys and configured header values are redacted.","examples":[{"body_size_bytes":98,"body_text":"{\"filter\":{\"name\":{\"contains\":\"Acme\"},\"type\":\"company\"},\"fields\":[\"id\",\"name\",\"email\"],\"limit\":10}","body_truncated":false,"headers":[{"name":"Host","value":"api.example.com"},{"name":"X-Workspace-Id","value":"<redacted>"},{"name":"Authorization","value":"Bearer <redacted>"},{"name":"Content-Length","value":"98"},{"name":"Content-Type","value":"application/json"}],"headers_truncated":false,"method":"POST","timeout_seconds":30.0,"url":"https://api.example.com/v1/contacts/search","url_truncated":false}]},"has_api_key":{"type":"boolean","title":"Has Api Key","description":"Whether the request includes an API key.","examples":[true]}},"type":"object","required":["validated_arguments","request","has_api_key"],"title":"PreviewCustomToolRequestResponse","example":{"has_api_key":true,"request":{"body_size_bytes":98,"body_text":"{\"filter\":{\"name\":{\"contains\":\"Acme\"},\"type\":\"company\"},\"fields\":[\"id\",\"name\",\"email\"],\"limit\":10}","body_truncated":false,"headers":[{"name":"Host","value":"api.example.com"},{"name":"X-Workspace-Id","value":"<redacted>"},{"name":"Authorization","value":"Bearer <redacted>"},{"name":"Content-Length","value":"98"},{"name":"Content-Type","value":"application/json"}],"headers_truncated":false,"method":"POST","timeout_seconds":30.0,"url":"https://api.example.com/v1/contacts/search","url_truncated":false},"validated_arguments":{"name":"Acme"}}},"QuickReplyParam":{"properties":{"type":{"type":"string","const":"QUICK_REPLY","title":"Type","description":"Runtime quick reply button parameter type.","examples":["QUICK_REPLY"]},"index":{"type":"integer","minimum":0.0,"title":"Index","description":"Zero-based button index.","examples":[0,1,2]},"callback_data":{"type":"string","minLength":1,"title":"Callback Data","description":"Callback payload for quick reply buttons.","examples":["confirm_appointment","open_support_ticket"]}},"additionalProperties":false,"type":"object","required":["type","index","callback_data"],"title":"QuickReplyParam"},"ReauthorizeIntegrationIdentityBody":{"properties":{"completion_redirect_uri":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Completion Redirect Uri","description":"Allowed redirect URI to open after authorization completes. Omit to receive the callback result as JSON.","examples":["https://app.livoi.de/integrations/oauth/complete"]}},"additionalProperties":false,"type":"object","title":"ReauthorizeIntegrationIdentityBody","example":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete"}},"ReconnectDatevProfileBody":{"properties":{"code":{"type":"string","title":"Code","description":"Authorization code from DATEV redirect","examples":["abc123"]},"code_verifier":{"type":"string","title":"Code Verifier","description":"PKCE code_verifier used in the authorization request","examples":["someRandomVerifier"]},"redirect_uri":{"type":"string","title":"Redirect Uri","description":"Redirect URI used in the authorization request","examples":["http://localhost"]},"profile_name":{"type":"string","title":"Profile Name","description":"Optional profile name update during reconnect","default":"","examples":["Steuerberater"]}},"type":"object","required":["code","code_verifier","redirect_uri"],"title":"ReconnectDatevProfileBody","example":{"code":"abc123","code_verifier":"someRandomVerifier","profile_name":"Steuerberater","redirect_uri":"http://localhost"}},"ReconnectDatevProfileResponse":{"properties":{"id":{"type":"string","title":"Id","description":"DATEV profile ID","examples":[7442550215703679004]},"name":{"type":"string","title":"Name","description":"Human readable name for this DATEV connection","examples":["Steuerberater"]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Creation timestamp","examples":["2026-02-11T09:00:00+00:00"]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Access token expiration timestamp","examples":["2026-02-11T10:00:00+00:00"]},"refresh_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Refresh At","description":"Next required refresh for token","examples":["2026-03-13T09:00:00+00:00"]},"message":{"type":"string","title":"Message","description":"Success message","examples":["DATEV profile reconnected successfully."]}},"type":"object","required":["id","name","message"],"title":"ReconnectDatevProfileResponse","example":{"created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","id":"7442550215703679004","message":"DATEV profile reconnected successfully.","name":"Steuerberater","refresh_at":"2026-03-13T09:00:00+00:00"}},"RefreshDatevProfileTokensResponse":{"properties":{"id":{"type":"string","title":"Id","description":"DATEV profile ID","examples":[7442550215703679004]},"name":{"type":"string","title":"Name","description":"Human readable name for this DATEV connection","examples":["Steuerberater"]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Creation timestamp","examples":["2026-02-11T09:00:00+00:00"]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Access token expiration timestamp","examples":["2026-02-11T10:00:00+00:00"]},"refresh_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Refresh At","description":"Next required refresh for token","examples":["2026-03-13T09:00:00+00:00"]},"message":{"type":"string","title":"Message","description":"Success message","examples":["DATEV tokens refreshed successfully."]}},"type":"object","required":["id","name","message"],"title":"RefreshDatevProfileTokensResponse","example":{"created_at":"2026-02-11T09:00:00+00:00","expires_at":"2026-02-11T10:00:00+00:00","id":"7442550215703679004","message":"DATEV tokens refreshed successfully.","name":"Steuerberater","refresh_at":"2026-03-13T09:00:00+00:00"}},"RegisterPhoneNumberBody":{"properties":{"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin","description":"Pin used for registration","examples":["123456"]}},"type":"object","title":"RegisterPhoneNumberBody","example":{"pin":"123456"}},"RegisterPhoneNumberResponse":{"properties":{"number_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number Status","description":"Phone number status","examples":["CONNECTED"]},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status","description":"WhatsApp business account review status","examples":["APPROVED"]},"webhook_subscribed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Subscribed","description":"Webhook subscription status","examples":["TRUE"]},"message":{"type":"string","title":"Message","description":"Success message","examples":["Phone number 12345678901234567890 created successfully!"]},"status":{"$ref":"#/components/schemas/PhoneNumberStatusBase","description":"Phone number status"},"next_step":{"type":"string","title":"Next Step","description":"Next step required to complete phone number registration","examples":["Register the phone number (no PIN required)"]},"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin","description":"Pin used for registration","default":"","examples":["123456"]}},"type":"object","required":["message","status","next_step"],"title":"RegisterPhoneNumberResponse","example":{"message":"Phone number 12345678901234567890 created successfully!","next_step":"Register the phone number (no PIN required)","number_status":"CONNECTED","pin":"123456","review_status":"APPROVED","status":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE"},"webhook_subscribed":"TRUE"}},"RemoveAgentWhitelistBody":{"properties":{"entries":{"additionalProperties":{"items":{"type":"string"},"type":"array","uniqueItems":true},"propertyNames":{"$ref":"#/components/schemas/WhitelistMatchType"},"type":"object","title":"Entries","description":"Whitelist entries keyed by match type, for example user_id, email, email_domain, phone_number, clerk, whatsapp, microsoft, or better_auth.","examples":[{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]}]},"entry_ids":{"items":{"type":"integer"},"type":"array","uniqueItems":true,"title":"Entry Ids","description":"Whitelist entry IDs to remove from the agent whitelist.","examples":[[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]]}},"type":"object","title":"RemoveAgentWhitelistBody","example":{"entries":{"clerk":["user_123"],"email_domain":["example.com"],"phone_number":["+491701234567"],"user_id":["7442551216804781021"],"whatsapp":["DE.7349586264223476"]},"entry_ids":["7442678451937742389","7442678451937742086","7442678451937742214","7442678451937742520"]}},"RemoveAgentWhitelistResponse":{"properties":{"removed":{"type":"string","title":"Removed","description":"Summary of whitelist entries removed.","examples":["Removed 2 whitelist entries."]},"not_present":{"type":"string","title":"Not Present","description":"Summary of entries that were not present.","examples":["1 whitelist entry was not present."]},"not_found":{"additionalProperties":{"type":"string"},"type":"object","title":"Not Found","description":"Whitelist entry IDs that could not be resolved.","examples":[{"123456789012345678":"whitelist entry not found"}]}},"type":"object","required":["removed","not_present","not_found"],"title":"RemoveAgentWhitelistResponse","example":{"not_found":{"123456789012345678":"whitelist entry not found"},"not_present":"1 whitelist entry was not present.","removed":"Removed 2 whitelist entries."}},"RemoveGroupMemberResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"RemoveGroupMemberResponse","example":{"success":true}},"RemoveGroupRoleResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"RemoveGroupRoleResponse","example":{"success":true}},"RemoveRolePermissionsBody":{"properties":{"permission_ids":{"items":{"type":"integer"},"type":"array","uniqueItems":true,"title":"Permission Ids","description":"Role permission row IDs.","examples":[[7442678451937742086],[7442678451937742086,7442678451937742214]]},"permission_names":{"items":{"type":"string"},"type":"array","title":"Permission Names","description":"Role permission names.","examples":[["roles.read"],["roles.update","users.read"]]}},"type":"object","title":"RemoveRolePermissionsBody","example":{"permission_ids":["7442678451937742086"],"permission_names":["roles.read"]}},"RemoveRolePermissionsResponse":{"properties":{"removed_success":{"additionalProperties":{"type":"string"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object","title":"Removed Success","description":"Removed role permission IDs mapped to permission strings.","examples":[{"7442678451937742086":"agents:read"}]},"remove_failed_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","uniqueItems":true,"title":"Remove Failed Ids","description":"Role permission row IDs that were not removed.","examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]},"remove_failed_names":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Remove Failed Names","description":"Role permission names that were not removed.","examples":[["agents:delete"]]}},"type":"object","title":"RemoveRolePermissionsResponse","example":{"remove_failed_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"remove_failed_names":["agents:delete"],"removed_success":{"7442678451937742086":"agents:read"}}},"RemoveUserRoleBody":{"properties":{"user_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"User Ids","description":"User IDs to remove role from.","examples":[[7442678451937742086],[7442678451937742086,7442678451937742214,7442678451937742389]]}},"type":"object","required":["user_ids"],"title":"RemoveUserRoleBody","example":{"user_ids":["7442678451937742086"]}},"RemoveUserRoleResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Operation result.","default":true,"examples":[true]},"removed_user_ids":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array","uniqueItems":true,"title":"Removed User Ids","description":"User IDs that were successfully removed from the role.","examples":[[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]]},"failed":{"anyOf":[{"additionalProperties":{"type":"string"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object"},{"type":"null"}],"title":"Failed","description":"Failed removals mapped by user ID to error message.","examples":[{"7442550215703679004":"User role assignment not found."}]}},"type":"object","required":["removed_user_ids"],"title":"RemoveUserRoleResponse","example":{"failed":{"7442550215703679004":"User role assignment not found."},"removed_user_ids":["7442678451937742389","7442678451937742086","7442678451937742214","7442678451937742520"],"success":true}},"RequestPhoneNumberCodeBody":{"properties":{"code_method":{"type":"string","enum":["SMS","VOICE"],"title":"Code Method","description":"Method to receive the verification code","examples":["SMS","VOICE"]},"language":{"type":"string","title":"Language","description":"Language for the verification code (e.g., en_US, de)","default":"en_US","examples":["en_US","de"]}},"type":"object","required":["code_method"],"title":"RequestPhoneNumberCodeBody","example":{"code_method":"SMS","language":"en_US"}},"RequireAllowedChatMediaUpload":{"type":"string","format":"binary"},"RequireAllowedKnowledgeFileUpload":{"type":"string","format":"binary"},"RequireAllowedOfficeDocumentUpload":{"type":"string","format":"binary"},"RequireAllowedStorageObjectUpload":{"type":"string","format":"binary"},"ResourceGrantListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Resource grant ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"resource_kind":{"type":"string","title":"Resource Kind","description":"Resource kind / table name.","examples":["knowledgefile","storage_objects","agents","chats","datev_profiles"]},"resource_id":{"type":"string","title":"Resource Id","description":"Resource ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"subject_kind":{"$ref":"#/components/schemas/SubjectKind","description":"Grant subject kind.","examples":["user","group","role","api_key"]},"subject_id":{"type":"string","title":"Subject Id","description":"Grant subject ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"permission":{"type":"string","title":"Permission","description":"Granted permission string.","examples":["agents.read.granted","storage_objects.read.granted","chats.update.granted","datev_profiles.access_manage.granted"]}},"type":"object","required":["id","tenant_id","resource_kind","resource_id","subject_kind","subject_id","permission"],"title":"ResourceGrantListItem","example":{"id":"7443001845129083411","permission":"agents.read.granted","resource_id":"7442551216804781021","resource_kind":"knowledgefile","subject_id":"7442678451937742086","subject_kind":"user","tenant_id":"7442550215703679004"}},"RetrieveWhitelistsBody":{"properties":{"agent_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Agent Ids","description":"List of agent IDs to retrieve whitelists for.","examples":[[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","required":["agent_ids"],"title":"RetrieveWhitelistsBody","example":{"agent_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"]}},"RetrieveWhitelistsResponse":{"properties":{"whitelists":{"items":{"$ref":"#/components/schemas/WhitelistEntry"},"type":"array","title":"Whitelists","description":"List of whitelist entries for the requested agent IDs."}},"type":"object","required":["whitelists"],"title":"RetrieveWhitelistsResponse","example":{"whitelists":[{"agent_id":"7442550215703679004","entries":[{"email":"sprizzy@p-cation.de","entry_id":"7442678451937742086","match_type":"email","match_value":"sprizzy@p-cation.de","phone_number":"+491701234567","user_id":"7442678451937742086"}]}]}},"RevokeApiKeyResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded.","default":true,"examples":[true,false]}},"type":"object","title":"RevokeApiKeyResponse","example":{"success":true}},"RevokeDatevProfileAccessResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Success message","examples":["DATEV profile access revoked successfully."]}},"type":"object","required":["message"],"title":"RevokeDatevProfileAccessResponse","example":{"message":"DATEV profile access revoked successfully."}},"RoleListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Role ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Role description.","examples":["Can manage tenant resources.","Supervises support operations.","Handles day-to-day platform tasks.","Can read and write files."]}},"type":"object","required":["id","tenant_id","name"],"title":"RoleListItem","example":{"description":"Can manage tenant resources.","id":"7443001845129083411","name":"Administrator","tenant_id":"7442550215703679004"}},"RolePermissionListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Role permission row ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"role_id":{"type":"string","title":"Role Id","description":"Role ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"permission":{"type":"string","title":"Permission","description":"Permission string.","examples":["agents.read.any","knowledgefile.read.granted","users.read","roles.update"]}},"type":"object","required":["id","role_id","permission"],"title":"RolePermissionListItem","example":{"id":"7442678451937742086","permission":"agents.read.any","role_id":"7443001845129083411"}},"RoleUserListItem":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"role_id":{"type":"string","title":"Role Id","description":"Role ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]}},"type":"object","required":["user_id","role_id","tenant_id"],"title":"RoleUserListItem","example":{"role_id":"7442551216804781021","tenant_id":"7442550215703679004","user_id":"7442678451937742086"}},"RunView":{"properties":{"run_id":{"type":"string","title":"Run Id","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"attempt":{"type":"integer","title":"Attempt","examples":[1]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"result":{"anyOf":[{"$ref":"#/components/schemas/BackgroundResult"},{"type":"null"}],"examples":[{"data":{"customer_id":"C-100"},"outcome":"ready","reason":"Customer matched.","reason_code":""}]},"evidence":{"items":{"$ref":"#/components/schemas/ToolEvidence"},"type":"array","title":"Evidence","examples":[[{"arguments":{"name":"Example GmbH"},"result":{"customer_id":"C-100"},"tool_name":"lookup_customer"}]]}},"type":"object","required":["run_id","attempt","error_code","result","evidence"],"title":"RunView","example":{"attempt":1,"error_code":"<error_code>","evidence":[{"arguments":{"name":"Example GmbH"},"result":{"customer_id":"C-100"},"tool_name":"lookup_customer"}],"result":{"data":{"customer_id":"C-100"},"outcome":"ready","reason":"Customer matched.","reason_code":""},"run_id":"7443001845129083411"}},"SeedAgentToolsBody":{"properties":{"function_names":{"items":{"type":"string"},"type":"array","title":"Function Names","description":"Built-in tool function names to seed for the agent.","examples":[["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]]}},"type":"object","required":["function_names"],"title":"SeedAgentToolsBody","example":{"function_names":["retrieve_appointment_calendar_tool","create_einvoice_xml_tool"]}},"SeedAgentToolsResponse":{"properties":{"seeded_count_message":{"type":"string","title":"Seeded Count Message","description":"Summary of seeded built-in tools.","examples":["Seeded 4 tools."]},"auto_assigned_datev_profile_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Auto Assigned Datev Profile Id","description":"Auto-assigned DATEV profile ID, when DATEV tooling was seeded.","examples":[7442551216804781198]}},"type":"object","required":["seeded_count_message"],"title":"SeedAgentToolsResponse","example":{"auto_assigned_datev_profile_id":"7442551216804781198","seeded_count_message":"Seeded 4 tools."}},"SendCustomToolTestRequestBody":{"properties":{"tool_name":{"type":"string","maxLength":128,"minLength":1,"title":"Tool Name","description":"Tool name.","examples":["lookup_customer"]},"tool_description":{"type":"string","minLength":1,"title":"Tool Description","description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."]},"request_config":{"$ref":"#/components/schemas/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/components/schemas/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Retries","description":"Max retries.","examples":[1]},"read_only":{"type":"boolean","title":"Read Only","description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","default":false},"defer_loading":{"type":"boolean","title":"Defer Loading","description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","default":false,"examples":[true]},"input_schema":{"$ref":"#/components/schemas/CustomToolInputSchema-Input","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Api Key","description":"Omit to use the saved tool's stored API key (requires agent_tool_id). Send null to build the request without a key, or a string to use that key. Key values are never returned.","examples":["sk_tool_live_123456"]},"agent_tool_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Tool Id","description":"Saved custom tool of this agent. When set, an omitted api_key or request_config.body_template uses the stored value, as in updateCustomToolForAgent.","examples":[7442551216804781021]},"arguments":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Arguments","description":"Sample arguments exactly as the agent would send them. They are validated like a real tool call.","examples":[{"name":"Acme"}]},"confirm_upstream_request":{"type":"boolean","const":true,"title":"Confirm Upstream Request","description":"Must be true. Sends one real request that can create, change, or delete data in the connected API.","examples":[true]}},"type":"object","required":["tool_name","tool_description","request_config","confirm_upstream_request"],"title":"SendCustomToolTestRequestBody","example":{"agent_tool_id":"7442551216804781021","arguments":{"name":"Acme"},"confirm_upstream_request":true,"input_schema":{"parameters":[{"description":"Company name to search for.","location":"body","name":"name","type":"string"}]},"request_config":{"additional_headers":{"X-Workspace-Id":"example"},"api_url":"https://api.example.com/v1/contacts/search","body_template":{"fields":["id","name","email"],"filter":{"name":{"contains":{"$livoi_input":"name"}},"type":"company"},"limit":10},"http_method":"POST"},"tool_description":"Searches companies by name and returns their ID, name, and email address.","tool_name":"search_companies"}},"SendCustomToolTestRequestResponse":{"properties":{"validated_arguments":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Validated Arguments","description":"Arguments after validation, with defaults applied, exactly as used to build the request.","examples":[{"name":"Acme"}]},"request":{"$ref":"#/components/schemas/CustomToolRequestSnapshot","description":"Request as it would be sent. API keys and configured header values are redacted.","examples":[{"body_size_bytes":98,"body_text":"{\"filter\":{\"name\":{\"contains\":\"Acme\"},\"type\":\"company\"},\"fields\":[\"id\",\"name\",\"email\"],\"limit\":10}","body_truncated":false,"headers":[{"name":"Host","value":"api.example.com"},{"name":"X-Workspace-Id","value":"<redacted>"},{"name":"Authorization","value":"Bearer <redacted>"},{"name":"Content-Length","value":"98"},{"name":"Content-Type","value":"application/json"}],"headers_truncated":false,"method":"POST","timeout_seconds":30.0,"url":"https://api.example.com/v1/contacts/search","url_truncated":false}]},"has_api_key":{"type":"boolean","title":"Has Api Key","description":"Whether the request includes an API key.","examples":[true]},"outcome":{"type":"string","enum":["completed","http_error","response_error","timeout","connection_error","response_too_large"],"title":"Outcome","description":"Result of the test request. Upstream failures are reported here with HTTP 200.","examples":["completed"]},"request_possibly_processed":{"type":"boolean","title":"Request Possibly Processed","description":"Whether the connected API may have received and processed the request.","examples":[true]},"duration_ms":{"type":"integer","minimum":0.0,"title":"Duration Ms","description":"Time from sending the request until the response body was read.","examples":[412]},"response":{"anyOf":[{"$ref":"#/components/schemas/CustomToolTestResponse"},{"type":"null"}],"description":"Upstream response with redacted headers and a bounded body. Null when no response was received.","examples":[{"body_size_bytes":63,"body_text":"[{\"id\": 7, \"name\": \"Acme GmbH\", \"email\": \"info@acme.example\"}]","body_truncated":false,"headers":[{"name":"content-type","value":"application/json"}],"headers_truncated":false,"status_code":200}]},"agent_result":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"title":"Agent Result","description":"Result the agent would receive for this response. Null when the response was too large or omitted.","examples":[{"response":[{"email":"info@acme.example","id":7,"name":"Acme GmbH"}],"status":"completed","status_code":200}]},"agent_result_omitted":{"type":"boolean","title":"Agent Result Omitted","description":"Whether agent_result was omitted because it exceeds the response size limit.","default":false,"examples":[false]}},"type":"object","required":["validated_arguments","request","has_api_key","outcome","request_possibly_processed","duration_ms"],"title":"SendCustomToolTestRequestResponse","example":{"agent_result":{"response":[{"email":"info@acme.example","id":7,"name":"Acme GmbH"}],"status":"completed","status_code":200},"agent_result_omitted":false,"duration_ms":412,"has_api_key":true,"outcome":"completed","request":{"body_size_bytes":98,"body_text":"{\"filter\":{\"name\":{\"contains\":\"Acme\"},\"type\":\"company\"},\"fields\":[\"id\",\"name\",\"email\"],\"limit\":10}","body_truncated":false,"headers":[{"name":"Host","value":"api.example.com"},{"name":"X-Workspace-Id","value":"<redacted>"},{"name":"Authorization","value":"Bearer <redacted>"},{"name":"Content-Length","value":"98"},{"name":"Content-Type","value":"application/json"}],"headers_truncated":false,"method":"POST","timeout_seconds":30.0,"url":"https://api.example.com/v1/contacts/search","url_truncated":false},"request_possibly_processed":true,"response":{"body_size_bytes":63,"body_text":"[{\"id\": 7, \"name\": \"Acme GmbH\", \"email\": \"info@acme.example\"}]","body_truncated":false,"headers":[{"name":"content-type","value":"application/json"}],"headers_truncated":false,"status_code":200},"validated_arguments":{"name":"Acme"}}},"SendTemplateBody":{"properties":{"template_id":{"type":"integer","title":"Template Id","description":"Identifier of the stored WhatsApp template to send.","examples":[7442550215703679137]},"language_code":{"anyOf":[{"$ref":"#/components/schemas/TemplateLanguage"},{"type":"null"}],"description":"Optional template language override. Defaults to the stored template language when omitted.","examples":["de","en"]},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers","description":"Explicit recipient phone numbers.","examples":[["+491701234567"],["+491701234567","+4917611122233"]]},"user_ids":{"items":{"type":"integer"},"type":"array","title":"User Ids","description":"Recipient user IDs. Their phone numbers from this tenant's user profiles are merged into the recipient list.","examples":[[744128060820239091],[7442550215703679004,7442550215703679137]]},"label_ids":{"items":{"type":"integer"},"type":"array","title":"Label Ids","description":"Recipient label IDs. Chats with these labels will be resolved to users and then to phone numbers.","examples":[[7442550215703679284],[7442550215703679284,7442550215703679412]]},"only_related_chats":{"type":"boolean","title":"Only Related Chats","description":"When true, label-based chat resolution only uses chats related to the selected sending phone number.","default":false,"examples":[true,false]},"params":{"anyOf":[{"items":{"oneOf":[{"$ref":"#/components/schemas/BodyTextParam"},{"$ref":"#/components/schemas/HeaderTextParam"},{"$ref":"#/components/schemas/AuthenticationBodyParam"},{"$ref":"#/components/schemas/HeaderImageParam"},{"$ref":"#/components/schemas/HeaderVideoParam"},{"$ref":"#/components/schemas/HeaderGIFParam"},{"$ref":"#/components/schemas/HeaderDocumentParam"},{"$ref":"#/components/schemas/HeaderLocationParam"},{"$ref":"#/components/schemas/HeaderProductParam"},{"$ref":"#/components/schemas/QuickReplyParam"},{"$ref":"#/components/schemas/URLParam"},{"$ref":"#/components/schemas/CopyCodeParam"},{"$ref":"#/components/schemas/FlowParam"},{"$ref":"#/components/schemas/CatalogParam"},{"$ref":"#/components/schemas/MPMParam"},{"$ref":"#/components/schemas/OTPParam"},{"$ref":"#/components/schemas/OneTapOTPParam"},{"$ref":"#/components/schemas/ZeroTapOTPParam"},{"$ref":"#/components/schemas/CopyCodeOTPParam"},{"$ref":"#/components/schemas/LimitedTimeOfferParam"},{"$ref":"#/components/schemas/CarouselParam"}],"discriminator":{"propertyName":"type","mapping":{"AUTHENTICATION_BODY":"#/components/schemas/AuthenticationBodyParam","BODY_TEXT":"#/components/schemas/BodyTextParam","CAROUSEL":"#/components/schemas/CarouselParam","CATALOG":"#/components/schemas/CatalogParam","COPY_CODE":"#/components/schemas/CopyCodeParam","COPY_CODE_OTP":"#/components/schemas/CopyCodeOTPParam","FLOW":"#/components/schemas/FlowParam","HEADER_DOCUMENT":"#/components/schemas/HeaderDocumentParam","HEADER_GIF":"#/components/schemas/HeaderGIFParam","HEADER_IMAGE":"#/components/schemas/HeaderImageParam","HEADER_LOCATION":"#/components/schemas/HeaderLocationParam","HEADER_PRODUCT":"#/components/schemas/HeaderProductParam","HEADER_TEXT":"#/components/schemas/HeaderTextParam","HEADER_VIDEO":"#/components/schemas/HeaderVideoParam","LIMITED_TIME_OFFER":"#/components/schemas/LimitedTimeOfferParam","MPM":"#/components/schemas/MPMParam","ONE_TAP_OTP":"#/components/schemas/OneTapOTPParam","OTP":"#/components/schemas/OTPParam","QUICK_REPLY":"#/components/schemas/QuickReplyParam","URL":"#/components/schemas/URLParam","ZERO_TAP_OTP":"#/components/schemas/ZeroTapOTPParam"}}},"type":"array"},{"type":"null"}],"title":"Params","description":"Runtime params for the stored template components. The same params are applied to every resolved recipient.","examples":[[{"type":"HEADER_TEXT","values":["LIVOI"]},{"type":"BODY_TEXT","values":["Max",{"fallback_value":"Tuesday","type":"DATE_TIME"}]},{"index":0,"type":"URL","url_variable":"appointment/123"}],[{"type":"BODY_TEXT","values":["Max",{"fallback_value":"Tuesday","type":"DATE_TIME"}]}],[{"callback_data":"confirm_appointment","index":0,"type":"QUICK_REPLY"}]]}},"type":"object","required":["template_id"],"title":"SendTemplateBody","example":{"label_ids":["7442550215703679284"],"language_code":"de","only_related_chats":true,"params":[{"type":"HEADER_TEXT","values":["LIVOI"]},{"type":"BODY_TEXT","values":["Max",{"fallback_value":"Tuesday","type":"DATE_TIME"}]},{"index":0,"type":"URL","url_variable":"appointment/123"}],"phone_numbers":["+491701234567"],"template_id":"7442550215703679137","user_ids":["744128060820239091"]}},"SendTemplateResponse":{"properties":{"sent_to":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Sent To","description":"Recipient phone numbers for which Meta accepted the template send request.","examples":[["+491701234567","+4917611122233"],["+4915112349876","+492211234560"]]},"results":{"items":{"$ref":"#/components/schemas/TemplateRecipientResult"},"type":"array","title":"Results"},"delivery_status":{"type":"string","enum":["delivered","pending_confirmation","not_sent"],"title":"Delivery Status","description":"Aggregate delivery confirmation. Per-recipient results describe partial outcomes; acceptance alone does not confirm delivery.","examples":["delivered","pending_confirmation"]}},"type":"object","required":["sent_to","results","delivery_status"],"title":"SendTemplateResponse","example":{"delivery_status":"delivered","results":[{"outcome":"accepted","recipient":"+491701234567"}],"sent_to":["+491701234567","+4917611122233"]}},"SendWhatsAppMessageBody":{"properties":{"target":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"Target","description":"Target phone number or user_id.","examples":[["491701234567","4917611122233","4915112349876","492211234560"],[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]},"message":{"type":"string","maxLength":1000,"title":"Message","description":"Message to send.","examples":["Hello, how can I help you?"]}},"type":"object","required":["target","message"],"title":"SendWhatsAppMessageBody","example":{"message":"Hello, how can I help you?","target":["491701234567","4917611122233","4915112349876","492211234560"]}},"SendWhatsAppMessageResponse":{"properties":{"message_status":{"type":"string","title":"Message Status","description":"Result message.","examples":["sent"]},"history_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"History Id","description":"Identifier of the created/updated history entry.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]}},"type":"object","required":["message_status"],"title":"SendWhatsAppMessageResponse","example":{"history_id":"7442678451937742086","message_status":"sent"}},"SourceBody":{"properties":{"integration_identity_id":{"type":"integer","title":"Integration Identity Id","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"filters":{"$ref":"#/components/schemas/MailboxFilters"},"cutoff":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cutoff"},"enabled":{"type":"boolean","title":"Enabled","default":false},"interval_seconds":{"type":"integer","maximum":86400.0,"minimum":60.0,"title":"Interval Seconds","default":300}},"additionalProperties":false,"type":"object","required":["integration_identity_id"],"title":"SourceBody","example":{"integration_identity_id":"7442550215703679004"}},"SourceListView":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/SourceView"},"type":"array","title":"Sources"}},"type":"object","title":"SourceListView","example":{"sources":[{"automation_id":"7442551216804781021","enabled":true,"failed_scans":0,"filters":{"mailbox":"inbox"},"interval_seconds":300,"mailbox_identity":{"mailbox_id":"verified-sub","namespace":"google.oidc-sub.v1"},"removed":false,"revision":1,"source_id":"7442678451937742086"}]}},"SourceView":{"properties":{"source_id":{"type":"string","title":"Source Id","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"automation_id":{"type":"string","title":"Automation Id","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"integration_identity_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Integration Identity Id"},"mailbox_identity":{"$ref":"#/components/schemas/MailboxIdentity","examples":[{"mailbox_id":"verified-sub","namespace":"google.oidc-sub.v1"}]},"filters":{"$ref":"#/components/schemas/MailboxFilters","examples":[{"mailbox":"inbox"}]},"cutoff":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cutoff"},"enabled":{"type":"boolean","title":"Enabled","examples":[true]},"removed":{"type":"boolean","title":"Removed","examples":[false]},"revision":{"type":"integer","title":"Revision","examples":[1]},"interval_seconds":{"type":"integer","title":"Interval Seconds","examples":[300]},"last_scan_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Scan At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"failed_scans":{"type":"integer","title":"Failed Scans","description":"Consecutive failed scans since the last scanned page.","examples":[0]}},"type":"object","required":["source_id","automation_id","mailbox_identity","filters","enabled","removed","revision","interval_seconds","failed_scans"],"title":"SourceView","example":{"automation_id":"7442551216804781021","enabled":true,"failed_scans":0,"filters":{"mailbox":"inbox"},"interval_seconds":300,"mailbox_identity":{"mailbox_id":"verified-sub","namespace":"google.oidc-sub.v1"},"removed":false,"revision":1,"source_id":"7442678451937742086"}},"StartMcpServerOAuthBody":{"properties":{"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","description":"OAuth scopes for this MCP resource server. When omitted, scopes advertised by the MCP server are used. These are independent from scopes granted to direct provider integrations.","examples":[["openid","email"]]},"completion_redirect_uri":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Completion Redirect Uri","description":"Allowed redirect URI to open after authorization completes. Omit to receive the callback result as JSON.","examples":["https://app.livoi.de/integrations/oauth/complete"]},"client_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Client Id","description":"Pre-registered OAuth client ID. Mutually exclusive with client_metadata_url. When both are omitted on an HTTPS deployment, LIVOI supplies its own Client ID Metadata Document URL and uses it when the authorization server advertises CIMD and either lists none or leaves token endpoint authentication methods unspecified; otherwise LIVOI falls back to dynamic client registration when available."},"client_secret":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Client Secret","description":"OAuth client secret. It is never returned by the API."},"token_endpoint_auth_method":{"anyOf":[{"$ref":"#/components/schemas/OAuth2ClientAuthMethod"},{"type":"null"}],"description":"Token endpoint authentication method. Defaults to client_secret_post when a secret is supplied."},"client_metadata_url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Client Metadata Url","description":"HTTPS Client ID Metadata Document URL. Mutually exclusive with client_id. When both are omitted on an HTTPS deployment, LIVOI supplies its own metadata document URL."}},"additionalProperties":false,"type":"object","title":"StartMcpServerOAuthBody","example":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete","scopes":["openid","email"]}},"StartMcpServerOAuthResponse":{"properties":{"integration_identity_id":{"type":"string","title":"Integration Identity Id","description":"Created or updated user integration identity ID.","examples":["7442550215703679873"]},"authorization_url":{"type":"string","minLength":1,"format":"uri","title":"Authorization Url","description":"URL the user must open to authorize access."},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"Expiration time of the authorization state."}},"type":"object","required":["integration_identity_id","authorization_url","expires_at"],"title":"StartMcpServerOAuthResponse","example":{"authorization_url":"<authorization_url>","expires_at":"<expires_at>","integration_identity_id":"<integration_identity_id>"}},"StartOAuth2AuthorizationBody":{"properties":{"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"Provider API scopes. Null uses the provider's default preset; an explicit list replaces that API preset."},"completion_redirect_uri":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Completion Redirect Uri","description":"Allowed redirect URI to open after authorization completes. Omit to receive the callback result as JSON.","examples":["https://app.livoi.de/integrations/oauth/complete"]}},"additionalProperties":false,"type":"object","title":"StartOAuth2AuthorizationBody","example":{"completion_redirect_uri":"https://app.livoi.de/integrations/oauth/complete"}},"StartOAuth2AuthorizationResponse":{"properties":{"integration_identity_id":{"type":"string","title":"Integration Identity Id","description":"Integration identity used to start authorization. This ID may be provisional when connecting an account that is already linked. Use the integration_identity_id returned by the callback JSON response or completion redirect after authorization completes.","examples":[7442550215703679004]},"authorization_url":{"type":"string","title":"Authorization Url","description":"Provider consent URL to open in a browser."},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"Expiration time of the authorization state."}},"type":"object","required":["integration_identity_id","authorization_url","expires_at"],"title":"StartOAuth2AuthorizationResponse","example":{"authorization_url":"<authorization_url>","expires_at":"<expires_at>","integration_identity_id":"7442550215703679004"}},"StorageObjectDeleteBody":{"properties":{"storage_object_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Storage Object Ids","description":"Storage object IDs to delete.","examples":[[7442550215703679004],[7442550215703679004,7442550215703679137]]}},"type":"object","required":["storage_object_ids"],"title":"StorageObjectDeleteBody","example":{"storage_object_ids":["7442550215703679004"]}},"StorageObjectDeleteResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Deletion result message.","examples":["2 storage objects deleted successfully."]}},"type":"object","required":["message"],"title":"StorageObjectDeleteResponse","example":{"message":"2 storage objects deleted successfully."}},"StorageObjectDownloadBody":{"properties":{"storage_object_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Storage Object Ids","description":"Storage object IDs to download.","examples":[[7442550215703679004],[7442550215703679004,7442550215703679137]]}},"type":"object","required":["storage_object_ids"],"title":"StorageObjectDownloadBody","example":{"storage_object_ids":["7442550215703679004"]}},"StorageObjectUploadBody":{"properties":{"files":{"items":{"$ref":"#/components/schemas/RequireAllowedStorageObjectUpload"},"type":"array","minItems":1,"title":"Files","description":"Files to upload.","examples":[["report.pdf","summary.txt"]]}},"type":"object","required":["files"],"title":"StorageObjectUploadBody","example":{"files":["report.pdf","summary.txt"]}},"StorageObjectUploadResponse":{"properties":{"uploaded_storage_objects":{"additionalProperties":{"type":"string","examples":["7442550215703679873"]},"type":"object","title":"Uploaded Storage Objects","description":"Mapping of uploaded file names to storage object IDs.","examples":[{"report.pdf":7442550215703679004,"summary.txt":7442550215703679137}]}},"type":"object","required":["uploaded_storage_objects"],"title":"StorageObjectUploadResponse","example":{"uploaded_storage_objects":{"report.pdf":"7442550215703679004","summary.txt":"7442550215703679137"}}},"SubjectKind":{"type":"string","enum":["user","group","role","api_key"],"title":"SubjectKind"},"SubmittedItem":{"properties":{"item_id":{"type":"string","title":"Item Id","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"status":{"$ref":"#/components/schemas/AutomationItemStatus","description":"Running means processing has started and is unsettled, including time waiting for a retry. Cancelled revokes future work without selecting an execution result. It does not confirm process exit.","examples":["pending","cancelled"]}},"type":"object","required":["item_id","status"],"title":"SubmittedItem","example":{"item_id":"7442678451937742086","status":"pending"}},"SyncChange":{"properties":{"event_id":{"type":"string","title":"Event Id","examples":["7442550215703679873"]},"event":{"type":"string","title":"Event"},"resource_kind":{"type":"string","title":"Resource Kind"},"resource_id":{"type":"string","title":"Resource Id","examples":["7442550215703679873"]},"resource_version":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Resource Version"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"occurred_at":{"type":"string","title":"Occurred At"}},"additionalProperties":false,"type":"object","required":["event_id","event","resource_kind","resource_id","data","occurred_at"],"title":"SyncChange"},"SyncWhatsAppBusinessProfilesBody":{"properties":{"whatsapp_business_phone_number_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"uniqueItems":true,"title":"Whatsapp Business Phone Number Ids","description":"Identifiers of the WhatsApp business phone numbers to sync.","examples":[[7442550215703679004,7442550215703679137]]}},"type":"object","required":["whatsapp_business_phone_number_ids"],"title":"SyncWhatsAppBusinessProfilesBody","example":{"whatsapp_business_phone_number_ids":["7442550215703679137","7442550215703679004"]}},"SyncWhatsAppBusinessProfilesResponse":{"properties":{"success":{"items":{"$ref":"#/components/schemas/WhatsAppBusinessProfileSyncItem"},"type":"array","title":"Success","description":"Sync results for all requested phone numbers."},"failed":{"items":{"type":"string"},"type":"array","title":"Failed","description":"List of failed phone numbers.","examples":[]},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional overall sync summary.","examples":["1 synced, 0 failed."]}},"type":"object","required":["success","failed"],"title":"SyncWhatsAppBusinessProfilesResponse","example":{"failed":["<failed>"],"message":"1 synced, 0 failed.","success":[{"message":"No profile changes detected; local data is already in sync with Meta.","updated_fields":["status","whatsapp_about","whatsapp_email"],"whatsapp_business_phone_number_id":"7442550215703679004","whatsapp_business_profile_id":"7442551216804781021"}]}},"SyncWhatsAppTemplatesResponse":{"properties":{"whatsapp_business_profile_id":{"type":"string","title":"Whatsapp Business Profile Id","description":"WhatsApp business profile ID.","examples":[7442551216804781021]},"meta_count":{"type":"integer","title":"Meta Count","description":"Number of templates returned by Meta.","default":0,"examples":[12]},"created_count":{"type":"integer","title":"Created Count","description":"Number of local templates created.","default":0,"examples":[2]},"deleted_count":{"type":"integer","title":"Deleted Count","description":"Number of local templates deleted.","default":0,"examples":[1]},"updated_count":{"type":"integer","title":"Updated Count","description":"Number of local templates updated.","default":0,"examples":[9]}},"type":"object","required":["whatsapp_business_profile_id"],"title":"SyncWhatsAppTemplatesResponse","example":{"created_count":2,"deleted_count":1,"meta_count":12,"updated_count":9,"whatsapp_business_profile_id":"7442551216804781021"}},"TemplateCategory":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY","UNKNOWN"],"title":"TemplateCategory","description":"Template category.\n\n`'Template Categorization' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines#template-categorization>`_\n\nAttributes:\n    AUTHENTICATION: Enable businesses to verify a user’s identity, potentially at various steps of the customer journey. See `Authentication templates <https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates>`_ for more details.\n    MARKETING: Enable businesses to achieve a wide range of goals, from generating awareness to driving sales and retargeting customers. See `Marketing templates <https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/marketing-templates>`_ for more details.\n    UTILITY: Enable businesses to follow up on user actions or requests, since these messages are typically triggered by user actions. See `Utility templates <https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/utility-templates>`_ for more details."},"TemplateLanguage":{"type":"string","enum":["None","af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","ar_SA","az","bn","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","en","en_GB","en_US","en_AU","en_CA","en_IN","et","fil","fi","fr","fr_CA","fr_BE","ka","de","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","sk","sl","es","es_AR","es_ES","es_MX","es_CL","es_CO","es_PE","es_VE","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu","UNKNOWN"],"title":"TemplateLanguage","description":"Template language and locale code.\n\n`'Template language and locale code' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages>`_"},"TemplateRecipientResult":{"properties":{"recipient":{"type":"string","title":"Recipient","examples":["+491701234567","+4917611122233"]},"outcome":{"type":"string","enum":["accepted","rejected","uncertain","unattempted"],"title":"Outcome","examples":["accepted","rejected"]},"provider_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Message Id"},"user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"User Id"},"chat_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Chat Id"},"history_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"History Id"},"delivery_status":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppDeliveryStatus"},{"type":"null"}]},"provider_error":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"title":"Provider Error"},"persistence_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persistence Error"}},"type":"object","required":["recipient","outcome"],"title":"TemplateRecipientResult","example":{"outcome":"accepted","recipient":"+491701234567"}},"TemplateSendCarouselCard":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index","description":"Zero-based carousel card index.","examples":[0,1]},"params":{"items":{"oneOf":[{"$ref":"#/components/schemas/BodyTextParam"},{"$ref":"#/components/schemas/HeaderTextParam"},{"$ref":"#/components/schemas/AuthenticationBodyParam"},{"$ref":"#/components/schemas/HeaderImageParam"},{"$ref":"#/components/schemas/HeaderVideoParam"},{"$ref":"#/components/schemas/HeaderGIFParam"},{"$ref":"#/components/schemas/HeaderDocumentParam"},{"$ref":"#/components/schemas/HeaderLocationParam"},{"$ref":"#/components/schemas/HeaderProductParam"},{"$ref":"#/components/schemas/QuickReplyParam"},{"$ref":"#/components/schemas/URLParam"},{"$ref":"#/components/schemas/CopyCodeParam"},{"$ref":"#/components/schemas/FlowParam"},{"$ref":"#/components/schemas/CatalogParam"},{"$ref":"#/components/schemas/MPMParam"},{"$ref":"#/components/schemas/OTPParam"},{"$ref":"#/components/schemas/OneTapOTPParam"},{"$ref":"#/components/schemas/ZeroTapOTPParam"},{"$ref":"#/components/schemas/CopyCodeOTPParam"},{"$ref":"#/components/schemas/LimitedTimeOfferParam"},{"$ref":"#/components/schemas/CarouselParam"}],"discriminator":{"propertyName":"type","mapping":{"AUTHENTICATION_BODY":"#/components/schemas/AuthenticationBodyParam","BODY_TEXT":"#/components/schemas/BodyTextParam","CAROUSEL":"#/components/schemas/CarouselParam","CATALOG":"#/components/schemas/CatalogParam","COPY_CODE":"#/components/schemas/CopyCodeParam","COPY_CODE_OTP":"#/components/schemas/CopyCodeOTPParam","FLOW":"#/components/schemas/FlowParam","HEADER_DOCUMENT":"#/components/schemas/HeaderDocumentParam","HEADER_GIF":"#/components/schemas/HeaderGIFParam","HEADER_IMAGE":"#/components/schemas/HeaderImageParam","HEADER_LOCATION":"#/components/schemas/HeaderLocationParam","HEADER_PRODUCT":"#/components/schemas/HeaderProductParam","HEADER_TEXT":"#/components/schemas/HeaderTextParam","HEADER_VIDEO":"#/components/schemas/HeaderVideoParam","LIMITED_TIME_OFFER":"#/components/schemas/LimitedTimeOfferParam","MPM":"#/components/schemas/MPMParam","ONE_TAP_OTP":"#/components/schemas/OneTapOTPParam","OTP":"#/components/schemas/OTPParam","QUICK_REPLY":"#/components/schemas/QuickReplyParam","URL":"#/components/schemas/URLParam","ZERO_TAP_OTP":"#/components/schemas/ZeroTapOTPParam"}}},"type":"array","minItems":1,"title":"Params","description":"Runtime params for the carousel card components.","examples":[[{"type":"HEADER_TEXT","values":["Offer 1"]},{"type":"BODY_TEXT","values":["Max","20% discount"]}],[{"type":"HEADER_TEXT","values":["Offer 2"]},{"index":0,"type":"URL","url_variable":"product/sku-2001"}]]}},"additionalProperties":false,"type":"object","required":["index","params"],"title":"TemplateSendCarouselCard","example":{"index":0,"params":[{"type":"HEADER_TEXT","values":["Offer 1"]},{"type":"BODY_TEXT","values":["Max","20% discount"]}]}},"TemplateSendProductSection":{"properties":{"title":{"type":"string","minLength":1,"title":"Title","description":"Title of the MPM product section.","examples":["Recommended products","Top sellers"]},"skus":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Skus","description":"Product retailer IDs for the MPM section.","examples":[["SKU-1001","SKU-1002"],["SKU-2001"]]}},"additionalProperties":false,"type":"object","required":["title","skus"],"title":"TemplateSendProductSection","example":{"skus":["SKU-1001","SKU-1002"],"title":"Recommended products"}},"TemplateStatus":{"type":"string","enum":["APPROVED","DISABLED","IN_APPEAL","PENDING","REINSTATED","REJECTED","DELETED","PENDING_DELETION","FLAGGED","PAUSED","LIMIT_EXCEEDED","ARCHIVED","UNARCHIVED","LOCKED","UNKNOWN"],"title":"TemplateStatus","description":"The status of the template.\n\n`'Template status' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates#template-status>`_\n\nAttributes:\n    APPROVED: Indicates the template has been approved and can now be sent in template messages.\n    DISABLED: Indicates the template has been disabled due to `user feedback <https://developers.facebook.com/docs/whatsapp/message-templates/guidelines/#quality-rating>`_.\n    DELETED: Indicates the template has been deleted.\n    IN_APPEAL: Indicates the template is in the `appeal <https://developers.facebook.com/docs/whatsapp/message-templates/guidelines/#appeals>`_ process.\n    PENDING: Indicates the template is undergoing template review.\n    REINSTATED: Indicates the template is no longer flagged or disabled and can be sent in template messages again.\n    REJECTED: Indicates the template has been rejected. You can :meth:`~pywa.types.templates.Template.update` the template to have it undergo template review again or `appeal <https://developers.facebook.com/docs/whatsapp/message-templates/guidelines/#appeals>`_ the rejection.\n    PENDING_DELETION: Indicates template has been deleted via WhatsApp Manager.\n    FLAGGED: Indicates the template has received negative feedback and is at risk of being disabled.\n    PAUSED: Indicates the template has been `paused <https://developers.facebook.com/docs/whatsapp/message-templates/guidelines/#template-pausing>`_.\n    ARCHIVED: Indicates the template has been `archived <https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-archival>`_ due to inactivity. Archived templates are scheduled for deletion after 28 days unless unarchived.\n    UNARCHIVED: Indicates the template has been `unarchived <https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-archival>`_ and restored to its previous status.\n    LIMIT_EXCEEDED: Indicates the WhatsApp Business Account template is at its template limit.\n    LOCKED: Indicates the template has been locked and cannot be edited.\n    UNKNOWN: The status of the template is unknown."},"TokenUsage":{"properties":{"response_tokens":{"type":"string","title":"Response Tokens","description":"Total number of response tokens","examples":["12000"]},"request_tokens":{"type":"string","title":"Request Tokens","description":"Total number of request tokens","examples":["8000"]}},"type":"object","required":["response_tokens","request_tokens"],"title":"TokenUsage","example":{"request_tokens":"8000","response_tokens":"12000"}},"ToolEvidence":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"arguments":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Arguments"},"result":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Result"}},"type":"object","required":["tool_name","arguments","result"],"title":"ToolEvidence"},"TranscribeAudioBody":{"properties":{"audio":{"items":{"$ref":"#/components/schemas/TranscriptionAudioUpload"},"type":"array","maxItems":1,"minItems":1,"title":"Audio","description":"One completed audio recording, at most 25 MB.","examples":[["recording.webm"]]}},"additionalProperties":false,"type":"object","required":["audio"],"title":"TranscribeAudioBody","example":{"audio":["recording.webm"]}},"TranscriptionAudioUpload":{"type":"string","format":"binary"},"URLParam":{"properties":{"type":{"type":"string","const":"URL","title":"Type","description":"Runtime URL button parameter type.","examples":["URL"]},"index":{"type":"integer","minimum":0.0,"title":"Index","description":"Zero-based button index.","examples":[0,1,2]},"url_variable":{"type":"string","minLength":1,"title":"Url Variable","description":"URL suffix variable for URL buttons.","examples":["appointment/123","products/sku-2001"]}},"additionalProperties":false,"type":"object","required":["type","index","url_variable"],"title":"URLParam"},"UnassignAgentFilesBody":{"properties":{"agent_file_unassign":{"items":{"$ref":"#/components/schemas/AgentFileBase"},"type":"array","title":"Agent File Unassign","description":"Agent-file assignments to remove."}},"type":"object","required":["agent_file_unassign"],"title":"UnassignAgentFilesBody","example":{"agent_file_unassign":["<agent_file_unassign>"]}},"UnassignAgentFilesResponse":{"properties":{"unassigned":{"additionalProperties":{"items":{"type":"string","examples":["7442550215703679873"]},"type":"array"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object","title":"Unassigned","description":"Mapping of agent IDs to file IDs unassigned successfully.","examples":[{"7442550215703679004":[7442551216804781021]}]},"failed":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Failed","description":"Unassignment failures keyed by input identifier.","examples":[{"7442551216804781198":"File was not assigned to the agent."}]}},"type":"object","required":["unassigned"],"title":"UnassignAgentFilesResponse","example":{"failed":{"7442551216804781198":"File was not assigned to the agent."},"unassigned":{"7442550215703679004":["7442551216804781021"]}}},"UpdateAgentBody":{"properties":{"default_file_title_tags":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default File Title Tags","description":"Whether uploaded files should default to title tag extraction.","examples":[true,false,null]},"default_chat_summary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Chat Summary","description":"Whether chats should default to summary generation.","examples":[true,false,null]},"default_chat_title":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Chat Title","description":"Whether chats should default to generated titles.","examples":[true,false,null]},"default_transcribe":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Transcribe","description":"Whether uploaded audio should default to transcription.","examples":[true,false,null]},"default_embedding":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Default Embedding","description":"Whether uploaded content should default to embedding generation.","examples":[true,false,null]},"output_schema":{"type":"string","contentMediaType":"application/json","contentSchema":{"anyOf":[{"$ref":"#/components/schemas/ChatOutputSchema-Input"},{"type":"null"}]},"title":"Output Schema","description":"Output field definitions as JSON text. Omit to preserve; send null to restore text answers.","examples":["{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}","null"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated agent display name.","examples":["Invoice Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Updated short description of what the agent helps with.","examples":["Prepares invoice drafts and answers DATEV workflow questions."]},"llm_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Api Key","description":"Updated OpenAI API key used by the agent.","examples":["sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","sk_prod_7443128874215608479_pIZrSYz:yyyyyyyyy","sk_wb_7443128874215608651_ySpzIRZ:zzzzzzzzz","sk_test_7443128874215608790_RiZsYPz:aaaaaaaaa"]},"llm_custom_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Custom Url","description":"Updated OpenAI-compatible base URL.","examples":["https://api.openai.com/v1"]},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Updated model name.","examples":["gpt-6-luna"]},"agent_image":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Agent Image","description":"Updated uploaded profile image for the agent.","examples":["agent-profile-updated.png",null]},"agent_image_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Image Id","description":"Updated existing agent image ID to reuse.","examples":[null,7443001845129083597]},"datev_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Datev Profile Id","description":"Updated DATEV profile ID assignment.","examples":[7442678451937742214]}},"additionalProperties":false,"type":"object","title":"UpdateAgentBody","example":{"agent_image":"agent-profile-updated.png","datev_profile_id":"7442678451937742214","default_chat_summary":true,"default_chat_title":true,"default_embedding":true,"default_file_title_tags":true,"default_transcribe":true,"description":"Prepares invoice drafts and answers DATEV workflow questions.","llm_api_key":"sk_dev_7443128874215608324_ZrSyPiz:xxxxxxxxx","llm_custom_url":"https://api.openai.com/v1","model":"gpt-6-luna","name":"Invoice Assistant","output_schema":"{\"fields\":[{\"name\":\"score\",\"type\":\"integer\",\"required\":true}]}"}},"UpdateAgentInstructionBody":{"properties":{"instruction":{"type":"string","title":"Instruction","description":"System instruction text used by the agent.","examples":["Answer in German, stay concise, and ask for missing invoice details before creating a draft."]}},"type":"object","required":["instruction"],"title":"UpdateAgentInstructionBody","example":{"instruction":"Answer in German, stay concise, and ask for missing invoice details before creating a draft."}},"UpdateAgentInstructionResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Instruction update status message.","examples":["Agent instruction updated successfully."]}},"type":"object","required":["message"],"title":"UpdateAgentInstructionResponse","example":{"message":"Agent instruction updated successfully."}},"UpdateAgentMcpClientBody":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Name"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"UpdateAgentMcpClientBody"},"UpdateAgentModelSettingsBody":{"properties":{"model_settings":{"anyOf":[{"$ref":"#/components/schemas/JsonObject"},{"type":"null"}],"description":"Model settings for the agent. Use null to clear all model settings. extra_body, openai_background, openai_conversation_id and openai_previous_response_id are rejected. Chat agent runs always send store=false to OpenAI, even if openai_store is true.","examples":[{"openai_reasoning_effort":"low","openai_text_verbosity":"low"},null]}},"additionalProperties":false,"type":"object","required":["model_settings"],"title":"UpdateAgentModelSettingsBody","example":{"model_settings":{"openai_reasoning_effort":"low","openai_text_verbosity":"low"}}},"UpdateAgentResponse":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__core_models__FieldChange"},{"type":"null"}],"description":"Applied name change."},"description":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__core_models__FieldChange"},{"type":"null"}],"description":"Applied description change."},"llm_api_key":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__core_models__FieldChange"},{"type":"null"}],"description":"Present when the API key changed. Key values are never returned."},"llm_custom_url":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__core_models__FieldChange"},{"type":"null"}],"description":"Applied custom URL change."},"datev_profile_id":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__core_models__FieldChange"},{"type":"null"}],"description":"Applied DATEV profile assignment change."},"agent_image_id":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__core_models__FieldChange"},{"type":"null"}],"description":"Applied agent image assignment change."},"agent_spec":{"anyOf":[{"$ref":"#/components/schemas/AgentSpec"},{"type":"null"}],"description":"Updated native agent specification."}},"type":"object","title":"UpdateAgentResponse"},"UpdateAgentToolMetaBody":{"properties":{"meta":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Meta","description":"Metadata to store for the agent tool.","examples":[{"history_visibility":{"model_visible":true,"user_visible":true}}]},"tool_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Description","description":"Agent-specific description used when exposing the tool to the model. Set to a non-empty string to replace the current description; set to null or an empty string to restore the built-in default; omit to leave the description unchanged.","examples":["Creates an e-invoice XML draft from the invoice data collected in this chat.","",null]}},"type":"object","title":"UpdateAgentToolMetaBody","example":{"meta":{"history_visibility":{"model_visible":true,"user_visible":true}},"tool_description":"Creates an e-invoice XML draft from the invoice data collected in this chat."}},"UpdateAgentToolMetaResponse":{"properties":{"agent_tool_id":{"type":"string","title":"Agent Tool Id","description":"Updated agent tool ID.","examples":[7442551216804781021]},"meta":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Meta","description":"Updated metadata stored for the agent tool.","examples":[{"history_visibility":{"model_visible":true,"user_visible":true}}]},"tool_description":{"type":"string","minLength":1,"title":"Tool Description","description":"Updated tool description.","examples":["Creates an e-invoice XML draft."]}},"type":"object","required":["agent_tool_id","meta","tool_description"],"title":"UpdateAgentToolMetaResponse","example":{"agent_tool_id":"7442551216804781021","meta":{"history_visibility":{"model_visible":true,"user_visible":true}},"tool_description":"Creates an e-invoice XML draft."}},"UpdateCalendarAssignmentsBody":{"properties":{"assigns":{"anyOf":[{"items":{"$ref":"#/components/schemas/CalendarAssignRequestBase"},"type":"array"},{"type":"null"}],"title":"Assigns","description":"Mappings that assign calendars to agents."},"unassigns":{"anyOf":[{"items":{"$ref":"#/components/schemas/CalendarAssignRequestBase"},"type":"array"},{"type":"null"}],"title":"Unassigns","description":"Mappings that unassign calendars from agents."}},"type":"object","title":"UpdateCalendarAssignmentsBody","example":{"assigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}],"unassigns":[{"agent_id":"7442551216804781021","calendar_ids":["7442550215703679004","7442550215703679137","7442550215703679284","7442550215703679412"],"calendar_names":["Team","Dev","External"]}]}},"UpdateCalendarAssignmentsResponse":{"properties":{"assigns":{"anyOf":[{"items":{"$ref":"#/components/schemas/CalendarAssignResponseBase"},"type":"array"},{"type":"null"}],"title":"Assigns","description":"Mapping of agents and their assigned calendars or assignment error messages."},"unassigns":{"anyOf":[{"items":{"$ref":"#/components/schemas/CalendarAssignResponseBase"},"type":"array"},{"type":"null"}],"title":"Unassigns","description":"Mapping of agents and their unassigned calendars or unassignment error messages."}},"type":"object","title":"UpdateCalendarAssignmentsResponse","example":{"assigns":[{"agent_id":"7442550215703679004","calendar_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"error":"Agent not found: [744128060820239091]"}],"unassigns":[{"agent_id":"7442550215703679004","calendar_ids":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"error":"Agent not found: [744128060820239091]"}]}},"UpdateCalendarBody":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":20,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated name of the calendar.","examples":["Team","Dev"]},"tags":{"anyOf":[{"items":{"type":"string","minLength":1},"type":"array"},{"type":"null"}],"title":"Tags","description":"Updated tags associated with the calendar.","examples":[["meeting","internal"],["meeting","internal","dev"],["meeting","internal","planning"]]},"description":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Description","description":"Updated description of the calendar.","examples":["Updated description for team meetings","Internal calendar for Dev meetings"]},"link":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Link","description":"Updated URL link related to the calendar.","examples":["https://calendar.example.com/team","https://calendar.example.com/dev"]}},"type":"object","title":"UpdateCalendarBody","example":{"description":"Updated description for team meetings","link":"https://calendar.example.com/team","name":"Team","tags":["meeting","internal"]}},"UpdateCalendarResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Summary message.","examples":["Successfully updated calendar 7442550215703679004"]},"calendar_id":{"type":"string","title":"Calendar Id","description":"ID of the updated calendar.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]}},"type":"object","required":["message","calendar_id"],"title":"UpdateCalendarResponse","example":{"calendar_id":"7442550215703679004","message":"Successfully updated calendar 7442550215703679004"}},"UpdateCustomToolForAgentBody":{"properties":{"tool_name":{"type":"string","maxLength":128,"minLength":1,"title":"Tool Name","description":"Tool name.","examples":["lookup_customer"]},"tool_description":{"type":"string","minLength":1,"title":"Tool Description","description":"Tool description shown to the agent.","examples":["Looks up a customer record by customer ID."]},"request_config":{"$ref":"#/components/schemas/CustomToolRequestConfig","description":"HTTP request configuration for the custom tool."},"response_config":{"anyOf":[{"$ref":"#/components/schemas/CustomToolResponseConfig"},{"type":"null"}],"description":"Optional upstream response validation. On update or a saved-tool preview/test, omit to keep the stored configuration, send null to remove it, or supply an object to replace it."},"max_retries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Retries","description":"Max retries.","examples":[1]},"read_only":{"type":"boolean","title":"Read Only","description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","default":false},"defer_loading":{"type":"boolean","title":"Defer Loading","description":"Discover this tool through search before making it available to the agent. Omit on update to preserve the current setting.","default":false,"examples":[true]},"input_schema":{"$ref":"#/components/schemas/CustomToolInputSchema-Input","description":"Input schema for custom tool parameters."},"api_key":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Api Key","description":"Optional API key used when calling the custom tool.","examples":["sk_tool_live_123456"]}},"type":"object","required":["tool_name","tool_description","request_config"],"title":"UpdateCustomToolForAgentBody","example":{"api_key":"sk_tool_live_123456","defer_loading":true,"max_retries":1,"request_config":"<request_config>","tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"}},"UpdateCustomToolForAgentResponse":{"properties":{"agent_tool_id":{"type":"string","title":"Agent Tool Id","description":"Custom agent tool ID.","examples":[7442551216804781344]},"tool_name":{"type":"string","title":"Tool Name","description":"Custom tool name.","examples":["lookup_customer"]},"tool_description":{"type":"string","title":"Tool Description","description":"Custom tool description.","examples":["Looks up a customer record by customer ID."]},"api_url":{"type":"string","title":"Api Url","description":"Custom tool API URL.","examples":["https://api.example.com/customers/{customer_id}"]},"http_method":{"type":"string","title":"Http Method","description":"HTTP method used by the custom tool.","examples":["GET"]},"max_retries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Retries","description":"Maximum retry attempts for the custom tool request.","examples":[2]},"read_only":{"type":"boolean","title":"Read Only","description":"Explicitly permits background lookup use, independent of HTTP method. Omit on update to preserve.","default":false},"defer_loading":{"type":"boolean","title":"Defer Loading","description":"Whether the agent discovers this tool through search.","default":false,"examples":[true]},"has_api_key":{"type":"boolean","title":"Has Api Key","description":"Whether the custom tool has a stored API key.","examples":[true]},"input_parameters":{"items":{"type":"string"},"type":"array","title":"Input Parameters","description":"Input parameter names exposed by the custom tool.","examples":[["customer_id"]]}},"type":"object","required":["agent_tool_id","tool_name","tool_description","api_url","http_method","has_api_key","input_parameters"],"title":"UpdateCustomToolForAgentResponse","example":{"agent_tool_id":"7442551216804781344","api_url":"https://api.example.com/customers/{customer_id}","defer_loading":true,"has_api_key":true,"http_method":"GET","input_parameters":["customer_id"],"max_retries":2,"tool_description":"Looks up a customer record by customer ID.","tool_name":"lookup_customer"}},"UpdateDatevProfileInvoiceDefaultsBody":{"properties":{"defaults":{"anyOf":[{"$ref":"#/components/schemas/DatevInvoiceDefaultsPatch"},{"type":"null"}],"description":"Merge-patch payload for DATEV invoice defaults. `null` removes keys; empty nested objects are pruned."},"invoice_number_format":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Invoice Number Format","description":"Invoice number format (max 64 chars) with placeholders: {yy} or {yyyy} and exactly one {nr} or {nr:<number>} (where <number> can be between 1 and 16). {nr} defaults to width 4."},"invoice_number_counter":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Invoice Number Counter","description":"Optional manual override of next invoice number counter (>= 1)."},"replace":{"type":"boolean","title":"Replace","description":"If true, replace all current defaults with the provided defaults object. If false, apply merge-patch semantics from `defaults`.","default":false}},"type":"object","title":"UpdateDatevProfileInvoiceDefaultsBody","example":{"defaults":{"seller":{"address":{},"contact":{},"endpoint":{}}}}},"UpdateDatevProfileInvoiceDefaultsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Success message.","examples":["DATEV invoice defaults updated successfully."]},"id":{"type":"string","title":"Id","description":"DATEV profile ID.","examples":[7442550215703679004]},"invoice_defaults":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Invoice Defaults","description":"Updated DATEV invoice defaults (`null` = never configured, `{}` = explicitly empty).","examples":[{"currency_code":"EUR","due_days":14,"payee_iban":"DE02120300000000202051","payment_means_code":"58","seller":{"contact":{"email":"billing@livoi.de"},"name":"LIVOI GmbH"}}]},"invoice_number_format":{"type":"string","title":"Invoice Number Format","description":"Active invoice number format.","examples":["RE-{yyyy}-{nr:4}"]},"invoice_number_counter":{"type":"integer","title":"Invoice Number Counter","description":"Next invoice number counter.","examples":[1]},"invoice_number_counter_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Invoice Number Counter Year","description":"Year currently associated with counter for year-based formats.","examples":[2026]}},"type":"object","required":["message","id","invoice_defaults","invoice_number_format","invoice_number_counter"],"title":"UpdateDatevProfileInvoiceDefaultsResponse","example":{"id":"7442550215703679004","invoice_defaults":{"currency_code":"EUR","due_days":14,"payee_iban":"DE02120300000000202051","payment_means_code":"58","seller":{"contact":{"email":"billing@livoi.de"},"name":"LIVOI GmbH"}},"invoice_number_counter":1,"invoice_number_counter_year":2026,"invoice_number_format":"RE-{yyyy}-{nr:4}","message":"DATEV invoice defaults updated successfully."}},"UpdateEmailOfficeIntegrationBody":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","examples":[true,false]},"include_filters":{"anyOf":[{"items":{"$ref":"#/components/schemas/EmailOfficeMessageFilter"},"type":"array","maxItems":100},{"type":"null"}],"title":"Include Filters","examples":[[{"sender_email":"sprizzy@p-cation.de"}],[{"label_name":"Invoices"}],[{"label_id":"Label_123"}]]},"exclude_filters":{"anyOf":[{"items":{"$ref":"#/components/schemas/EmailOfficeMessageFilter"},"type":"array","maxItems":100},{"type":"null"}],"title":"Exclude Filters","examples":[[{"sender_name":"Automated Notifications"}],[{"label_name":"Spam"}],[{"label_id":"CATEGORY_ID"}]]},"run_interval":{"anyOf":[{"type":"integer","maximum":2147483647.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Run Interval","examples":[30,30,2,1]},"run_interval_unit":{"anyOf":[{"$ref":"#/components/schemas/EmailOfficeRunIntervalUnit"},{"type":"null"}],"examples":["seconds","minutes","hours","days"]}},"additionalProperties":false,"type":"object","title":"UpdateEmailOfficeIntegrationBody","example":{"enabled":true,"exclude_filters":[{"sender_name":"Automated Notifications"}],"include_filters":[{"sender_email":"sprizzy@p-cation.de"}],"run_interval":30,"run_interval_unit":"seconds"}},"UpdateFolderBody":{"properties":{"name":{"type":"string","maxLength":40,"minLength":1,"title":"Name","description":"Updated display name of the folder.","examples":["Sales_Outdated","Marketing_Archive","Support_Legacy"]}},"type":"object","required":["name"],"title":"UpdateFolderBody","example":{"name":"Sales_Outdated"}},"UpdateFolderResponse":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/api__models__v1__agent__library_models__FieldChange"},{"type":"null"}],"description":"Change details for the folder name."}},"type":"object","title":"UpdateFolderResponse","example":{"name":{"new":"Sales_Outdated","previous":"Sales"}}},"UpdateGroupBody":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional group description.","examples":["Extended support staff group."]}},"type":"object","title":"UpdateGroupBody","example":{"description":"Extended support staff group.","name":"Support Team"}},"UpdateGroupResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Group ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"name":{"type":"string","title":"Name","description":"Group name.","examples":["Support Team","P-CATION Admins","Sprizzy Operators","Musterassistent Crew"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Group description.","examples":["Support staff group."]}},"type":"object","required":["id","tenant_id","name"],"title":"UpdateGroupResponse","example":{"description":"Support staff group.","id":"7442550215703679004","name":"Support Team","tenant_id":"7442551216804781021"}},"UpdateMcpServerBody":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Url","description":"New URL. Catalog servers keep the catalog URL."},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers","description":"Replacement headers. Null or an empty object clears stored headers. Omission retains them unless the auth mode leaves registration, which clears them. Moving a server that has stored headers to another origin while it stays registration needs its headers sent again or cleared."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"auth_mode":{"anyOf":[{"$ref":"#/components/schemas/McpAuthMode"},{"type":"null"}]},"include_instructions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Instructions"},"include_return_schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Return Schema"},"max_retries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Retries"},"tool_error_behavior":{"anyOf":[{"$ref":"#/components/schemas/McpToolErrorBehavior"},{"type":"null"}]},"init_timeout":{"anyOf":[{"type":"number","maximum":120.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Init Timeout"},"read_timeout":{"anyOf":[{"type":"number","maximum":3600.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Read Timeout"},"tool_policies":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/McpToolPolicy"},{"type":"null"}]},"propertyNames":{"$ref":"#/components/schemas/McpToolName"},"type":"object"},{"type":"null"}],"title":"Tool Policies","description":"Tool policy overrides to change. Each listed tool gets the given policy; null removes its override. Unlisted tools keep theirs.","examples":[{"delete_page":"block","search":null}]}},"additionalProperties":false,"type":"object","title":"UpdateMcpServerBody","example":{"tool_policies":{"delete_page":"block","search":null}}},"UpdatePhoneNumberPinBody":{"properties":{"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin","description":"Pin used for registration","examples":["654321"]}},"type":"object","title":"UpdatePhoneNumberPinBody","example":{"pin":"654321"}},"UpdatePhoneNumberPinResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Success message","examples":["PIN for phone 7234230123774234 updated successfully."]},"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin","description":"Pin used for registration","examples":["654321"]}},"type":"object","required":["message"],"title":"UpdatePhoneNumberPinResponse","example":{"message":"PIN for phone 7234230123774234 updated successfully.","pin":"654321"}},"UpdatePromptsBody":{"properties":{"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name","description":"Updated display name of the prompt entry. Value is trimmed; null/blank values are rejected when this field is provided.","examples":["Meeting follow-up v2","Customer onboarding draft","Incident summary final"]},"content":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Content","description":"Updated prompt content. Value is trimmed; null/blank values are rejected when this field is provided. If content and/or variable_json are updated, placeholders and variable keys must match exactly.","examples":["Write a follow-up email for {customer_name} about {topic}.","Draft an onboarding note for {customer_name} introducing {product_area}.","Summarize the incident for {customer_name} with impact {impact_level} and next steps."]},"variable_json":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/VariableDefinition"},"type":"object"},{"type":"null"}],"title":"Variable Json","description":"Updated variable definitions mapped to prompt placeholders. Each variable may include description, required, and default. You may update this field with or without content, but placeholders and variable keys must always match exactly.","examples":[{"customer_name":{"default":null,"description":"Name of the customer.","required":true},"topic":{"default":null,"description":"Main topic to address.","required":true}}]}},"type":"object","title":"UpdatePromptsBody","example":{"content":"Write a follow-up email for {customer_name} about {topic}.","name":"Meeting follow-up v2","variable_json":{"customer_name":{"default":null,"description":"Name of the customer.","required":true},"topic":{"default":null,"description":"Main topic to address.","required":true}}}},"UpdatePromptsResponse":{"properties":{"prompt_id":{"type":"string","title":"Prompt Id","description":"Identifier of the updated prompt entry.","examples":[744128060820239091,7442550215703679004,7442678451937742086]}},"type":"object","required":["prompt_id"],"title":"UpdatePromptsResponse","example":{"prompt_id":"744128060820239091"}},"UpdateRoleBody":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional role description.","examples":["Extended support permissions.","Updated operational scope.","Can manage additional tenant resources."]}},"type":"object","title":"UpdateRoleBody","example":{"description":"Extended support permissions.","name":"Administrator"}},"UpdateRoleResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Role ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Role name.","examples":["Administrator","Manager","Operator","Assistant"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Role description.","examples":["Can manage tenant resources.","Supervises support operations.","Handles day-to-day platform tasks.","Can read and write files."]}},"type":"object","required":["id","tenant_id","name"],"title":"UpdateRoleResponse","example":{"description":"Can manage tenant resources.","id":"7443001845129083411","name":"Administrator","tenant_id":"7442550215703679004"}},"UpdateTenantBody":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"]},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","title":"UpdateTenantBody","example":{"domain":"sprizzy.de","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"}},"UpdateTenantMembershipBody":{"properties":{"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Whether the membership is active.","examples":[true,false]}},"type":"object","title":"UpdateTenantMembershipBody","example":{"is_active":true}},"UpdateTenantMembershipResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Membership ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the membership is active.","examples":[true,false]},"joined_at":{"type":"string","format":"date-time","title":"Joined At","description":"Joined timestamp.","examples":["2027-02-10T11:22:33Z","2028-06-18T04:45:12Z","2029-09-29T19:08:54Z","2030-03-07T15:37:21Z"]},"left_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Left At","description":"Left timestamp.","examples":["2027-12-01T07:55:09Z","2028-08-14T13:20:48Z","2029-05-22T21:44:30Z","2030-10-30T02:11:16Z"]}},"type":"object","required":["id","tenant_id","user_id","is_active","joined_at"],"title":"UpdateTenantMembershipResponse","example":{"id":"7442678451937742086","is_active":true,"joined_at":"2027-02-10T11:22:33Z","left_at":"2027-12-01T07:55:09Z","tenant_id":"7442550215703679004","user_id":"7442551216804781021"}},"UpdateTenantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"name":{"type":"string","title":"Name","description":"Tenant name.","examples":["Sprizzy GmbH","P-CATION GmbH","P-CATION Services GmbH","Musterfirma Sprizzy"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Tenant domain.","examples":["sprizzy.de","p-cation.de","api.p-cation.de","sandbox.p-cation.de"]},"owner_user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]}},"type":"object","required":["id","name"],"title":"UpdateTenantResponse","example":{"domain":"sprizzy.de","id":"7442550215703679004","name":"Sprizzy GmbH","owner_user_id":"7442551216804781021"}},"UpdateTenantUserProfileBody":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name in this tenant.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name in this tenant.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name in this tenant.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact email address in this tenant.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Contact phone number in this tenant.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]}},"type":"object","title":"UpdateTenantUserProfileBody","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","last_name":"Musterassistent","phone_number":"+491701234567"}},"UpdateTenantUserProfileResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Tenant user profile ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name in this tenant.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name in this tenant.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name in this tenant.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact email address in this tenant.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Contact phone number in this tenant.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]}},"type":"object","required":["id","tenant_id","user_id"],"title":"UpdateTenantUserProfileResponse","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","id":"7442678451937742086","last_name":"Musterassistent","phone_number":"+491701234567","tenant_id":"7442550215703679004","user_id":"7442551216804781021"}},"UpdateUserBody":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Whether the user is active.","examples":[true,false]}},"additionalProperties":false,"type":"object","title":"UpdateUserBody","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","is_active":true,"last_name":"Musterassistent","phone_number":"+491701234567"}},"UpdateUserResponse":{"properties":{"id":{"type":"string","title":"Id","description":"User ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name.","examples":["Sprizzy","Prasath","Iva","Chef"]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name.","examples":["Musterassistent","Krishnamoorthy","Ask","Chef"]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Display name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Phone number.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name.","examples":["Sprizzy Musterassistent","Prasath Krishnamoorthy","Iva Ask","Chef Chef"]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the user is active.","examples":[true,false]},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether the user is a superuser.","examples":[true,false]}},"type":"object","required":["id","is_active","is_superuser"],"title":"UpdateUserResponse","example":{"display_name":"Sprizzy Musterassistent","email":"sprizzy@p-cation.de","first_name":"Sprizzy","full_name":"Sprizzy Musterassistent","id":"7442550215703679004","is_active":true,"is_superuser":true,"last_name":"Musterassistent","phone_number":"+491701234567"}},"UpdateWhatsAppBusinessProfileBody":{"properties":{"about":{"anyOf":[{"type":"string","maxLength":139},{"type":"null"}],"title":"About","description":"The 'About' text of the business profile.","examples":["Customer support for Sprizzy."]},"address":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Address","description":"Address of the business.","examples":["Musterstrasse 1, 50667 Cologne"]},"description":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Description","description":"Description of the business.","examples":["Sprizzy customer service team."]},"email":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Email","description":"Email of the business.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry","description":"Industry of the business.","examples":["PROF_SERVICES"]},"websites":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":2},{"type":"null"}],"title":"Websites","description":"List of websites for the business. Send one empty value to remove all websites.","examples":[["https://sprizzy.de"]]},"profile_picture":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Profile Picture","description":"Profile picture to upload.","examples":["agent-profile.png",null]},"display_name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Display Name","description":"Name displayed through WhatsApp.","examples":["Sprizzy Support"]},"pin":{"anyOf":[{"type":"string","pattern":"^\\d{6}$"},{"type":"null"}],"title":"Pin","description":"Six-digit PIN used during registration of the phone number.","examples":["123456"]}},"type":"object","title":"UpdateWhatsAppBusinessProfileBody","example":{"about":"Customer support for Sprizzy.","address":"Musterstrasse 1, 50667 Cologne","description":"Sprizzy customer service team.","display_name":"Sprizzy Support","email":"sprizzy@p-cation.de","industry":"PROF_SERVICES","pin":"123456","profile_picture":"agent-profile.png","websites":["https://sprizzy.de"]}},"UpdateWhatsAppBusinessProfileResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the profile was updated successfully.","examples":[true,false]},"message":{"type":"string","title":"Message","description":"Result message.","examples":["Business profile for WhatsApp business phone number 7442550215703679004 updated successfully."]}},"type":"object","required":["success","message"],"title":"UpdateWhatsAppBusinessProfileResponse","example":{"message":"Business profile for WhatsApp business phone number 7442550215703679004 updated successfully.","success":true}},"UpdateWhatsAppTemplateBody":{"properties":{"template_id":{"type":"integer","title":"Template Id","description":"Local template ID to update.","examples":[7442678451937742086]},"new_category":{"anyOf":[{"$ref":"#/components/schemas/TemplateCategory"},{"type":"null"}],"description":"Updated Meta template category.","examples":["UTILITY"]},"new_param_format":{"anyOf":[{"$ref":"#/components/schemas/ParamFormat"},{"type":"null"}],"description":"Updated template parameter format.","examples":["POSITIONAL"]},"new_message_send_ttl_seconds":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"New Message Send Ttl Seconds","description":"Updated message send TTL in seconds.","examples":[3600]},"new_components":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberMessageTemplateComponentExpand"},{"type":"null"}],"description":"Updated WhatsApp template components.","examples":[{"components":[{"params":{"1":"Mia"},"text":"Hello {{1}}","type":"BODY"}]}]}},"type":"object","required":["template_id"],"title":"UpdateWhatsAppTemplateBody","example":{"new_category":"UTILITY","new_components":{"components":[{"params":{"1":"Mia"},"text":"Hello {{1}}","type":"BODY"}]},"new_message_send_ttl_seconds":3600,"new_param_format":"POSITIONAL","template_id":"7442678451937742086"}},"UpdateWhatsAppTemplateResponse":{"properties":{"template_id":{"type":"string","title":"Template Id","description":"Local template ID.","examples":[7442678451937742086]},"template_details":{"additionalProperties":true,"type":"object","title":"Template Details","description":"Updated template details returned by Meta.","examples":[{"status":"APPROVED"}]}},"type":"object","required":["template_id","template_details"],"title":"UpdateWhatsAppTemplateResponse","example":{"template_details":{"status":"APPROVED"},"template_id":"7442678451937742086"}},"UpdateWhatsappChatAgentReplyBody":{"properties":{"enable_agent_reply":{"items":{"type":"integer"},"type":"array","title":"Enable Agent Reply","description":"List of chat_ids to enable auto agent reply for.","default":[],"examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]},"disable_agent_reply":{"items":{"type":"integer"},"type":"array","title":"Disable Agent Reply","description":"List of chat_ids to disable auto agent reply for.","default":[],"examples":[[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]]}},"type":"object","title":"UpdateWhatsappChatAgentReplyBody","example":{"disable_agent_reply":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"],"enable_agent_reply":["7442551216804781021","7442551216804781198","7442551216804781344","7442551216804781509"]}},"UpdateWhatsappChatAgentReplyResponse":{"properties":{"result":{"additionalProperties":{"type":"string"},"propertyNames":{"examples":["7442550215703679873"]},"type":"object","title":"Result","description":"enabled/disabled and failed message for each chat_id.","examples":[{"7442551216804781021":"enabled","7442551216804781198":"disabled","7442551216804781344":"not found"}]}},"type":"object","required":["result"],"title":"UpdateWhatsappChatAgentReplyResponse","example":{"result":{"7442551216804781021":"enabled","7442551216804781198":"disabled","7442551216804781344":"not found"}}},"UserGroupMembershipItemModel":{"properties":{"group_membership_id":{"type":"string","title":"Group Membership Id","description":"Group membership ID.","examples":[7443001845129083411,7443001845129083597,7443001845129083742,7443001845129083880]},"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"group_id":{"type":"string","title":"Group Id","description":"Group ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the group membership is active.","examples":[true,false]}},"type":"object","required":["group_membership_id","user_id","group_id","tenant_id","is_active"],"title":"UserGroupMembershipItemModel","example":{"group_id":"7442551216804781021","group_membership_id":"7443001845129083411","is_active":true,"tenant_id":"7442678451937742086","user_id":"7442550215703679004"}},"UserMetrics":{"properties":{"total_users":{"type":"string","title":"Total Users","description":"Total number of unique users in the system","examples":["150"]},"total_messages":{"type":"string","title":"Total Messages","description":"Total number of messages sent by all users","examples":["4200"]},"average_messages_per_user":{"type":"string","title":"Average Messages Per User","description":"Average messages per user (all users)","examples":["28.0"]},"total_tokens":{"$ref":"#/components/schemas/TokenUsage","description":"Total token usage (response and request tokens) for all users"},"average_tokens_per_user":{"type":"string","title":"Average Tokens Per User","description":"Average token usage per user (all users)","examples":["133.33"]}},"type":"object","required":["total_users","total_messages","average_messages_per_user","total_tokens","average_tokens_per_user"],"title":"UserMetrics","example":{"average_messages_per_user":"28.0","average_tokens_per_user":"133.33","total_messages":"4200","total_tokens":{"request_tokens":"8000","response_tokens":"12000"},"total_users":"150"}},"UserReportResponse":{"properties":{"total_metrics":{"$ref":"#/components/schemas/UserMetrics","description":"Metrics for all users in the system."},"active_metrics":{"$ref":"#/components/schemas/ActiveUserMetrics","description":"Metrics for active users during the timeframe."},"daily_message_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Daily Message Counts","description":"A mapping of date to number of messages sent on that day.","examples":[{"2025-07-20":120,"2025-07-21":95,"2025-07-22":150,"2025-07-23":200,"2025-07-24":180,"2025-07-25":130,"2025-07-26":140,"2025-07-27":160,"2025-07-28":170,"2025-07-29":190}]}},"type":"object","required":["total_metrics","active_metrics","daily_message_counts"],"title":"UserReportResponse","example":{"active_metrics":{"active_users":"45","average_messages_per_active_user":"26.67","average_tokens_per_active_user":"222.22","total_active_messages":"1200","total_active_tokens":{"request_tokens":"8000","response_tokens":"12000"}},"daily_message_counts":{"2025-07-20":120,"2025-07-21":95,"2025-07-22":150,"2025-07-23":200,"2025-07-24":180,"2025-07-25":130,"2025-07-26":140,"2025-07-27":160,"2025-07-28":170,"2025-07-29":190},"total_metrics":{"average_messages_per_user":"28.0","average_tokens_per_user":"133.33","total_messages":"4200","total_tokens":{"request_tokens":"8000","response_tokens":"12000"},"total_users":"150"}}},"UserRoleAssignmentItemModel":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"role_id":{"type":"string","title":"Role Id","description":"Role ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]}},"type":"object","required":["user_id","role_id","tenant_id"],"title":"UserRoleAssignmentItemModel","example":{"role_id":"7442551216804781021","tenant_id":"7442678451937742086","user_id":"7442550215703679004"}},"ValidatePhoneNumberStatusResponse":{"properties":{"number_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number Status","description":"Phone number status","examples":["CONNECTED"]},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status","description":"WhatsApp business account review status","examples":["APPROVED"]},"webhook_subscribed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Subscribed","description":"Webhook subscription status","examples":["TRUE"]}},"type":"object","title":"ValidatePhoneNumberStatusResponse","example":{"number_status":"CONNECTED","review_status":"APPROVED","webhook_subscribed":"TRUE"}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValueSchema-Input":{"properties":{"type":{"type":"string","enum":["string","integer","number","boolean","object","array"],"title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldSchema-Input"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/components/schemas/ValueSchema-Input"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["type"],"title":"ValueSchema"},"ValueSchema-Output":{"properties":{"type":{"type":"string","enum":["string","integer","number","boolean","object","array"],"title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"choices":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Choices"},"properties":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldSchema-Output"},"type":"array"},{"type":"null"}],"title":"Properties"},"items":{"anyOf":[{"$ref":"#/components/schemas/ValueSchema-Output"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["type"],"title":"ValueSchema"},"VariableDefinition":{"properties":{"default":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default","description":"Optional default value for the variable.","examples":["professional","friendly","high"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description of the variable.","examples":["Name of the customer.","Main topic to address.","Desired writing tone."]},"required":{"type":"boolean","title":"Required","description":"Whether the variable must be provided.","default":false,"examples":[true,false]}},"type":"object","title":"VariableDefinition","example":{"default":"professional","description":"Name of the customer.","required":true}},"VerifyPhoneNumberCodeBody":{"properties":{"code":{"type":"string","title":"Code","description":"Verification code received from Meta","examples":["123456"]}},"type":"object","required":["code"],"title":"VerifyPhoneNumberCodeBody","example":{"code":"123456"}},"WaitForDatevOutboxDocumentStatusResponse":{"properties":{"document_id":{"type":"string","title":"Document Id","description":"Outbox document ID.","examples":["b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01"]},"status":{"type":"string","title":"Status","description":"Last known TRAFFIQX outbox status.","examples":["sent","inProcess"]},"is_terminal":{"type":"boolean","title":"Is Terminal","description":"Whether the status is terminal and polling can stop.","examples":[true,false]},"timed_out":{"type":"boolean","title":"Timed Out","description":"Whether polling stopped due to reaching max_wait_seconds.","examples":[false,true]},"attempts":{"type":"integer","title":"Attempts","description":"Number of status requests performed during waiting.","examples":[3,5]},"waited_seconds":{"type":"integer","title":"Waited Seconds","description":"Total elapsed waiting time in seconds.","examples":[9,60]},"checked_at":{"type":"string","format":"date-time","title":"Checked At","description":"UTC timestamp of the last status check.","examples":["2026-02-20T10:41:09+00:00","2026-02-20T10:42:00+00:00"]},"raw":{"anyOf":[{},{"type":"null"}],"title":"Raw","description":"Optional raw TRAFFIQX response payload from the last check.","examples":[{"status":"sent"},{"status":"inProcess"}]}},"type":"object","required":["document_id","status","is_terminal","timed_out","attempts","waited_seconds","checked_at"],"title":"WaitForDatevOutboxDocumentStatusResponse","example":{"attempts":3,"checked_at":"2026-02-20T10:41:09+00:00","document_id":"b7f2f0a8-9e4c-4f7b-9f37-4c2d6b8a9c01","is_terminal":true,"raw":{"status":"sent"},"status":"sent","timed_out":false,"waited_seconds":9}},"WhatsAppBusinessPhoneNumberFirstContactTemplateBody":{"properties":{"text":{"type":"string","maxLength":1024,"minLength":1,"title":"Text","description":"Message text sent to users on first contact.","examples":["Hi {user_name}, how can we help?"]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageurl","description":"Optional header image URL.","examples":["https://example.com/header.png"]},"buttons":{"anyOf":[{"items":{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberFirstContactTemplateButton"},"type":"array"},{"type":"null"}],"title":"Buttons","description":"CTA buttons displayed below the first-contact message.","examples":[[{"title":"Open website","url":"https://example.com"}]]},"footer":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer","description":"Optional message footer.","examples":["LIVOI support"]}},"type":"object","required":["text"],"title":"WhatsAppBusinessPhoneNumberFirstContactTemplateBody","example":{"buttons":[{"title":"Open website","url":"https://example.com"}],"footer":"LIVOI support","imageUrl":"https://example.com/header.png","text":"Hi {user_name}, how can we help?"}},"WhatsAppBusinessPhoneNumberFirstContactTemplateButton":{"properties":{"title":{"type":"string","maxLength":80,"minLength":1,"title":"Title","description":"Button title shown in the first-contact message.","examples":["Open website"]},"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"Button destination URL.","examples":["https://example.com"]}},"type":"object","required":["title","url"],"title":"WhatsAppBusinessPhoneNumberFirstContactTemplateButton"},"WhatsAppBusinessPhoneNumberFirstContactTemplateUpdateBody":{"properties":{"text":{"anyOf":[{"type":"string","maxLength":1024,"minLength":1},{"type":"null"}],"title":"Text","description":"Message text sent to users on first contact.","examples":["Hi {user_name}, thanks for reaching out. How can we help?"]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageurl","description":"Optional header image URL.","examples":["https://example.com/header.png"]},"buttons":{"anyOf":[{"items":{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberFirstContactTemplateButton"},"type":"array"},{"type":"null"}],"title":"Buttons","description":"CTA buttons displayed below the first-contact message.","examples":[[{"title":"Open website","url":"https://example.com"}]]},"footer":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer","description":"Optional message footer.","examples":["LIVOI support"]}},"type":"object","title":"WhatsAppBusinessPhoneNumberFirstContactTemplateUpdateBody","example":{"buttons":[{"title":"Open website","url":"https://example.com"}],"footer":"LIVOI support","imageUrl":"https://example.com/header.png","text":"Hi {user_name}, thanks for reaching out. How can we help?"}},"WhatsAppBusinessPhoneNumberMessageTemplateBody":{"properties":{"components":{"items":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberMessageTemplateComponentText"},{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberMessageTemplateComponentButton"}]},"type":"array","minItems":1,"title":"Components","description":"WhatsApp template components.","examples":[[{"params":{"1":"Mia"},"text":"Hello {{1}}, your order is ready.","type":"BODY"}]]},"name":{"type":"string","maxLength":512,"minLength":1,"pattern":"^[a-z0-9_]+$","title":"Name","description":"Meta template name. Lowercase letters, numbers, and underscores only.","examples":["order_ready"]},"language":{"$ref":"#/components/schemas/TemplateLanguage","description":"Template language.","default":"de","examples":["de"]},"category":{"$ref":"#/components/schemas/TemplateCategory","description":"Meta template category.","examples":["UTILITY"]},"param_format":{"$ref":"#/components/schemas/ParamFormat","description":"Template parameter format.","default":"POSITIONAL","examples":["POSITIONAL"]},"message_send_ttl_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Message Send Ttl Seconds","description":"Optional Meta message send TTL in seconds.","examples":[3600]}},"type":"object","required":["components","name","category"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateBody","example":{"category":"UTILITY","components":[{"params":{"1":"Mia"},"text":"Hello {{1}}, your order is ready.","type":"BODY"}],"language":"de","message_send_ttl_seconds":3600,"name":"order_ready","param_format":"POSITIONAL"}},"WhatsAppBusinessPhoneNumberMessageTemplateComponentButton":{"properties":{"type":{"type":"string","minLength":1,"title":"Type","description":"WhatsApp template component type.","examples":["BODY"]},"text":{"type":"string","minLength":1,"title":"Text","description":"Template component text.","examples":["Hello {{1}}, your order is ready."]},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Optional URL for URL buttons.","examples":["https://example.com/orders/{{1}}"]}},"type":"object","required":["type","text"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentButton"},"WhatsAppBusinessPhoneNumberMessageTemplateComponentExpand":{"properties":{"components":{"items":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberMessageTemplateComponentText"},{"$ref":"#/components/schemas/WhatsAppBusinessPhoneNumberMessageTemplateComponentButton"}]},"type":"array","minItems":1,"title":"Components","description":"WhatsApp template components.","examples":[[{"params":{"1":"Mia"},"text":"Hello {{1}}, your order is ready.","type":"BODY"}]]}},"type":"object","required":["components"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentExpand"},"WhatsAppBusinessPhoneNumberMessageTemplateComponentText":{"properties":{"type":{"type":"string","minLength":1,"title":"Type","description":"WhatsApp template component type.","examples":["BODY"]},"text":{"type":"string","minLength":1,"title":"Text","description":"Template component text.","examples":["Hello {{1}}, your order is ready."]},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Params","description":"Template parameters used while formatting component examples.","examples":[{"1":"Mia"}]}},"type":"object","required":["type","text"],"title":"WhatsAppBusinessPhoneNumberMessageTemplateComponentText"},"WhatsAppBusinessProfileSyncItem":{"properties":{"whatsapp_business_phone_number_id":{"type":"string","title":"Whatsapp Business Phone Number Id","description":"WhatsApp business phone number ID.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"whatsapp_business_profile_id":{"type":"string","title":"Whatsapp Business Profile Id","description":"WhatsApp business profile ID.","examples":[7442551216804781021,7442551216804781198,7442551216804781344,7442551216804781509]},"updated_fields":{"items":{"type":"string"},"type":"array","title":"Updated Fields","description":"List of profile and business account fields updated from Meta.","examples":[["status","whatsapp_about","whatsapp_email"]]},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional sync message.","examples":["No profile changes detected; local data is already in sync with Meta."]}},"type":"object","required":["whatsapp_business_phone_number_id","whatsapp_business_profile_id","updated_fields"],"title":"WhatsAppBusinessProfileSyncItem","example":{"message":"No profile changes detected; local data is already in sync with Meta.","updated_fields":["status","whatsapp_about","whatsapp_email"],"whatsapp_business_phone_number_id":"7442550215703679004","whatsapp_business_profile_id":"7442551216804781021"}},"WhatsAppDeliveryStatus":{"anyOf":[{"type":"string","const":"accepted"},{"$ref":"#/components/schemas/WhatsAppProviderStatus"}]},"WhatsAppProviderStatus":{"type":"string","enum":["sent","delivered","read","failed"]},"WhitelistEntries":{"items":{"$ref":"#/components/schemas/AgentWhitelistEntrySnapshot"},"type":"array"},"WhitelistEntry":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"ID of the agent.","examples":[7442550215703679004,7442550215703679137,7442550215703679284,7442550215703679412]},"entries":{"items":{"$ref":"#/components/schemas/WhitelistItem"},"type":"array","title":"Entries","description":"List of whitelist entries."}},"type":"object","required":["agent_id","entries"],"title":"WhitelistEntry","example":{"agent_id":"7442550215703679004","entries":[{"email":"sprizzy@p-cation.de","entry_id":"7442678451937742086","match_type":"email","match_value":"sprizzy@p-cation.de","phone_number":"+491701234567","user_id":"7442678451937742086"}]}},"WhitelistItem":{"properties":{"entry_id":{"type":"string","title":"Entry Id","description":"ID of the whitelist entry.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"match_type":{"type":"string","title":"Match Type","description":"Whitelist match type.","examples":["email"]},"match_value":{"type":"string","title":"Match Value","description":"Whitelist match value.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"user_id":{"anyOf":[{"type":"string","examples":["7442550215703679873"]},{"type":"null"}],"title":"User Id","description":"Resolved user ID when this is a user whitelist entry.","examples":[7442678451937742086,7442678451937742214,7442678451937742389,7442678451937742520]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Resolved user email when available.","examples":["sprizzy@p-cation.de","musterassistent@p-cation.de","support@p-cation.de","test@sprizzy.de"]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Resolved user phone number when available.","examples":["+491701234567","+4917611122233","+4915112349876","+492211234560"]}},"type":"object","required":["entry_id","match_type","match_value"],"title":"WhitelistItem","example":{"email":"sprizzy@p-cation.de","entry_id":"7442678451937742086","match_type":"email","match_value":"sprizzy@p-cation.de","phone_number":"+491701234567","user_id":"7442678451937742086"}},"WhitelistMatchType":{"type":"string","enum":["user_id","email","email_domain","phone_number","microsoft","clerk","better_auth","whatsapp"],"title":"WhitelistMatchType"},"ZeroTapOTPParam":{"properties":{"type":{"type":"string","const":"ZERO_TAP_OTP","title":"Type","description":"Runtime zero-tap OTP button parameter type.","examples":["ZERO_TAP_OTP"]},"otp":{"type":"string","minLength":1,"title":"Otp","description":"OTP value for zero-tap OTP buttons.","examples":["576146","942147"]}},"additionalProperties":false,"type":"object","required":["type","otp"],"title":"ZeroTapOTPParam"},"api__models__v1__agent__core_models__FieldChange":{"properties":{"previous":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous","description":"Previous value.","examples":["Support Assistant"]},"new":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New","description":"Updated value.","examples":["Invoice Assistant"]}},"type":"object","title":"FieldChange"},"api__models__v1__agent__library_models__FieldChange":{"properties":{"previous":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous","description":"Previous value of the field.","examples":["Sales","Meeting follow-up","Support"]},"new":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New","description":"New value of the field.","examples":["Sales_Outdated","Meeting follow-up v2","Support_Legacy"]}},"type":"object","title":"FieldChange","example":{"new":"Sales_Outdated","previous":"Sales"}}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"x-permission-catalog":["agent_images.create","agent_images.create.any","agent_images.delete","agent_images.delete.any","agent_images.read","agent_images.read.any","agent_images.update","agent_images.update.any","agent_mcp_clients.create","agent_mcp_clients.create.any","agent_mcp_clients.delete","agent_mcp_clients.delete.any","agent_mcp_clients.read","agent_mcp_clients.read.any","agent_mcp_clients.update","agent_mcp_clients.update.any","agent_specs.read","agent_specs.read.any","agent_tools.create","agent_tools.create.any","agent_tools.delete","agent_tools.delete.any","agent_tools.read","agent_tools.read.any","agent_tools.update","agent_tools.update.any","agent_whitelist_entries.create","agent_whitelist_entries.create.any","agent_whitelist_entries.delete","agent_whitelist_entries.delete.any","agent_whitelist_entries.read","agent_whitelist_entries.read.any","agent_whitelist_entries.update","agent_whitelist_entries.update.any","agents.access_manage","agents.access_manage.any","agents.access_manage.granted","agents.access_manage.own","agents.create","agents.create.any","agents.create.granted","agents.create.own","agents.delete","agents.delete.any","agents.delete.granted","agents.delete.own","agents.read","agents.read.any","agents.read.granted","agents.read.own","agents.update","agents.update.any","agents.update.granted","agents.update.own","api_keys.create","api_keys.create.any","api_keys.create.own","api_keys.delete","api_keys.delete.any","api_keys.delete.own","api_keys.read","api_keys.read.any","api_keys.read.own","api_keys.update","api_keys.update.any","api_keys.update.own","automations.access_manage","automations.access_manage.any","automations.access_manage.granted","automations.access_manage.own","automations.create","automations.create.any","automations.create.granted","automations.create.own","automations.delete","automations.delete.any","automations.delete.granted","automations.delete.own","automations.read","automations.read.any","automations.read.granted","automations.read.own","automations.update","automations.update.any","automations.update.granted","automations.update.own","calendars.access_manage","calendars.access_manage.any","calendars.access_manage.granted","calendars.access_manage.own","calendars.create","calendars.create.any","calendars.create.granted","calendars.create.own","calendars.delete","calendars.delete.any","calendars.delete.granted","calendars.delete.own","calendars.read","calendars.read.any","calendars.read.granted","calendars.read.own","calendars.update","calendars.update.any","calendars.update.granted","calendars.update.own","chat_history_entries.create","chat_history_entries.create.any","chat_history_entries.create.granted","chat_history_entries.create.own","chat_history_entries.delete","chat_history_entries.delete.any","chat_history_entries.delete.granted","chat_history_entries.delete.own","chat_history_entries.read","chat_history_entries.read.any","chat_history_entries.read.granted","chat_history_entries.read.own","chat_history_entries.update","chat_history_entries.update.any","chat_history_entries.update.granted","chat_history_entries.update.own","chat_history_parts.create","chat_history_parts.create.any","chat_history_parts.create.own","chat_history_parts.delete","chat_history_parts.delete.any","chat_history_parts.delete.own","chat_history_parts.read","chat_history_parts.read.any","chat_history_parts.read.own","chat_history_parts.update","chat_history_parts.update.any","chat_history_parts.update.own","chat_history_usage.read","chat_history_usage.read.any","chats.access_manage","chats.access_manage.any","chats.access_manage.granted","chats.access_manage.own","chats.create","chats.create.any","chats.create.granted","chats.create.own","chats.delete","chats.delete.any","chats.delete.granted","chats.delete.own","chats.read","chats.read.any","chats.read.granted","chats.read.own","chats.update","chats.update.any","chats.update.granted","chats.update.own","datev_invoice_previews.create","datev_invoice_previews.create.any","datev_invoice_previews.create.granted","datev_invoice_previews.create.own","datev_invoice_previews.delete","datev_invoice_previews.delete.any","datev_invoice_previews.delete.granted","datev_invoice_previews.delete.own","datev_invoice_previews.read","datev_invoice_previews.read.any","datev_invoice_previews.read.granted","datev_invoice_previews.read.own","datev_invoice_previews.update","datev_invoice_previews.update.any","datev_invoice_previews.update.granted","datev_invoice_previews.update.own","datev_invoice_registry.create","datev_invoice_registry.create.any","datev_invoice_registry.delete","datev_invoice_registry.delete.any","datev_invoice_registry.read","datev_invoice_registry.read.any","datev_profiles.access_manage","datev_profiles.access_manage.any","datev_profiles.access_manage.granted","datev_profiles.access_manage.own","datev_profiles.create","datev_profiles.create.any","datev_profiles.create.granted","datev_profiles.create.own","datev_profiles.delete","datev_profiles.delete.any","datev_profiles.delete.granted","datev_profiles.delete.own","datev_profiles.read","datev_profiles.read.any","datev_profiles.read.granted","datev_profiles.read.own","datev_profiles.update","datev_profiles.update.any","datev_profiles.update.granted","datev_profiles.update.own","email_office_integrations.create","email_office_integrations.create.any","email_office_integrations.create.own","email_office_integrations.delete","email_office_integrations.delete.any","email_office_integrations.delete.own","email_office_integrations.read","email_office_integrations.read.any","email_office_integrations.read.own","email_office_integrations.update","email_office_integrations.update.any","email_office_integrations.update.own","embedding_profiles.read","embedding_profiles.read.any","group_memberships.create","group_memberships.create.any","group_memberships.delete","group_memberships.delete.any","group_memberships.read","group_memberships.read.any","group_memberships.update","group_memberships.update.any","groups.create","groups.create.any","groups.delete","groups.delete.any","groups.read","groups.read.any","groups.update","groups.update.any","knowledgechunk.read","knowledgechunk.read.any","knowledgefile.access_manage","knowledgefile.access_manage.any","knowledgefile.access_manage.granted","knowledgefile.access_manage.own","knowledgefile.create","knowledgefile.create.any","knowledgefile.create.granted","knowledgefile.create.own","knowledgefile.delete","knowledgefile.delete.any","knowledgefile.delete.granted","knowledgefile.delete.own","knowledgefile.read","knowledgefile.read.any","knowledgefile.read.granted","knowledgefile.read.own","knowledgefile.update","knowledgefile.update.any","knowledgefile.update.granted","knowledgefile.update.own","labels.create","labels.create.any","labels.delete","labels.delete.any","labels.read","labels.read.any","labels.update","labels.update.any","mcp_servers.create","mcp_servers.create.any","mcp_servers.delete","mcp_servers.delete.any","mcp_servers.read","mcp_servers.read.any","mcp_servers.update","mcp_servers.update.any","office_analysis_runs.create","office_analysis_runs.create.any","office_analysis_runs.read","office_analysis_runs.read.any","office_analysis_runs.update","office_analysis_runs.update.any","office_artifacts.create","office_artifacts.create.any","office_artifacts.read","office_artifacts.read.any","office_case_notes.create","office_case_notes.create.any","office_case_notes.read","office_case_notes.read.any","office_case_notes.update","office_case_notes.update.any","office_case_relations.create","office_case_relations.create.any","office_case_relations.read","office_case_relations.read.any","office_cases.create","office_cases.create.any","office_cases.create.own","office_cases.delete","office_cases.delete.any","office_cases.delete.own","office_cases.read","office_cases.read.any","office_cases.read.own","office_cases.update","office_cases.update.any","office_cases.update.own","office_events.create","office_events.create.any","office_events.read","office_events.read.any","office_exports.create","office_exports.create.any","persistent_tasks.create","persistent_tasks.create.any","persistent_tasks.delete","persistent_tasks.delete.any","persistent_tasks.read","persistent_tasks.read.any","persistent_tasks.update","persistent_tasks.update.any","prompt_library.create","prompt_library.create.any","prompt_library.delete","prompt_library.delete.any","prompt_library.read","prompt_library.read.any","prompt_library.update","prompt_library.update.any","prompt_library_folder.create","prompt_library_folder.create.any","prompt_library_folder.delete","prompt_library_folder.delete.any","prompt_library_folder.read","prompt_library_folder.read.any","prompt_library_folder.update","prompt_library_folder.update.any","resource_grants.access_manage","resource_grants.access_manage.any","resource_grants.create","resource_grants.create.any","resource_grants.delete","resource_grants.delete.any","resource_grants.read","resource_grants.read.any","role_permissions.create","role_permissions.create.any","role_permissions.delete","role_permissions.delete.any","role_permissions.read","role_permissions.read.any","roles.create","roles.create.any","roles.delete","roles.delete.any","roles.read","roles.read.any","roles.update","roles.update.any","storage_objects.access_manage","storage_objects.access_manage.any","storage_objects.access_manage.granted","storage_objects.access_manage.own","storage_objects.create","storage_objects.create.any","storage_objects.create.granted","storage_objects.create.own","storage_objects.delete","storage_objects.delete.any","storage_objects.delete.granted","storage_objects.delete.own","storage_objects.read","storage_objects.read.any","storage_objects.read.granted","storage_objects.read.own","storage_objects.update","storage_objects.update.any","storage_objects.update.granted","storage_objects.update.own","tenant_contacts.create","tenant_contacts.create.any","tenant_contacts.delete","tenant_contacts.delete.any","tenant_contacts.read","tenant_contacts.read.any","tenant_contacts.update","tenant_contacts.update.any","tenant_memberships.create","tenant_memberships.create.any","tenant_memberships.delete","tenant_memberships.delete.any","tenant_memberships.read","tenant_memberships.read.any","tenant_memberships.update","tenant_memberships.update.any","tenant_user_profiles.read","tenant_user_profiles.read.any","tenant_user_profiles.read.own","tenant_user_profiles.update","tenant_user_profiles.update.any","tenant_user_profiles.update.own","tenants.create","tenants.create.any","tenants.create.own","tenants.delete","tenants.delete.any","tenants.delete.own","tenants.read","tenants.read.any","tenants.read.own","tenants.update","tenants.update.any","tenants.update.own","user_integration_identities.create","user_integration_identities.create.any","user_integration_identities.create.own","user_integration_identities.delete","user_integration_identities.delete.any","user_integration_identities.delete.own","user_integration_identities.read","user_integration_identities.read.any","user_integration_identities.read.own","users.create","users.create.any","users.create.own","users.read","users.read.any","users.read.own","users.update","users.update.any","users.update.own","whatsapp_business_phone_numbers.create","whatsapp_business_phone_numbers.create.any","whatsapp_business_phone_numbers.delete","whatsapp_business_phone_numbers.delete.any","whatsapp_business_phone_numbers.read","whatsapp_business_phone_numbers.read.any","whatsapp_business_phone_numbers.update","whatsapp_business_phone_numbers.update.any","whatsapp_business_profiles.create","whatsapp_business_profiles.create.any","whatsapp_business_profiles.delete","whatsapp_business_profiles.delete.any","whatsapp_business_profiles.read","whatsapp_business_profiles.read.any","whatsapp_business_profiles.update","whatsapp_business_profiles.update.any","whatsapp_templates.create","whatsapp_templates.create.any","whatsapp_templates.delete","whatsapp_templates.delete.any","whatsapp_templates.read","whatsapp_templates.read.any","whatsapp_templates.update","whatsapp_templates.update.any"],"tags":[{"name":"v1/Core/auth","x-displayName":"auth"},{"name":"v1/Core/automations","x-displayName":"automations"},{"name":"v1/Core/calendar","x-displayName":"calendar"},{"name":"v1/Core/dynamic","x-displayName":"dynamic"},{"name":"v1/Core/frontend","x-displayName":"frontend"},{"name":"v1/Core/groups","x-displayName":"groups"},{"name":"v1/Core/permissions","x-displayName":"permissions"},{"name":"v1/Core/resource-grants","x-displayName":"resource-grants"},{"name":"v1/Core/roles","x-displayName":"roles"},{"name":"v1/Core/storage","x-displayName":"storage"},{"name":"v1/Core/tenants","x-displayName":"tenants"},{"name":"v1/Core/users","x-displayName":"users"},{"name":"v1/Agent/agents","x-displayName":"agents"},{"name":"v1/Agent/whitelist","x-displayName":"whitelist"},{"name":"v1/Agent/tools","x-displayName":"tools"},{"name":"v1/Agent/mcp","x-displayName":"mcp"},{"name":"v1/Agent/files","x-displayName":"files"},{"name":"v1/Agent/library","x-displayName":"library"},{"name":"v1/Agent/chat","x-displayName":"chat"},{"name":"v1/Agent/labels","x-displayName":"labels"},{"name":"v1/Integrations/whatsapp","x-displayName":"whatsapp"},{"name":"v1/Integrations/announcement","x-displayName":"announcement"},{"name":"v1/Integrations/datev","x-displayName":"datev"},{"name":"v1/Integrations/auth","x-displayName":"auth"},{"name":"v1/Integrations/email","x-displayName":"email"},{"name":"v1/Integrations/email-office","x-displayName":"email-office"},{"name":"v1/Integrations/calendar","x-displayName":"calendar"},{"name":"v1/Office/cases","x-displayName":"cases"},{"name":"v1/Office/configuration","x-displayName":"configuration"},{"name":"v1/Sync/chats","x-displayName":"chats"},{"name":"v1/Sync/agents","x-displayName":"agents"},{"name":"v1/Sync/knowledge-files","x-displayName":"knowledge-files"},{"name":"v1/Sync/changes","x-displayName":"changes"}],"x-tagGroups":[{"name":"v1/Core","tags":["v1/Core/auth","v1/Core/automations","v1/Core/calendar","v1/Core/dynamic","v1/Core/frontend","v1/Core/groups","v1/Core/permissions","v1/Core/resource-grants","v1/Core/roles","v1/Core/storage","v1/Core/tenants","v1/Core/users"]},{"name":"v1/Agent","tags":["v1/Agent/agents","v1/Agent/whitelist","v1/Agent/tools","v1/Agent/mcp","v1/Agent/files","v1/Agent/library","v1/Agent/chat","v1/Agent/labels"]},{"name":"v1/Integrations","tags":["v1/Integrations/whatsapp","v1/Integrations/announcement","v1/Integrations/datev","v1/Integrations/auth","v1/Integrations/email","v1/Integrations/email-office","v1/Integrations/calendar"]},{"name":"v1/Office","tags":["v1/Office/cases","v1/Office/configuration"]},{"name":"v1/Sync","tags":["v1/Sync/chats","v1/Sync/agents","v1/Sync/knowledge-files","v1/Sync/changes"]}]}