openapi: 3.2.0 info: title: Connecteam API documentation Chat:v1:Conversations API version: v1 servers: - url: https://api.connecteam.com/ tags: - name: Chat:v1:Conversations paths: /chat/v1/conversations: post: tags: - Chat:v1:Conversations summary: Create conversation description: 'Creates a team chat or channel as the authenticated user. Members are assigned via userIds (individual users) and/or smartGroupIds (dynamic cohorts) - at least one assignment is required. Use type: "team" for a collaborative chat where members can send messages, or type: "channel" for a broadcast group where only admins post. A custom publisher can subsequently post into the created group via POST /chat/v1/conversations/{conversationId}/message.' operationId: create_conversation_chat_v1_conversations_post security: - APIKeyHeader: [] - OAuth2: - chat.write requestBody: content: application/json: schema: title: Request allOf: - $ref: '#/components/schemas/ConversationMutationRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/APIResponse_ConversationMutationResponse_' '404': description: Conversation could not be resolved after creation content: application/json: example: error: Conversation b7e2c1a4-8f3d-4c9a-a1b2-3c4d5e6f7a8b not found path: /chat/v1/conversations request_id: 550e8400-e29b-41d4-a716-446655440000 schema: $ref: '#/components/schemas/ValidationErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - Chat:v1:Conversations summary: Get conversations description: Retrieves a list of team chats and/or channels associated with the account. The list excludes private conversations. operationId: get_conversations_chat_v1_conversations_get security: - APIKeyHeader: [] - OAuth2: - chat.read parameters: - name: limit in: query required: false schema: title: Limit description: The maximum number of results to display per page default: 10 minimum: 1 maximum: 100 type: integer description: The maximum number of results to display per page - name: offset in: query required: false schema: title: Offset description: The resource offset of the last successfully read resource will be returned as the paging.offset JSON property of a paginated response containing more results default: 0 minimum: 0 type: integer description: The resource offset of the last successfully read resource will be returned as the paging.offset JSON property of a paginated response containing more results responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PaginatedBaseResponse_ConversationsResponse_' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /chat/v1/conversations/{conversationId}/message: post: tags: - Chat:v1:Conversations summary: Send message description: Sends a new message to a specific chat, whether it’s channel or a team chat operationId: send_message_to_conversation_chat_v1_conversations__conversationId__message_post security: - APIKeyHeader: [] - OAuth2: - chat.write parameters: - name: conversationId in: path required: true schema: title: Conversationid description: The unique identifier of the conversation type: string description: The unique identifier of the conversation requestBody: content: application/json: schema: title: Request allOf: - $ref: '#/components/schemas/ConversationPostMessageRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/APIResponse_BaseResponse_' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /chat/v1/conversations/privateMessage/{userId}: post: tags: - Chat:v1:Conversations summary: Send private message description: Send a private message to a specified user within the account. The sender will be a custom publisher. If a conversation between the custom publisher and the addressed user already exists, it will send the message to the same conversation, if not, it will create a new conversation with the specified user. operationId: send_message_to_private_conversation_chat_v1_conversations_privateMessage__userId__post security: - APIKeyHeader: [] - OAuth2: - chat.write parameters: - name: userId in: path required: true schema: title: Userid description: The unique identifier of the user type: integer description: The unique identifier of the user requestBody: content: application/json: schema: title: Request allOf: - $ref: '#/components/schemas/ConversationPostMessageRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/APIResponse_BaseResponse_' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError ImageAttachmentRequest: properties: type: type: string enum: - image title: Type description: The type of the attachment. fileId: type: string title: Fileid description: The unique identifier of the image. type: object required: - type - fileId title: ImageAttachmentRequest ConversationMutationResponse: properties: conversation: allOf: - $ref: '#/components/schemas/ConversationDetailsResponse' title: Conversation description: The created or updated conversation type: object required: - conversation title: ConversationMutationResponse ConversationDetailsResponse: properties: id: type: string title: Id description: The unique identifier of the conversation. Use for sending messages and follow-up calls. title: type: string title: Title description: The conversation title type: allOf: - $ref: '#/components/schemas/ConversationType' description: The conversation type (team or channel) assignedUserIds: items: type: integer type: array title: Assigneduserids description: Individual user IDs assigned to the conversation assignedSmartGroupIds: items: type: integer type: array title: Assignedsmartgroupids description: Smart group IDs assigned to the conversation adminUserIds: items: type: integer type: array title: Adminuserids description: User IDs with admin privileges in the conversation isLocked: type: boolean title: Islocked description: Whether the conversation is locked isMembersHidden: type: boolean title: Ismembershidden description: Whether the member list is hidden default: false description: items: type: object type: array title: Description description: Structured conversation description blocks type: object required: - id - title - type - assignedUserIds - assignedSmartGroupIds - adminUserIds title: ConversationDetailsResponse FileAttachmentRequest: properties: type: type: string enum: - file title: Type description: The type of the attachment. fileId: type: string title: Fileid description: The unique identifier of the file. type: object required: - type - fileId title: FileAttachmentRequest APIResponse_ConversationMutationResponse_: properties: requestId: type: string title: Requestid data: $ref: '#/components/schemas/ConversationMutationResponse' type: object required: - data title: APIResponse[ConversationMutationResponse] ValidationErrorResponse: properties: details: allOf: - $ref: '#/components/schemas/ErrorParing' title: Details default: error_message: Request is invalid error_code: 1004 error: anyOf: - type: object - items: type: object type: array - type: string title: Error default: Validation Error path: type: string title: Path requestId: type: string title: Requestid type: object title: ValidationErrorResponse description: "All errors responses should include:\nrequest_id,\nConnecteam error code and error message,\nthe url path,\nthe request body,\nand error data which can be a pydantic class or a dict and should look something like this:\n`{\n \"error.path\": \"the gist of the error\"\n}`\n\nfor example if the user doesn't exist it should look something like this:\n`{\n \"user.id\": \"user doesn't exist\"\n}`" ConversationType: type: string enum: - team - channel title: ConversationType description: An enumeration. APIResponse_BaseResponse_: properties: requestId: type: string title: Requestid data: $ref: '#/components/schemas/BaseResponse' type: object required: - data title: APIResponse[BaseResponse] PagingResponseModel: properties: offset: type: integer minimum: 0.0 title: Offset description: The resource offset of the last successfully read resource will be returned as the paging.offset JSON property of a paginated response containing more results total: type: integer minimum: 0.0 title: Total description: Total number of resources matching the request, ignoring pagination. Use this to retrieve the full count without paginating through every page. Only populated by endpoints that compute it. type: object required: - offset title: PagingResponseModel PaginatedBaseResponse_ConversationsResponse_: properties: requestId: type: string title: Requestid data: $ref: '#/components/schemas/ConversationsResponse' paging: $ref: '#/components/schemas/PagingResponseModel' type: object required: - data - paging title: PaginatedBaseResponse[ConversationsResponse] ConversationsResponse: properties: conversations: items: $ref: '#/components/schemas/ConversationResponse' type: array title: Conversations description: The list of conversations type: object required: - conversations title: ConversationsResponse ErrorParing: properties: error_message: type: string title: Error Message error_code: type: integer title: Error Code type: object required: - error_message - error_code title: ErrorParing description: V1 error paring model for backward compatibility ConversationTypeResponse: enum: - team - channel title: ConversationTypeResponse description: An enumeration. ConversationMutationRequest: properties: title: type: string title: Title description: The conversation title shown in the chat clients. Must be non-empty after trimming whitespace. type: allOf: - $ref: '#/components/schemas/ConversationType' description: The conversation type. team = collaborative chat, all members can send messages. channel = broadcast group, only admins can send messages. assignedUserIds: items: type: integer type: array title: Assigneduserids description: Individual user IDs assigned as members. At least one of assignedUserIds or assignedSmartGroupIds must be provided. Defaults to an empty array. assignedSmartGroupIds: items: type: integer type: array title: Assignedsmartgroupids description: Smart group (dynamic cohort) IDs assigned to the conversation. Membership follows the smart group's rules. At least one of assignedUserIds or assignedSmartGroupIds must be provided. Defaults to an empty array. adminUserIds: items: type: integer type: array title: Adminuserids description: User IDs granted admin privileges in the conversation (manage members/settings; for channels, the only users who can post). An admin id must also be an assigned member (via assignedUserIds or an assigned smart group) to take effect. If omitted, defaults are applied. isLocked: type: boolean title: Islocked description: Whether the conversation is created locked (members cannot send messages until an admin unlocks it). Defaults to unlocked. isMembersHidden: type: boolean title: Ismembershidden description: Whether the member list is hidden from members in the chat clients. Defaults to false. default: false description: items: type: object type: array title: Description description: Ordered list of structured rich-text blocks shown in the conversation details (not a chat message). Each block is a typed object, e.g. {"type":"html","html":"