メインコンテンツまでスキップ
バージョン: 🚧 Canary

📐 Chat schemas

Schemas define the public Chat request contracts. Each source export has a field-level summary and the complete source definition. In field tables, Body means the application/json request body declared by the exported schema.

Inventory

ExportRequest locationContract
channelIdPathParameterPathRequired string channelId.
ChatChannelIconN/AStored icon metadata: objectId and MIME type.
channelIdQueryParameterQueryRequired string channelId.
chatChannelSchemaN/AClosed object with optional name, ownerId, and nullable icon.
createChatChannelSchemaBodyRequired name and ownerId; optional nullable icon.
updateChatChannelSchemaPath, bodyRequired channelId; body permits optional name and nullable icon.
getChatChannelSchemaPathRequired channelId.
deleteChatChannelSchemaPathRequired channelId.
findChatChannelsSchemaQueryOptional name, ownerId, and shared pagination fields.
getChannelMessagesSchemaPath, QueryRequired channelId and optional shared pagination fields.
chatMessageSchemaN/AClosed object with optional content, senderId, and title.
createChatMessageAttachmentSchemaBodyRequired UUID objectId and string type.
ChatMessageAttachmentN/AStored attachment metadata: objectId and type.
NormalizedChatMessageAttachmentN/APublic attachment shape: signed url and type.
createChatMessageSchemaBodyRequired content, senderId, and channelId; optional title.
updateChatMessageSchemaPath, bodyRequired messageId; optional content, senderId, and title.
getChatMessageSchemaPathRequired messageId.
deleteChatMessageSchemaPathRequired messageId.
findChatMessagesSchemaQueryRequired channelId; optional message filters and pagination.
deleteChatMessageAttachmentSchemaPathRequired messageId and attachmentId.
streamChatMessagesSchemaQueryRequired channelId.
chatMessageTemplateSchemaN/AClosed object with optional string content and title.
createChatMessageTemplateSchemaBodyRequired content and title; optional organizationId.
getChatMessageTemplateSchemaPathRequired messageTemplateId.
updateChatMessageTemplateSchemaPath, bodyRequired template ID; optional content and title.
deleteChatMessageTemplateSchemaPathRequired messageTemplateId.
findChatMessageTemplatesSchemaQueryShared pagination fields only.
findChatMessageTemplatesForOrganizationSchemaPath, QueryRequired organizationId and shared pagination fields.
chatChannelReadStateSchemaN/AClosed object with identityId and lastReadMessageId fields.
upsertChatChannelReadStateSchemaPath, bodyRequired channelId, identityId, and lastReadMessageId.
chatSubscriptionSchemaN/AClosed subscription object with approval, channel, permissions, time, and identity fields.
createChatSubscriptionSchemaBodyRequired channelId and subscribedId; other subscription fields optional.
getChatSubscriptionSchemaPathRequired subscriptionId.
deleteChatSubscriptionSchemaPathRequired subscriptionId.
findChatSubscriptionsSchemaQueryOptional subscription filters and shared pagination fields.

Details

channelIdPathParameter

Definition

Required string channelId.

LocationFieldTypeRequiredConstraints
PathchannelIdString.Yes

Used by route: getChatChannelRoute, updateChatChannelRoute, deleteChatChannelRoute, getChannelMessagesRoute, and upsertChatChannelReadStateRoute. Used by feature: getChannelFeature, updateChannelFeature, deleteChannelFeature, getChannelMessagesFeature, and upsertChatChannelReadStateFeature.

View complete source
export const channelIdPathParameter: OpenAPIParameter = {
in: 'path',
name: 'channelId',
required: true,
schema: {
type: 'string',
},
};

const iconSchema: SchemaDefinition = {
additionalProperties: false,
properties: {
objectId: {format: 'uuid', type: 'string'},
type: {type: 'string'},
},
required: ['objectId', 'type'],
type: 'object',
};

ChatChannelIcon

Definition

Stored icon metadata: objectId and MIME type.

LocationFieldTypeRequiredConstraints
N/AobjectIdString; the request schema requires UUID format.Yes
N/AtypeString, normally a MIME type.Yes

Used by route: Its JSON Schema counterpart is accepted by createChatChannelRoute and updateChatChannelRoute. Used by feature: createChannelFeature and updateChannelFeature.

View complete source
export type ChatChannelIcon = {
objectId: string;
type: string;
};

