Skip to content

Chats Endpoints

Chats API endpoints.


Overview

Method Endpoint Description
GET /api/v1/chats/ List Chats
GET /api/v1/chats/contexts/action-needed List Chat Contexts Needing Action
GET /api/v1/chats/contexts/{context_type}/messages/count Count Chat Messages For Contexts
POST /api/v1/chats/contexts/{context_type}/{context_id} Get Or Create Chat For Context
GET /api/v1/chats/{chat_id} Read Chat
POST /api/v1/chats/{chat_id}/messages Post Chat Message
GET /api/v1/chats/{chat_id}/messages List Chat Messages
DELETE /api/v1/chats/{chat_id}/messages/{message_id} Delete Chat Message
POST /api/v1/chats/{chat_id}/messages/{message_id}/notify-by-email Notify Chat Message By Email
POST /api/v1/chats/{chat_id}/messages/{message_id}/options/respond Respond To Chat Message Options
POST /api/v1/chats/{chat_id}/participants Add Chat Participant
DELETE /api/v1/chats/{chat_id}/participants/{user_id} Remove Chat Participant

API Reference

Sartiq Backend Server - Chats 0.1.0

chats


POST /api/v1/chats/contexts/{context_type}/{context_id}

Get Or Create Chat For Context

Description

Get-or-create the chat for a resource context (200 existing, 201 created).

POST — not GET — because it may create the chat on first request, which a safe/idempotent GET must never do (caches, prefetch, and retries would create rows). Auth + org membership are enforced by OrganizationDep.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
context_id path string No
context_type path No
organization_id query No
title query No

Responses

{
    "id": "8d6b629c-d8aa-4b38-b738-890c0fa5f5a3",
    "organization_id": "98b58215-0b5c-4a15-8c95-3cc9328468a1",
    "mode": "RESOURCE",
    "context_type": "SHOOTING",
    "context_id": "8d089b08-5d3c-45dc-9281-c34d76d3b484",
    "title": null,
    "participants": [
        {
            "id": "9496ce20-82c0-48b2-8c89-80754259e221",
            "chat_id": "a697e13f-2c4f-441d-a402-bff2ecd1c888",
            "user_id": "c1b08fc3-0f05-4ec4-9d1b-dfb7972d5122",
            "created_at": "2022-04-13T15:42:05.901Z"
        }
    ],
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "organization_id": {
            "type": "string",
            "format": "uuid",
            "title": "Organization Id"
        },
        "mode": {
            "$ref": "#/components/schemas/ChatMode"
        },
        "context_type": {
            "$ref": "#/components/schemas/ChatContextType"
        },
        "context_id": {
            "type": "string",
            "format": "uuid",
            "title": "Context Id"
        },
        "title": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Title"
        },
        "participants": {
            "items": {
                "$ref": "#/components/schemas/ChatParticipantPublic"
            },
            "type": "array",
            "title": "Participants"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "organization_id",
        "mode",
        "context_type",
        "context_id",
        "created_at",
        "updated_at"
    ],
    "title": "ChatPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/chats/

List Chats

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
context_id query No
context_type query No
limit query integer 100 No
organization_id query No
skip query integer 0 No

Responses

{
    "data": [
        {
            "id": "c01f2772-521d-496f-91eb-74871483cd4c",
            "organization_id": "eb480b1f-f587-421c-b9a7-6326a43796fa",
            "mode": "RESOURCE",
            "context_type": "SHOOTING",
            "context_id": "051eaebe-7cce-4819-ae7c-cb81b9ed027d",
            "title": null,
            "participants": [
                {
                    "id": "f628c730-9ea8-4f7a-8945-97197b334d6c",
                    "chat_id": "bee5e39d-580c-4a4f-bf68-80fa28e00cde",
                    "user_id": "3e1fc950-80fe-423e-b5bd-491193412981",
                    "created_at": "2022-04-13T15:42:05.901Z"
                }
            ],
            "created_at": "2022-04-13T15:42:05.901Z",
            "updated_at": "2022-04-13T15:42:05.901Z",
            "deleted_at": null
        }
    ],
    "count": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "data": {
            "items": {
                "$ref": "#/components/schemas/ChatPublic"
            },
            "type": "array",
            "title": "Data"
        },
        "count": {
            "type": "integer",
            "title": "Count"
        }
    },
    "type": "object",
    "required": [
        "data",
        "count"
    ],
    "title": "ChatsPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/chats/{chat_id}

Read Chat

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
chat_id path string No

