---
title: "Get response"
method: POST
path: "/get_response"
---

# Get response

`POST /get_response`

## Request

- Base URL: `https://agency-swarm-app-japboyzddq-uc.a.run.app`
- URL: `https://agency-swarm-app-japboyzddq-uc.a.run.app/get_response`
- Auth: HTTP bearer

Processes a message using the specified API integration and returns a response from the agent. Requires a valid platform token. Ensure the apiIntegrationId is valid. Supports continuing existing chats via chatId or aliasChatId and attaching files with tools.

## Request body

- GetResponseRequest: Request body for the /get_response endpoint.
  - `message` string, required: The message content to be processed by the agent. Example: "Hey! How are you?"
  - `apiIntegrationId` string, required: The unique identifier for the API integration being used. Example: "dpCD7snQ0tCWrdtp6UhZ"
  - `chatId` string, nullable: The unique identifier for the chat session. If provided, continues the chat with the previous context. Example: "plOQeH3hW7UKiACqEdAx"
  - `attachments` Attachment[], nullable: An array of attachment objects to include files and specify tools for processing. Example: [{"file_id": "file-123", "tools": [{"type": "file_search"}]}]
    - `file_id` string, required: The unique identifier for the file. Example: file-0SY0lLXWCSSBIOb2gu8UolxH
    - `tools` Tool[], required: An array of tool objects specifying tools to be used with the file. Example: [{ "type": "file_search" }]
      - `type` string, required: The type of tool to be used. Example: file_search
  - `additionalInstructions` string, nullable: Appends additional instructions at the end of the agent's instructions for the run. Useful for modifying behavior per-run. Example: "User name: John Smith"
  - `aliasChatId` string, nullable: An alternative to chatId which allows using custom identifiers for persisting chats through third party integrations. Example: "custom-identifier"

## Response `200`

Successful response. The format varies depending on the `textOnly` mode configured for the API Integration. If `textOnly` is enabled, the response is plain text. Otherwise, it's application/json.

- GetResponseResponse: Response body for the /get_response endpoint when textOnly mode is disabled.
  - `chatId` string: The unique identifier for the chat session. Example: "FVfA971B3fnBH4S1OKlo"
  - `createdAt` string, date-time: The timestamp when the response was created (ISO 8601 format). Example: "2024-08-06T02:02:37.533913"
  - `threadId` string: The unique identifier for the underlying thread. Example: "thread_ruUj69CyW2STm8Zog0HXkvIJ"
  - `assistantId` string: The unique identifier for the assistant that responded. Example: "J3NQwdHxqm9jvWFpOwFk"
  - `name` string: The name of the API integration used. Example: "Test API Integration"
  - `message` Message: Object representing a message within the chat.
    - `id` string: The unique identifier for the message. Example: "msg_nH4zWgFW7dCUoNQ5msLJNBUd"
    - `content` string: The content of the message. Example: "The secret phrase is: **papaya tangerine**."
    - `role` string: The role of the message sender (e.g., 'assistant', 'user'). Example: "assistant"
    - `type` string: The type of message (e.g., 'text'). Example: "text"
    - `createdAt` string, date-time: The timestamp when the message was created (ISO 8601 format). Example: "2024-08-06T02:02:37.533913"
    - `references` string[]: An array of references associated with the message.
    - `fileIds` string[]: An array of file IDs associated with the message. Example: ["file-wRZy12uetHH9dVEpR6PhE92j"]
    - `assistantData` object, nullable: Additional assistant-related data.
    - `functions` object, nullable: Additional function-related data.
  - `numMessages` integer: The total number of messages in the chat thread. Example: 2
  - `aliasChatId` string: Alternative chat identifier used for persisting chats through third party integrations. Example: "r14ud3CyX21Tm8Zog0HKJkvZJ"

## Other responses

- `400`: Bad Request. Occurs if the request body is missing required fields or the JSON payload is malformed.
- `401`: Unauthorized. Occurs if the Authorization header is missing or contains an invalid token.
- `500`: Internal Server Error. Occurs if there is an issue on the server side while processing the request.

---

[API](https://skmtc.dev/agency-swarm/apis/agencii-platform-api.md) - [All operations](https://skmtc.dev/agency-swarm/apis/agencii-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agency-swarm/apis/agencii-platform-api/revisions/d9ab31b0307f?raw)