channelIdQueryParameter

Definition

Required string channelId.

LocationFieldTypeRequiredConstraints
QuerychannelIdString.Yes

Used by route: streamChatMessagesRoute. Used by feature: streamChatMessagesFeature.

View complete source
export const channelIdQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'channelId',
required: true,
schema: {
type: 'string',
},
};

chatChannelSchema

Definition

Closed object with optional name, ownerId, and nullable icon.

LocationFieldTypeRequiredConstraints
N/Aiconnull or closed { objectId: UUID string, type: string }.No
N/AnameString.No
N/AownerIdString.No

Used by route: Spread into createChatChannelSchema. Used by feature: createChannelFeature; the update schema duplicates the permitted update subset.

View complete source
export const chatChannelSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
icon: {
oneOf: [iconSchema, {type: 'null'}],
},
name: {type: 'string'},
ownerId: {type: 'string'},
},
type: 'object',
};

createChatChannelSchema

Definition

Required name and ownerId; optional nullable icon.

LocationFieldTypeRequiredConstraints
BodynameString.Yes
BodyownerIdString.Yes
Bodyiconnull or closed { objectId: UUID string, type: string }.No

Used by route: createChatChannelRoute via createChannelFeature

Used by feature: createChannelFeature

View complete source
export const createChatChannelSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatChannelSchema,
required: ['name', 'ownerId'],
},
},
},
required: true,
},
});

updateChatChannelSchema

Definition

Required channelId; body permits optional name and nullable icon.

LocationFieldTypeRequiredConstraints
PathchannelIdString.Yes
BodynameString.No
Bodyiconnull or closed { objectId: UUID string, type: string }.No

Used by route: updateChatChannelRoute via updateChannelFeature

Used by feature: updateChannelFeature

View complete source
export const updateChatChannelSchema = withSchema({
parameters: [{...channelIdPathParameter}],
requestBody: {
content: {
'application/json': {
schema: {
additionalProperties: false,
properties: {
icon: {
oneOf: [iconSchema, {type: 'null'}],
},
name: {type: 'string'},
},
required: [],
type: 'object',
},
},
},
required: true,
},
});

getChatChannelSchema

Definition

Required channelId.

LocationFieldTypeRequiredConstraints
PathchannelIdString.Yes

Used by route: getChatChannelRoute via getChannelFeature

Used by feature: getChannelFeature

View complete source
export const getChatChannelSchema = withSchema({
parameters: [{...channelIdPathParameter}],
});

deleteChatChannelSchema

Definition

Required channelId.

LocationFieldTypeRequiredConstraints
PathchannelIdString.Yes

Used by route: deleteChatChannelRoute via deleteChannelFeature

Used by feature: deleteChannelFeature

View complete source
export const deleteChatChannelSchema = withSchema({
parameters: [{...channelIdPathParameter}],
});

findChatChannelsSchema

Definition

Optional name, ownerId, and shared pagination fields.

LocationFieldTypeRequiredConstraints
QuerynameString filter.No
QueryownerIdString filter.No
QueryShared pagination fieldsSee paginationQueryParametersSchema.No

Used by route: findChatChannelsRoute via findChannelsFeature

Used by feature: findChannelsFeature

View complete source
export const findChatChannelsSchema = withSchema({
parameters: [
{
in: 'query',
name: 'name',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'ownerId',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

getChannelMessagesSchema

Definition

Required channelId and optional shared pagination fields.

LocationFieldTypeRequiredConstraints
PathchannelIdString.Yes
QueryShared pagination fieldsSee paginationQueryParametersSchema.No

Used by route: getChannelMessagesRoute via getChannelMessagesFeature

Used by feature: getChannelMessagesFeature

View complete source
export const getChannelMessagesSchema = withSchema({
parameters: [channelIdPathParameter, ...paginationQueryParametersSchema],
});

chatMessageSchema

Definition

Closed object with optional content, senderId, and title.

LocationFieldTypeRequiredConstraints
N/AcontentString.No
N/AsenderIdString.No
N/AtitleString.No

Used by route: Spread into createChatMessageSchema and updateChatMessageSchema. Used by feature: createChatMessageFeature and updateChatMessageFeature.

View complete source
export const chatMessageSchema = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
content: {type: 'string'},
senderId: {type: 'string'},
title: {type: 'string'},
},
type: 'object',
} as const satisfies SchemaDefinition;

createChatMessageAttachmentSchema

Definition

Required UUID objectId and string type.

LocationFieldTypeRequiredConstraints
BodyobjectIdUUID-formatted string.Yes
BodytypeString.Yes

Used by route: createChatMessageAttachmentRoute via createChatMessageAttachmentFeature

Used by feature: createChatMessageAttachmentFeature

View complete source
export const createChatMessageAttachmentSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageAttachmentSchema,
required: ['objectId', 'type'],
},
},
},
required: true,
},
});