Responses

{
    "id": "f5650183-29d9-4b3b-aafa-faee274b7011",
    "organization_id": "6c00dc00-0631-40bb-947f-9155e90237d5",
    "mode": "RESOURCE",
    "context_type": "SHOOTING",
    "context_id": "0f8af54d-e85c-4469-811c-d4516a74d9b5",
    "title": null,
    "participants": [
        {
            "id": "e61e9307-6625-4390-8356-b8fc1b82688b",
            "chat_id": "ca1f1808-101e-441a-8f7d-7d2281b05181",
            "user_id": "6dc60816-4448-4b43-879f-0ca5f32f359e",
            "created_at": "2022-04-13T15:42:05.901Z"
        }
    ],
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "organization_id": {
            "type": "string",
            "format": "uuid",
            "title": "Organization Id"
        },
        "mode": {
            "$ref": "#/components/schemas/ChatMode"
        },
        "context_type": {
            "$ref": "#/components/schemas/ChatContextType"
        },
        "context_id": {
            "type": "string",
            "format": "uuid",
            "title": "Context Id"
        },
        "title": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Title"
        },
        "participants": {
            "items": {
                "$ref": "#/components/schemas/ChatParticipantPublic"
            },
            "type": "array",
            "title": "Participants"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "organization_id",
        "mode",
        "context_type",
        "context_id",
        "created_at",
        "updated_at"
    ],
    "title": "ChatPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/chats/contexts/{context_type}/messages/count

Count Chat Messages For Contexts

Description

Batch-count messages for many contexts of one context_type.

Pass each id as a repeated context_id query parameter (1–200). The response has one entry per requested id (deduped, original order); a context with no chat yet — or whose chat lives in another org — counts 0. Org-gated by OrganizationDep; counts are reviewer-scoped to the private subset, mirroring list_chat_messages.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
context_id query array No
context_type path No
organization_id query No

Responses

