---
title: "Create AI Conversation"
method: POST
path: "/ai-conversation"
tags: ["AI Conversation"]
---

# Create AI Conversation

`POST /ai-conversation`

## Request

- Base URL: `https://oneuptime.com/api`
- URL: `https://oneuptime.com/api/ai-conversation`
- Auth: API key in header `APIKey`
- TypeScript: <https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/docs/ai-conversation/post.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to create a new AI Conversation

## Request body

- object
  - `data` AIConversationCreateSchema, required: Create schema for AIConversation model. Create
    - `projectId` string, uuid: ID of the project this conversation belongs to. Permissions - Create: [Project Owner, Project Admin, Project Member], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]

## Response `201`

Created successfully

- object
  - `data` AIConversationReadSchema: Read schema for AIConversation model. Read
    - `_id` string, uuid: ID of this object. Permissions - Create: [Project Owner, Project Admin, Project Member], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `createdAt` object: Date and Time when the object was created. Permissions - Create: [Project Owner, Project Admin, Project Member], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `updatedAt` object: Date and Time when the object was updated. Permissions - Create: [Project Owner, Project Admin, Project Member], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `deletedAt` object: Date and Time when the object was deleted. Permissions - Create: [Project Owner, Project Admin, Project Member], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `projectId` string, uuid: ID of the project this conversation belongs to. Permissions - Create: [Project Owner, Project Admin, Project Member], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `title` string: Title of the conversation. Generated from the first message. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `lastMessageAt` object: When the last message in this conversation was sent. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `llmProviderId` string, uuid: The LLM provider selected for this conversation. If empty, the project default (or global) provider is used. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `permissionMode` string: How the agent is allowed to run mutating tools: AskForApproval, AutoRun or ReadOnly. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `pageContext` object: The dashboard page (entity) this conversation is about. Set from the first message that carried a page context. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `incidentId` string, uuid: ID of the incident whose investigation box this shared conversation belongs to. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `alertId` string, uuid: ID of the alert whose investigation box this shared conversation belongs to. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]
    - `createdByUserId` string, uuid: User ID who created this conversation. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member], Update: [No access - you don't have permission for this operation]

## Other responses

- `400`: Bad request. This response indicates that the request was malformed or contained invalid data.
- `401`: Unauthorized. This response indicates that the request requires user authentication.
- `402`: Payment Required. This response indicates that the request requires payment or a valid subscription.
- `403`: Forbidden. This response indicates that the server understood the request, but refuses to authorize it.
- `405`: Project not found. This response indicates that the requested project does not exist or is not accessible.
- `408`: Request Timeout. This response indicates that the server timed out waiting for the request.
- `415`: Unable to reach server. This response indicates that the server is currently unreachable or down.
- `422`: Not authorized. This response indicates that the user does not have permission to access the requested resource.
- `500`: Internal Server Error. This response indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

---

[API](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification.md) - [All operations](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/revisions/ba3307d00304?raw)