ChatMessageAttachment

Definition

Stored attachment metadata: objectId and type.

LocationFieldTypeRequiredConstraints
N/AobjectIdString.Yes
N/AtypeString.Yes

Used by route: createChatMessageAttachmentRoute persists this shape; message create/get/list/update routes consume it during normalization, and deleteChatMessageAttachmentRoute removes it. Used by feature: createChatMessageAttachmentFeature.

View complete source
export type ChatMessageAttachment = {
objectId: string;
type: string;
};

NormalizedChatMessageAttachment

Definition

Public attachment shape: signed url and type.

LocationFieldTypeRequiredConstraints
N/AurlSigned download URL string.Yes
N/AtypeString.Yes

Used by route: createChatMessageRoute, getChatMessageRoute, findChatMessagesRoute, updateChatMessageRoute, and createChatMessageAttachmentRoute expose this normalized shape. Used by feature: createChatMessageFeature, getChatMessageFeature, findChatMessagesFeature, updateChatMessageFeature, and createChatMessageAttachmentFeature.

View complete source
export type NormalizedChatMessageAttachment = {
url: string;
type: string;
};

createChatMessageSchema

Definition

Required content, senderId, and channelId; optional title.

LocationFieldTypeRequiredConstraints
BodycontentString.Yes
BodysenderIdString.Yes
BodychannelIdString.Yes
BodytitleString.No

Used by route: createChatMessageRoute via createChatMessageFeature

Used by feature: createChatMessageFeature

View complete source
export const createChatMessageSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageSchema,
properties: {
...chatMessageSchema.properties,
channelId: {type: 'string'},
},
required: ['content', 'senderId', 'channelId'],
},
},
},
required: true,
},
});

updateChatMessageSchema

Definition

Required messageId; optional content, senderId, and title.

LocationFieldTypeRequiredConstraints
PathmessageIdString.Yes
BodycontentString.No
BodysenderIdString.No
BodytitleString.No

Used by route: updateChatMessageRoute via updateChatMessageFeature

Used by feature: updateChatMessageFeature

View complete source
export const updateChatMessageSchema = withSchema({
parameters: [{...messageIdPathParameter}],
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageSchema,
required: [],
},
},
},
required: true,
},
});

getChatMessageSchema

Definition

Required messageId.

LocationFieldTypeRequiredConstraints
PathmessageIdString.Yes

Used by route: getChatMessageRoute via getChatMessageFeature

Used by feature: getChatMessageFeature

View complete source
export const getChatMessageSchema = withSchema({
parameters: [{...messageIdPathParameter}],
});

deleteChatMessageSchema

Definition

Required messageId.

LocationFieldTypeRequiredConstraints
PathmessageIdString.Yes

Used by route: deleteChatMessageRoute via deleteChatMessageFeature

Used by feature: deleteChatMessageFeature

View complete source
export const deleteChatMessageSchema = withSchema({
parameters: [{...messageIdPathParameter}],
});

findChatMessagesSchema

Definition

Required channelId; optional message filters and pagination.

LocationFieldTypeRequiredConstraints
QuerychannelIdString.Yes
QuerycontentString filter.No
QuerysenderIdString filter.No
QuerytitleString filter.No
QueryShared pagination fieldsSee paginationQueryParametersSchema.No

Used by route: findChatMessagesRoute via findChatMessagesFeature

Used by feature: findChatMessagesFeature