{
    "data": [
        {
            "context_id": "1da67762-d7da-49ab-a270-882fe6302f32",
            "count": 0
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "data": {
            "items": {
                "$ref": "#/components/schemas/ChatContextMessageCount"
            },
            "type": "array",
            "title": "Data"
        }
    },
    "type": "object",
    "required": [
        "data"
    ],
    "title": "ChatContextMessageCounts",
    "description": "Batch message counts for several contexts of a single context type.\n\n``data`` has one entry per requested ``context_id`` (deduped, original order\npreserved), so a caller can map results back without cross-referencing."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/chats/contexts/action-needed

List Chat Contexts Needing Action

Description

Per-context-type counts of chats awaiting the caller's response.

A context "needs action" when its chat's last message the caller can see is within the [2 min, 2 days] age window AND was authored by a different role than the caller (a bot/system message counts only for REVIEWER callers). Reviewers' "last message" is the last private message, matching list_chat_messages. The response's top-level count is the grand total (a global badge); data keys each context_type to its group (the in-page, per-resource view). Org-gated by OrganizationDep; pass repeated context_type to narrow the scan (defaults to all types).

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
context_type query No
organization_id query No

Responses

{
    "count": 0,
    "data": {}
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "count": {
            "type": "integer",
            "title": "Count"
        },
        "data": {
            "additionalProperties": {
                "$ref": "#/components/schemas/ChatActionNeededGroup"
            },
            "propertyNames": {
                "$ref": "#/components/schemas/ChatContextType"
            },
            "type": "object",
            "title": "Data"
        }
    },
    "type": "object",
    "required": [
        "count",
        "data"
    ],
    "title": "ChatActionNeeded",
    "description": "Per-context-type breakdown of chats awaiting the caller's response.\n\n``count`` is the grand total across every scanned context type — the single\nnumber for a global badge. ``data`` maps each requested ``ChatContextType`` to\nits :class:`ChatActionNeededGroup` (the in-page, per-resource view); every\nrequested type is present, with an empty group when nothing needs action."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/chats/{chat_id}/messages

Post Chat Message

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
chat_id path string No

Request body

{
    "text": "string",
    "reply_to_id": null,
    "attachments": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "text": {
            "type": "string",
            "maxLength": 8192,
            "title": "Text",
            "default": ""
        },
        "reply_to_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Reply To Id"
        },
        "attachments": {
            "anyOf": [
                {
                    "items": {
                        "$ref": "#/components/schemas/MediaInput"
                    },
                    "type": "array"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Attachments"
        }
    },
    "type": "object",
    "title": "ChatMessageCreate"
}

Responses

{
    "id": "b9181c1d-096c-4202-afee-f5c86855f98c",
    "chat_id": "27c3a9fc-2cdd-4309-9e58-1f1697c4517b",
    "owner_id": null,
    "owner": null,
    "text": "string",
    "reply_to_id": null,
    "reply_to": null,
    "attachments": null,
    "options": null,
    "presentation": null,
    "email_notified_at": null,
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "chat_id": {
            "type": "string",
            "format": "uuid",
            "title": "Chat Id"
        },
        "owner_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Owner Id"
        },
        "owner": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/ChatMessageAuthor"
                },
                {
                    "type": "null"
                }
            ]
        },
        "text": {
            "type": "string",
            "title": "Text"
        },
        "reply_to_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Reply To Id"
        },
        "reply_to": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/ChatMessageReplyPreview"
                },
                {
                    "type": "null"
                }
            ]
        },
        "attachments": {
            "anyOf": [
                {
                    "items": {
                        "$ref": "#/components/schemas/MediaResourcePublic"
                    },
                    "type": "array"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Attachments"
        },
        "options": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/MessageOptions"
                },
                {
                    "type": "null"
                }
            ]
        },
        "presentation": {
            "anyOf": [
                {
                    "oneOf": [
                        {
                            "$ref": "#/components/schemas/LocationReferencePickerPresentation"
                        },
                        {
                            "$ref": "#/components/schemas/LocationModelPickerPresentation"
                        },
                        {
                            "$ref": "#/components/schemas/LocationProductPickerPresentation"
                        },
                        {
                            "$ref": "#/components/schemas/LocationVersionOneContractPresentation"
                        }
                    ],
                    "discriminator": {
                        "propertyName": "type",
                        "mapping": {
                            "location.model_picker": "#/components/schemas/LocationModelPickerPresentation",
                            "location.product_picker": "#/components/schemas/LocationProductPickerPresentation",
                            "location.reference_picker": "#/components/schemas/LocationReferencePickerPresentation",
                            "location.version_one_contract": "#/components/schemas/LocationVersionOneContractPresentation"
                        }
                    }
                },
                {
                    "$ref": "#/components/schemas/UnsupportedChatPresentation"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Presentation"
        },
        "email_notified_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email Notified At"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "chat_id",
        "text",
        "created_at",
        "updated_at"
    ],
    "title": "ChatMessagePublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/chats/{chat_id}/messages

List Chat Messages

Description

List messages newest-first within the page (data[-1] is the latest).

Keyset paginated: the first call (no before) returns the newest limit messages; follow next_cursor to walk back through history.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
before query No Opaque keyset cursor from a previous response's next_cursor; loads the page of older messages. Omit for the latest page.
chat_id path string No
limit query integer 100 No

Responses

{
    "data": [
        {
            "id": "95fb6569-389c-4ca8-8903-7962fd15597f",
            "chat_id": "81e97222-9c27-4da4-877d-a40c02bd62c3",
            "owner_id": null,
            "owner": null,
            "text": "string",
            "reply_to_id": null,
            "reply_to": null,
            "attachments": null,
            "options": null,
            "presentation": null,
            "email_notified_at": null,
            "created_at": "2022-04-13T15:42:05.901Z",
            "updated_at": "2022-04-13T15:42:05.901Z"
        }
    ],
    "count": 0,
    "next_cursor": null,
    "has_more": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "data": {
            "items": {
                "$ref": "#/components/schemas/ChatMessagePublic"
            },
            "type": "array",
            "title": "Data"
        },
        "count": {
            "type": "integer",
            "title": "Count"
        },
        "next_cursor": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Next Cursor"
        },
        "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
        }
    },
    "type": "object",
    "required": [
        "data",
        "count"
    ],
    "title": "ChatMessagesPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/chats/{chat_id}/messages/{message_id}/options/respond

Respond To Chat Message Options

Description

Press one or more options on a bot message (plan 033) → the updated, locked message.

Reviewer-only. 404 if the message / its options don't exist, 409 if already answered, 400 on an invalid selection (value not offered, or >1 on a single-select).

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
chat_id path string No
message_id path string No

Request body

{
    "values": [
        "95a9b425-a8f5-45ed-845e-c330a3fb58e2"
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "values": {
            "items": {
                "type": "string",
                "format": "uuid"
            },
            "type": "array",
            "title": "Values"
        }
    },
    "type": "object",
    "title": "MessageOptionsRespondRequest",
    "description": "Body for ``POST /chats/{chat_id}/messages/{message_id}/options/respond``.\n\n``values`` are the chosen item values (subject ids). Empty on a MULTI block =\n\"none selected\" (allowed); a SINGLE block requires ``len(values) <= 1``."
}

