---
title: "Create new chat"
method: POST
path: "/create_new_chat"
---

# Create new chat

`POST /create_new_chat`

## Request

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

Creates a new chat instance for a user based on a provided API integration. Requires a valid platform token in the headers for authentication. Ensure the apiIntegrationId corresponds to an existing integration.

## Request body

- CreateNewChatRequest: Request body for the /create_new_chat endpoint.
  - `apiIntegrationId` string, required: The unique identifier of the API integration for which to create the chat. Example: "dpCD7snQ0tCWrdtp6UhZ"

## Response `200`

Chat created successfully. Returns the unique chatId for the new chat.

- CreateNewChatResponse: Response body for the /create_new_chat endpoint.
  - `chatId` string: The unique identifier for the newly created chat. Example: "FVfA971B3fnBH4S1OKlo"

## 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)