View complete source
export const findChatMessagesSchema = withSchema({
parameters: [
{
in: 'query',
name: 'channelId',
required: true,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'content',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'senderId',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'title',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

deleteChatMessageAttachmentSchema

Definition

Required messageId and attachmentId.

LocationFieldTypeRequiredConstraints
PathmessageIdString.Yes
PathattachmentIdString.Yes

Used by route: deleteChatMessageAttachmentRoute via deleteChatMessageAttachmentFeature

Used by feature: deleteChatMessageAttachmentFeature

View complete source
export const deleteChatMessageAttachmentSchema = withSchema({
parameters: [{...messageIdPathParameter}, {...attachmentIdPathParameter}],
});

streamChatMessagesSchema

Definition

Required channelId.

LocationFieldTypeRequiredConstraints
QuerychannelIdString.Yes

Used by route: streamChatMessagesRoute via streamChatMessagesFeature

Used by feature: streamChatMessagesFeature

View complete source
export const streamChatMessagesSchema = withSchema({
parameters: [channelIdQueryParameter],
});

chatMessageTemplateSchema

Definition

Closed object with optional string content and title.

LocationFieldTypeRequiredConstraints
N/AcontentString.No
N/AtitleString.No

Used by route: Spread into createChatMessageTemplateSchema and updateChatMessageTemplateSchema. Used by feature: createChatMessageTemplateFeature and updateChatMessageTemplateFeature.

View complete source
export const chatMessageTemplateSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
content: {type: 'string'},
title: {type: 'string'},
},
type: 'object',
};

createChatMessageTemplateSchema

Definition

Required content and title; optional organizationId.

LocationFieldTypeRequiredConstraints
BodycontentString.Yes
BodytitleString.Yes
BodyorganizationIdString.No

Used by route: createChatMessageTemplateRoute via createChatMessageTemplateFeature

Used by feature: createChatMessageTemplateFeature

View complete source
export const createChatMessageTemplateSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageTemplateSchema,
properties: {
...chatMessageTemplateSchema.properties,
organizationId: {type: 'string'},
},
required: ['content', 'title'],
},
},
},
required: true,
},
});

getChatMessageTemplateSchema

Definition

Required messageTemplateId.

LocationFieldTypeRequiredConstraints
PathmessageTemplateIdString.Yes

Used by route: getChatMessageTemplateRoute via getChatMessageTemplateFeature

Used by feature: getChatMessageTemplateFeature

View complete source
export const getChatMessageTemplateSchema = withSchema({
parameters: [messageTemplateIdPathParameter],
});

updateChatMessageTemplateSchema

Definition

Required template ID; optional content and title.

LocationFieldTypeRequiredConstraints
PathmessageTemplateIdString.Yes
BodycontentString.No
BodytitleString.No

Used by route: updateChatMessageTemplateRoute via updateChatMessageTemplateFeature

Used by feature: updateChatMessageTemplateFeature

View complete source
export const updateChatMessageTemplateSchema = withSchema({
parameters: [messageTemplateIdPathParameter],
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageTemplateSchema,
required: [],
},
},
},
required: true,
},
});

deleteChatMessageTemplateSchema

Definition

Required messageTemplateId.

LocationFieldTypeRequiredConstraints
PathmessageTemplateIdString.Yes

Used by route: deleteChatMessageTemplateRoute via deleteChatMessageTemplateFeature

Used by feature: deleteChatMessageTemplateFeature

View complete source
export const deleteChatMessageTemplateSchema = withSchema({
parameters: [messageTemplateIdPathParameter],
});

findChatMessageTemplatesSchema

Definition

Shared pagination fields only.

LocationFieldTypeRequiredConstraints
QueryShared pagination fieldsSee paginationQueryParametersSchema.No

Used by route: findChatMessageTemplatesRoute via findChatMessageTemplatesFeature

Used by feature: findChatMessageTemplatesFeature

View complete source
export const findChatMessageTemplatesSchema = withSchema({
parameters: [...paginationQueryParametersSchema],
});

findChatMessageTemplatesForOrganizationSchema

Definition

Required organizationId and shared pagination fields.

LocationFieldTypeRequiredConstraints
QueryShared pagination fieldsSee paginationQueryParametersSchema.No
PathorganizationIdString.Yes

Used by route: findChatMessageTemplatesForOrganizationRoute via findChatMessageTemplatesForOrganizationFeature

Used by feature: findChatMessageTemplatesForOrganizationFeature

View complete source
export const findChatMessageTemplatesForOrganizationSchema = withSchema({
parameters: [
...paginationQueryParametersSchema,
{
in: 'path',
name: 'organizationId',
required: true,
schema: {
type: 'string',
},
},
],
});

chatChannelReadStateSchema