Responses

{
    "id": "08daf867-265b-48d1-b5f0-4a139841aec0",
    "chat_id": "0597b782-9865-49b9-8c73-de887d4c85c6",
    "owner_id": null,
    "owner": null,
    "text": "string",
    "reply_to_id": null,
    "reply_to": null,
    "attachments": null,
    "options": null,
    "presentation": null,
    "email_notified_at": null,
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "chat_id": {
            "type": "string",
            "format": "uuid",
            "title": "Chat Id"
        },
        "owner_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Owner Id"
        },
        "owner": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/ChatMessageAuthor"
                },
                {
                    "type": "null"
                }
            ]
        },
        "text": {
            "type": "string",
            "title": "Text"
        },
        "reply_to_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Reply To Id"
        },
        "reply_to": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/ChatMessageReplyPreview"
                },
                {
                    "type": "null"
                }
            ]
        },
        "attachments": {
            "anyOf": [
                {
                    "items": {
                        "$ref": "#/components/schemas/MediaResourcePublic"
                    },
                    "type": "array"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Attachments"
        },
        "options": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/MessageOptions"
                },
                {
                    "type": "null"
                }
            ]
        },
        "presentation": {
            "anyOf": [
                {
                    "oneOf": [
                        {
                            "$ref": "#/components/schemas/LocationReferencePickerPresentation"
                        },
                        {
                            "$ref": "#/components/schemas/LocationModelPickerPresentation"
                        },
                        {
                            "$ref": "#/components/schemas/LocationProductPickerPresentation"
                        },
                        {
                            "$ref": "#/components/schemas/LocationVersionOneContractPresentation"
                        }
                    ],
                    "discriminator": {
                        "propertyName": "type",
                        "mapping": {
                            "location.model_picker": "#/components/schemas/LocationModelPickerPresentation",
                            "location.product_picker": "#/components/schemas/LocationProductPickerPresentation",
                            "location.reference_picker": "#/components/schemas/LocationReferencePickerPresentation",
                            "location.version_one_contract": "#/components/schemas/LocationVersionOneContractPresentation"
                        }
                    }
                },
                {
                    "$ref": "#/components/schemas/UnsupportedChatPresentation"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Presentation"
        },
        "email_notified_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email Notified At"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "chat_id",
        "text",
        "created_at",
        "updated_at"
    ],
    "title": "ChatMessagePublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /api/v1/chats/{chat_id}/messages/{message_id}

Delete Chat Message

Description

Delete your own message within 5 minutes of posting.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
chat_id path string No
message_id path string No

Responses

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/chats/{chat_id}/messages/{message_id}/notify-by-email

Notify Chat Message By Email

Description

Email one of your own Location messages to the other side of the conversation.

Declared def, not async def, on purpose: send_email is blocking smtplib, so FastAPI runs this in the threadpool rather than stalling the event loop for the length of an SMTP handshake per recipient.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
chat_id path string No
message_id path string No

Responses

{
    "sent": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "sent": {
            "type": "integer",
            "title": "Sent"
        }
    },
    "type": "object",
    "required": [
        "sent"
    ],
    "title": "ChatMessageEmailNotificationPublic",
    "description": "Outcome of emailing a message to the other side of its Location.\n\nOnly the count: who sits on the other side is the server's call, and echoing\nthe addresses back would hand any member a roster of their counterparts.\n``sent == 0`` is a success with nobody to notify, not a failure."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/chats/{chat_id}/participants

Add Chat Participant

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
chat_id path string No

Request body

{
    "user_id": "200fb2e8-200d-4924-be48-911d761a6e07"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id"
        }
    },
    "type": "object",
    "required": [
        "user_id"
    ],
    "title": "ChatParticipantCreate"
}

Responses

{
    "id": "1246ddae-7e7e-437c-9324-b7486f76f058",
    "chat_id": "7065d58a-46de-4e8f-b7ed-d06b66cb31a2",
    "user_id": "282a2997-f06d-48fa-8f86-5a97ef1eb1bc",
    "created_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "chat_id": {
            "type": "string",
            "format": "uuid",
            "title": "Chat Id"
        },
        "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "chat_id",
        "user_id",
        "created_at"
    ],
    "title": "ChatParticipantPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /api/v1/chats/{chat_id}/participants/{user_id}

