---
title: "Initializes a new conversation with the necessary setup by creating and configuring the required resources for interaction."
method: GET
path: "/aiagents/locations/{locationId}/InitConversation"
tags: ["AIAgents"]
---

# Initializes a new conversation with the necessary setup by creating and configuring the required resources for interaction.

`GET /aiagents/locations/{locationId}/InitConversation`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/aiagents/locations/{locationId}/InitConversation`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/aiagents/locations/:locationId/InitConversation/get.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `locationId` integer, required

## Query parameters

- `setupId` integer

## Response `200`

Request succeeded and the requested information is in the response.

- ServiceChannelServicesMessagingAzureOpenAIAssistantChatSessionModel
  - `AssistantId` string
  - `ThreadId` string: OpenAi thread identifier for the conversation
  - `ClientSessionId` string: Client-generated session identifier used by the WO Core team as TargetId.

## Other responses

- `400`: Access denied. <br>Error codes: 1000 - The setupId does not belong to the Subscriber;
- `401`: Indicates that the requested resource requires authentication. <br>Error codes: 504 - API call rejected by security permissions;
- `403`: You are not authorized to request this resource, or the resource is unavailable for some reason. <br/>Error codes: 100 — User has no rights to perform this action.
- `500`: The server was unable to complete the request due to an internal error. <br/>Error codes: 501 - Unspecified internal server error occurred

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