Definition

Closed object with identityId and lastReadMessageId fields.

LocationFieldTypeRequiredConstraints
N/AidentityIdString; request composition makes it required.No
N/AlastReadMessageIdString; request composition makes it required.No

Used by route: Spread into upsertChatChannelReadStateSchema. Used by feature: upsertChatChannelReadStateFeature.

View complete source
export const chatChannelReadStateSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
identityId: {type: 'string'},
lastReadMessageId: {type: 'string'},
},
type: 'object',
};

upsertChatChannelReadStateSchema

Definition

Required channelId, identityId, and lastReadMessageId.

LocationFieldTypeRequiredConstraints
PathchannelIdString.Yes
BodyidentityIdString.Yes
BodylastReadMessageIdString.Yes

Used by route: upsertChatChannelReadStateRoute via upsertChatChannelReadStateFeature

Used by feature: upsertChatChannelReadStateFeature

View complete source
export const upsertChatChannelReadStateSchema = withSchema({
parameters: [{...channelIdPathParameter}],
requestBody: {
content: {
'application/json': {
schema: {
...chatChannelReadStateSchema,
required: ['identityId', 'lastReadMessageId'],
},
},
},
required: true,
},
});

chatSubscriptionSchema

Definition

Closed subscription object with approval, channel, permissions, time, and identity fields.

LocationFieldTypeRequiredConstraints
N/AapprovedBoolean.No
N/AchannelIdString.No
N/ApermissionsArray of strings.No
N/AsubscribedAtDate-time-formatted string.No
N/AsubscribedIdString.No

Used by route: Spread into createChatSubscriptionSchema. Used by feature: createChatSubscriptionFeature.

View complete source
export const chatSubscriptionSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
approved: {type: 'boolean'},
channelId: {type: 'string'},
permissions: {items: {type: 'string'}, type: 'array'},
subscribedAt: {format: 'date-time', type: 'string'},
subscribedId: {type: 'string'},
},
type: 'object',
};

createChatSubscriptionSchema

Definition

Required channelId and subscribedId; other subscription fields optional.

LocationFieldTypeRequiredConstraints
BodyapprovedBoolean.No
BodychannelIdString.Yes
BodypermissionsArray of strings.No
BodysubscribedAtDate-time-formatted string.No
BodysubscribedIdString.Yes

Used by route: createChatSubscriptionRoute via createChatSubscriptionFeature

Used by feature: createChatSubscriptionFeature

View complete source
export const createChatSubscriptionSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatSubscriptionSchema,
required: ['channelId', 'subscribedId'],
},
},
},
required: true,
},
});

getChatSubscriptionSchema

Definition

Required subscriptionId.

LocationFieldTypeRequiredConstraints
PathsubscriptionIdString.Yes

Used by route: getChatSubscriptionRoute via getChatSubscriptionFeature

Used by feature: getChatSubscriptionFeature

View complete source
export const getChatSubscriptionSchema = withSchema({
parameters: [{...subscriptionIdPathParameter}],
});

deleteChatSubscriptionSchema

Definition

Required subscriptionId.

LocationFieldTypeRequiredConstraints
PathsubscriptionIdString.Yes

Used by route: deleteChatSubscriptionRoute via deleteChatSubscriptionFeature

Used by feature: deleteChatSubscriptionFeature

View complete source
export const deleteChatSubscriptionSchema = withSchema({
parameters: [{...subscriptionIdPathParameter}],
});

findChatSubscriptionsSchema

Definition

Optional subscription filters and shared pagination fields.

LocationFieldTypeRequiredConstraints
QueryapprovedBoolean filter.No
QuerychannelIdString filter.No
QuerysubscribedAtDate-time-formatted string filter.No
QuerysubscribedIdString filter.No
QueryShared pagination fieldsSee paginationQueryParametersSchema.No

Used by route: findChatSubscriptionsRoute via findChatSubscriptionsFeature

Used by feature: findChatSubscriptionsFeature

View complete source
export const findChatSubscriptionsSchema = withSchema({
parameters: [
{
in: 'query',
name: 'approved',
required: false,
schema: {
type: 'boolean',
},
},
{
in: 'query',
name: 'channelId',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'subscribedAt',
required: false,
schema: {
format: 'date-time',
type: 'string',
},
},
{
in: 'query',
name: 'subscribedId',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});