Remove Chat Participant

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
chat_id path string No
user_id path string No

Responses

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

Schemas

BodyType

Type: string

ChatActionNeeded

Name Type Description
count integer
data

ChatActionNeededGroup

Name Type Description
count integer
items Array<ChatActionNeededItem>

ChatActionNeededItem

Name Type Description
context_id string(uuid)
last_message_at string(date-time)

ChatContextMessageCount

Name Type Description
context_id string(uuid)
count integer

ChatContextMessageCounts

Name Type Description
data Array<ChatContextMessageCount>

ChatContextType

Type: string

ChatMessageAuthor

Name Type Description
full_name
id string(uuid)
role

ChatMessageCreate

Name Type Description
attachments
reply_to_id
text string

ChatMessageEmailNotificationPublic

Name Type Description
sent integer

ChatMessagePublic

Name Type Description
attachments
chat_id string(uuid)
created_at string(date-time)
email_notified_at
id string(uuid)
options
owner
owner_id
presentation
reply_to
reply_to_id
text string
updated_at string(date-time)

ChatMessageReplyPreview

Name Type Description
id string(uuid)
is_restricted boolean
is_unavailable boolean
owner
text

ChatMessagesPublic

Name Type Description
count integer
data Array<ChatMessagePublic>
has_more boolean
next_cursor

ChatMode

Type: string

ChatParticipantCreate

Name Type Description
user_id string(uuid)

ChatParticipantPublic

Name Type Description
chat_id string(uuid)
created_at string(date-time)
id string(uuid)
user_id string(uuid)

ChatPresentationStatus

Type: string

ChatPublic

Name Type Description
context_id string(uuid)
context_type ChatContextType
created_at string(date-time)
deleted_at
id string(uuid)
mode ChatMode
organization_id string(uuid)
participants Array<ChatParticipantPublic>
title
updated_at string(date-time)

ChatsPublic

Name Type Description
count integer
data Array<ChatPublic>

Gender

Type: string

HTTPValidationError

Name Type Description
detail Array<ValidationError>

LocationModelPickerParameters

Name Type Description
mode string

LocationModelPickerPresentation

Name Type Description
parameters LocationModelPickerParameters
resource_id string(uuid)
schema_version integer
setup_revision string
status ChatPresentationStatus
type string

LocationProductPickerParameters

Name Type Description
mode string

LocationProductPickerPresentation

Name Type Description
parameters LocationProductPickerParameters
resource_id string(uuid)
schema_version integer
setup_revision string
status ChatPresentationStatus
type string

LocationReferencePickerParameters

Name Type Description
mode string

LocationReferencePickerPresentation

Name Type Description
parameters LocationReferencePickerParameters
resource_id string(uuid)
schema_version integer
setup_revision string
status ChatPresentationStatus
type string

LocationVersionOneContractParameters

LocationVersionOneContractPresentation

Name Type Description
parameters LocationVersionOneContractParameters
resource_id string(uuid)
schema_version integer
setup_revision string
status ChatPresentationStatus
type string

MediaInput

Name Type Description
alt_text
caption
color_profile
dominant_color
duration
height
media_resource_id
protected boolean
url
width

MediaResourcePublic

Name Type Description
alt_text
aspect_ratio
caption
color_profile
content_hash string
created_at string(date-time)
dominant_color
duration
extension string
file_size integer
height
id string(uuid)
orientation
protected boolean
resource_type MediaResourceType
url string
width

MediaResourceType

Type: string

MessageOptions

Name Type Description
data SubjectOptions

MessageOptionSelect

Type: string

MessageOptionsRespondRequest

Name Type Description
values Array<string(uuid)>

RoleName

Type: string

RolePublic

Name Type Description
description
id string(uuid)
name RoleName

SubjectAgeClass

Type: string

SubjectOption

Name Type Description
age_class SubjectAgeClass
body_type
cover_image
cover_image_url
gender Gender
label string
subject_type SubjectType
value string(uuid)

SubjectOptions

Name Type Description
casting_link boolean
items Array<SubjectOption>
resolved boolean
select MessageOptionSelect
selected_values Array<string(uuid)>
type string

SubjectType

Type: string

UnsupportedChatPresentation

Name Type Description
schema_version integer
status string
type string

ValidationError

Name Type Description
ctx
input
loc Array<>
msg string
type string

Security schemes

Name Type Scheme Description
OAuth2PasswordBearer oauth2