{"method":"GET","path":"https://api.revcent.com/v2/ai_threads","summary":"Get AI Threads","description":"Returns a list of AI Threads previously created. Note: AI Threads are stored for a maximum of 60 days since creation. Important: For counting, aggregations, metrics, data mining or document property search, use the BigQueryRunQuery operation instead. For bulk exports, refer to the bulk export utility guide at https://kb.revcent.com/en/revcent-account/bulk-export for more information. The date_start, date_end, page and limit URL parameters are required. The difference between date_start and date_end cannot exceed a two (2) day period. View markdown documentation at https://revcent.com/documentation/markdown/mcp/operation/OverviewAIThread.md for an in-depth overview of this operation.","operationId":"GetAIThreads","parameters":[{"description":"The date range start date as a unix timestamp in seconds.","in":"query","name":"date_start","required":true,"schema":{"type":"integer","format":"unix-time"},"style":"form"},{"description":"The date range end date as a unix timestamp in seconds.","in":"query","name":"date_end","required":true,"schema":{"type":"integer","format":"unix-time"},"style":"form"},{"description":"A limit on the number of objects to be returned. Limit can range between 1 and 25, and the default is 25.","in":"query","name":"limit","required":true,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":25},"style":"form"},{"description":"Used for pagination, i.e. to skip to specific page of results.","in":"query","name":"page","required":true,"schema":{"type":"integer","format":"int32"},"style":"form"},{"name":"ai_assistant_filter","in":"query","description":"To filter items based on one or more associated AI Assistants.","required":false,"schema":{"type":"array","items":{"type":"string","title":"AI Assistant ID","description":"A 20 character AI Assistant ID.","minLength":20,"maxLength":20}},"style":"form","explode":true},{"name":"status_filter","in":"query","description":"To filter AI Threads based on status.","required":false,"schema":{"type":"array","items":{"type":"string","enum":["running","timer","complete","error"]}},"style":"form","explode":true}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"encoding":{},"schema":{"additionalProperties":false,"properties":{},"type":"object"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"API call response code.","type":"integer","format":"int32","enum":[1]},"current_count":{"description":"The current number of items in the results.","type":"integer"},"current_page":{"description":"The current page for the items in the results.","type":"integer"},"results":{"items":{"allOf":[{"type":"object","additionalProperties":false,"properties":{"created_date_unix":{"description":"The unix timestamp of when the item was created.","type":"integer","format":"unix-time"},"id":{"type":"string","title":"AI Thread ID","description":"A 20 character AI Thread ID.","minLength":20,"maxLength":20},"status":{"type":"string","description":"The current AI Thread status.","enum":["Running","Complete","Timer","Cancelled","Error"]},"messages":{"items":{"additionalProperties":false,"properties":{"role":{"type":"string","description":"The role associated with the message.","enum":["user","assistant","system"]},"content":{"type":"string","description":"The content of the message."},"tool_call_id":{"type":"string","description":"If the message is associated with a tool call submission, the tool call ID being submitted."},"tool_calls":{"items":{"additionalProperties":false,"properties":{"id":{"type":"string","description":"The tool call ID."},"type":{"type":"string","description":"The tool call type.","enum":["function"]},"function_name":{"type":"string","description":"If the tool call type is function, the function name the AI is calling."},"function_args":{"type":"string","description":"If the tool call type is function, the function arguments the AI is sending"}},"type":"object"},"type":"array","description":"If the message is associated with tool call requests, an array of tool calls requested by the AI."},"previous_ai_thread":{"additionalProperties":false,"properties":{"id":{"type":"string","title":"AI Thread ID","description":"A 20 character AI Thread ID.","minLength":20,"maxLength":20},"created_date_unix":{"description":"The unix timestamp when the original message was created from the previous AI Thread.","type":"integer","format":"unix-time"}},"type":"object","description":"If the message is from a previous AI Thread, the thread ID and original date of the message. I.e. a handoff from a different AI Assistant with messages included."},"created_date_unix":{"description":"The unix timestamp when the message was created.","type":"integer","format":"unix-time"},"third_party_name":{"type":"string","description":"The name of the AI third party that processed the AI message."},"third_party_model":{"type":"string","description":"The AI third party model that processed the AI message."}},"type":"object"},"type":"array","description":"Message associated with the AI Thread. Only provided when retrieving a specific AI Thread using an AI Thread ID."},"message_count":{"description":"The total number of messages within the AI Thread.","type":"integer"},"total_tokens":{"description":"The total number of tokens the AI Thread consumed","type":"integer"},"total_time_ms":{"description":"The total amount of time in milliseconds that it took RevCent to process the AI thread.","type":"integer"},"previous_ai_thread":{"additionalProperties":false,"properties":{"id":{"type":"string","title":"AI Thread ID","description":"A 20 character AI Thread ID.","minLength":20,"maxLength":20},"ai_assistant":{"additionalProperties":false,"properties":{"id":{"type":"string","title":"AI Assistant ID","description":"A 20 character AI Assistant ID.","minLength":20,"maxLength":20},"name":{"type":"string","description":"The previous AI Threads' associated AI Assistant name."}},"type":"object","description":"The AI Assistant associated with the previous AI Thread."}},"type":"object","description":"The previous AI Thread, if the current AI Thread was the result of an AI Assistant being triggered with a previous AI Thread ID provided. I.e. a handoff using a different AI Assistant."},"trigger":{"additionalProperties":false,"properties":{"source":{"type":"string","description":"The source that triggered the AI threads' creation.","enum":["api","web_app","account_event"]},"notation":{"type":"string","description":"If the source is 'account_event', the account event notation indicating the event that triggered the thread."},"api_call":{"additionalProperties":false,"properties":{"id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_account":{"type":"object","additionalProperties":false,"description":"The API account associated with the API call.","properties":{"id":{"type":"string","description":"A 20 character API account ID.","minLength":20,"maxLength":20},"name":{"description":"The API account name.","type":"string"}}},"ai_assistant":{"type":"object","additionalProperties":false,"description":"If an AI Assistant made the API call that triggered the AI thread.","properties":{"id":{"type":"string","title":"AI Assistant ID","description":"A 20 character AI Assistant ID.","minLength":20,"maxLength":20},"name":{"type":"string","description":"The AI Assistant name."}}}},"type":"object","description":"If the source is 'api', the API call that triggered the thread."},"web_user":{"description":"If the source is 'web_app', the web user that triggered the thread","type":"object","additionalProperties":false,"properties":{"id":{"description":"The web user ID.","type":"string"},"username":{"description":"The web username.","type":"string"},"first_name":{"description":"The web first name.","type":"string"},"last_name":{"description":"The web last name","type":"string"}}}},"type":"object","description":"Information on what triggered the AI Thread and thus it's creation."},"ai_assistant":{"additionalProperties":false,"properties":{"id":{"type":"string","title":"AI Assistant ID","description":"A 20 character AI Assistant ID.","minLength":20,"maxLength":20},"name":{"type":"string","description":"The AI Threads' associated AI Assistant name."}},"type":"object","description":"The AI Assistant associated with the AI Thread."},"third_party_integration":{"title":"Third Party Integration","type":"object","additionalProperties":false,"description":"The third party AI integration related to the item.","properties":{"id":{"type":"string","description":"A 20 character user third party integration ID.","minLength":20,"maxLength":20},"name":{"title":"User Integration Name","type":"string","description":"The user named third party integration."},"third_party":{"type":"object","description":"Site third party integration, related to the user third party integration.","additionalProperties":false,"properties":{"id":{"type":"string","description":"A 20 character system third party integration ID.","minLength":20,"maxLength":20},"name":{"title":"Site Third Party Integration Name","type":"string","description":"The RevCent named site third party integration."}}}}},"time_delay_expires":{"description":"The time the AI Thread will be run if the AI Thread status value is 'Timer'. An AI Thread can be delayed for a specified period of time, thus status 'Timer' indicates the AI Thread is hibernating.","type":"integer","format":"unix-time"},"updated_date_unix":{"description":"The unix timestamp of when the item was last updated.","type":"integer","format":"unix-time"}}}]},"type":"array"},"total_count":{"description":"The total number of items found given the date_start and date_end query parameters.","type":"integer"},"total_pages":{"description":"The total number of pages given the date_start, date_end and limit query parameters.","type":"integer"}},"type":"object","additionalProperties":false}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}