{ "openapi": "3.0.3", "info": { "title": "MaxGood.work Public API", "version": "1", "summary": "Read public MaxGood.work data, and manage an Avatar's Content and Members, from your own software.", "description": "The MaxGood.work Public API lets Avatar Owners, Avatar Admins and the\ndevelopers who build for them work with MaxGood.work from their own\nsoftware. The Terms of Use are published with this reference at\nhttps://blog.maxgood.work/api-documentation.\n\n## Disclaimer\n\nThe API is offered for building and testing integrations, and you use it\nat your own risk. It is provided \"as is\" and \"as available\". To the extent\nthe law allows, MaxGood.work gives no warranty or guarantee of any kind,\nincluding for fitness for a purpose, accuracy, availability, security,\nprivacy or compliance, and none that the API or this reference stays\nunchanged. MaxGood.work may change, suspend or end any part of the API at\nany time, and to the extent the law allows is not liable for any loss that\ncomes from using it. This reference is information, not a promise.\n\n## Notices of change\n\nMaxGood.work posts every announcement of a change to the API and to its\nterms in the `api-announcements` channel of the MaxGood.work Discord\nserver at https://discord.gg/xhkwCfYurk. Support is in the `api-support` channel.\n\n## Base URL\n\nEvery path in this reference is relative to `https://api.maxgood.work/v1`.\n\nThe operations under *Public* (`/public/*`) need no key. They return data\nthat MaxGood.work already publishes, and they allow requests from any\nbrowser origin.\n\n## Responses\n\nA success is `{\"result\": \"success\", \"response\": }`. A failure is\n`{\"result\": \"failure\", \"response\": \"\", \"error_code\": \"\",\n\"request_id\": \"\"}`, with the named extra fields an operation lists.\nThe `response` message is fixed text for its `error_code`. Branch on\n`error_code`; the message may be reworded.\n\nEvery response, a failure included, carries the header `X-Request-Id`.\nIts value is `req_` followed by 32 lowercase hexadecimal characters, and\na failure body repeats it as `request_id`. Quote it when you ask\nsupport about a request.\n\n## Rate limits\n\nThe *Public* operations are limited per client IP address to 600 requests\nin each 60-second window. Over the limit they return `429` with\n`error_code` `rate_limited`, a `Retry-After` header in seconds, and\n`retry_after_seconds`, `limit` and `window_seconds` in the body.\n\n## Retiring endpoints\n\nA retiring endpoint carries `Deprecation`, `Sunset` and `Link` headers on\nevery response from the day its replacement is in production. After its\nsunset date it answers `410` `endpoint_retired` with a `successor` field\nholding the replacing path, or `null` when there is none.\n\n## Error codes\n\n| `error_code` | HTTP status | Message | Extra fields |\n| --- | --- | --- | --- |\n| `coach_is_client` | 400 | A member cannot be their own Coach. | none |\n| `coach_user_id_required` | 400 | A coach user id is required. | none |\n| `duplicate_email` | 400 | The email address appears more than once. | none |\n| `empty_file` | 400 | The file is empty. | none |\n| `fact_text_required` | 400 | The Fact text is required. | none |\n| `fact_too_long` | 400 | The Fact text is too long. | `max_characters`, `max_tokens`, `token_count` |\n| `field_not_object` | 400 | A field must be an object. | `field` |\n| `field_too_large` | 400 | A field is too large. | `field`, `max_length` |\n| `field_too_long` | 400 | A field is too long. | `field`, `max_length` |\n| `file_type_not_allowed` | 400 | This file type is not allowed. | none |\n| `invalid_batch` | 400 | The batch must hold 1 to 100 members. | none |\n| `invalid_email` | 400 | The email address is not valid. | none |\n| `invalid_json` | 400 | The request body is not valid JSON. | none |\n| `invalid_page` | 400 | The page must be a whole number of at least 1. | none |\n| `invalid_page_size` | 400 | The page size must be a whole number from 1 to 100. | none |\n| `invalid_request` | 400 | The request is not valid. | `fields` |\n| `invalid_since` | 400 | The since value cannot be read. | none |\n| `invalid_status` | 400 | The status is not valid. | none |\n| `missing_file` | 400 | No file was sent. | none |\n| `no_text_extracted` | 400 | No text could be read from the file. | none |\n| `not_a_coach` | 400 | That member is not a Coach. | none |\n| `prompt_too_long` | 400 | The prompt is too long. | `max_characters`, `max_tokens` |\n| `tag_name_invalid` | 400 | The tag name is not valid. | none |\n| `tag_name_required` | 400 | A tag name is required. | none |\n| `api_key_invalid` | 401 | The API key is not valid. | none |\n| `api_key_missing` | 401 | Send your API key as a Bearer token. | none |\n| `api_key_revoked` | 401 | This API key has been revoked. | none |\n| `admin_not_archivable` | 403 | An Admin cannot be archived. | none |\n| `agreement_required` | 403 | An agreement must be accepted first. | `agreement_party`, `agreement_url` |\n| `api_not_available` | 403 | This Avatar's plan does not include the API. | none |\n| `coach_assign_owner_only` | 403 | Only the Owner may assign a Coach. | none |\n| `coach_role_not_enabled` | 403 | This Avatar's plan has no Coach role. | none |\n| `fact_clients_only` | 403 | This Fact belongs to a member's Coach view. | none |\n| `fact_history_not_enabled` | 403 | This Avatar keeps no Fact history. | none |\n| `fact_view_only` | 403 | This key may only view this Fact. | none |\n| `facts_disabled` | 403 | Memory is off for this Avatar. | none |\n| `footer_not_editable` | 403 | This Avatar's plan does not allow footer edits. | none |\n| `insufficient_scope` | 403 | This API key does not have the scope this call needs. | `required_scope` |\n| `interaction_access_required` | 403 | This key may not see the member's interactions. | none |\n| `issuer_not_authorized` | 403 | The person who issued this API key may not do this. | none |\n| `key_frozen` | 403 | This API key has been frozen by MaxGood.work. Contact support. | none |\n| `member_archived` | 403 | This member is archived. | `interaction_id` |\n| `member_events_endpoint_required` | 403 | This API key needs a confirmed member-event endpoint. | none |\n| `member_events_unreachable` | 403 | The member-event endpoint is unreachable. Confirm it again. | none |\n| `member_license_expired` | 403 | This member's licence has expired. | `interaction_id` |\n| `member_suspended` | 403 | This member's account is suspended. | `interaction_id` |\n| `notes_owner_key_only` | 403 | This key may not write notes. | none |\n| `owner_has_no_coach` | 403 | The Owner has no Coach. | none |\n| `owner_not_archivable` | 403 | The Owner cannot be archived. | none |\n| `owner_not_removable` | 403 | The Owner cannot be removed. | none |\n| `priority_owner_key_only` | 403 | Only a key issued by the Avatar's Owner may set priority. | none |\n| `role_change_owner_key_only` | 403 | Only an Owner key may change or remove Admin and Coach roles. | none |\n| `support_avatar_not_archivable` | 403 | This Avatar's members cannot be archived. | none |\n| `user_cap_reached` | 403 | This Avatar has reached its member limit. | none |\n| `user_data_admin_key_only` | 403 | This key may not write structured data. | none |\n| `user_files_owner_coach_only` | 403 | Only the Owner and Coaches may read file contents. | none |\n| `user_tags_not_enabled` | 403 | This Avatar's plan has no member tags. | none |\n| `chunk_not_found` | 404 | No such chunk in this Avatar. | none |\n| `fact_not_found` | 404 | No such Fact. | none |\n| `file_not_found` | 404 | No such file for this member. | none |\n| `route_not_found` | 404 | No such address. | none |\n| `tag_not_found` | 404 | The member does not hold that tag. | none |\n| `title_not_found` | 404 | No such title in this Avatar. | none |\n| `user_not_found` | 404 | No such member in this Avatar. | none |\n| `method_not_allowed` | 405 | This address does not accept that method. | none |\n| `already_member` | 409 | This person is already a member. | none |\n| `avatar_full` | 409 | This Avatar has no open seat. | `needed`, `open_seats` |\n| `fact_budget_exceeded` | 409 | The Fact budget is used up. | `active_tokens`, `max_tokens`, `token_count` |\n| `member_erased` | 409 | This member's account has been erased. | none |\n| `title_empty` | 409 | A title with no active chunks cannot be enabled. | none |\n| `endpoint_retired` | 410 | This endpoint has ended. | `successor` |\n| `payload_too_large` | 413 | The request is too large. | `max_bytes` |\n| `unsupported_media_type` | 415 | The content type is not supported. | none |\n| `auth_throttled` | 429 | Too many failed key checks. Try again later. | none |\n| `rate_limited` | 429 | Too many requests. Try again later. | `rate_class`, `retry_after_seconds`, `limit`, `window_seconds` |\n| `internal_error` | 500 | Something went wrong on our side. | none |\n| `avatar_no_response` | 502 | The Avatar produced no reply. | none |\n| `embedding_failed` | 503 | The file could not be processed. Try again shortly. | none |\n| `extraction_failed` | 503 | The file could not be read. Try again shortly. | none |\n| `service_unavailable` | 503 | The service is temporarily unavailable. Try again shortly. | none |\n| `storage_failed` | 503 | The file could not be stored. Try again shortly. | none |\n| `user_documents_unavailable` | 503 | Member files are temporarily unavailable. | none |\n", "contact": { "name": "MaxGood.work API support", "url": "https://discord.gg/xhkwCfYurk" } }, "servers": [ { "url": "https://api.maxgood.work", "description": "Production" } ], "tags": [ { "name": "Avatar", "description": "The Avatar a key is bound to. These operations need a key." }, { "name": "Content", "description": "The Avatar's Content: titles, documents, sections, footers, Facts and Logistics. These operations need a key whose issuer is an Owner or Admin of the Avatar." }, { "name": "Facts", "description": "The short statements an Avatar keeps about itself and weaves into its replies. These operations need a key." }, { "name": "Interactions", "description": "The interactions members have with the Avatar. These operations need a confirmed member-event endpoint and a key whose issuer reads interactions in the MaxGood.work web app." }, { "name": "Members", "description": "The Avatar's Members, the people who hold a membership in it. These operations need a key and the Avatar's member-event endpoint." }, { "name": "Public", "description": "Data MaxGood.work already publishes. No key is needed." }, { "name": "Reply", "description": "An Avatar's reply to a message from one of its members. These operations need a key with the `chat` scope." }, { "name": "User Files", "description": "The files an Avatar's Owner and Admins keep about one member. These operations need a key and a member-event endpoint." } ], "paths": { "/v1/avatar": { "get": { "tags": [ "Avatar" ], "operationId": "getAvatar", "summary": "Get the Avatar of the key", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Returns the id, name and Avatar type of the Avatar the key is bound to.\nThe operation takes no parameters and reads the key's own Avatar only. A\n`200` shows that the key is valid, not revoked and not paused, that the\nAvatar's type offers the API, that the key holds the `read` scope, that\nthe person who issued the key may still act and that the Avatar's Owner\nhas accepted the current Owner agreement.\n\nThe call counts as one lookup in the Avatar's reading limit: 15 lookups\na minute for an Enterprise Avatar and 6 for an Essential Avatar, shared\nby all the Avatar's keys. Over the limit it returns `429`. Every response\nthat counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`.\n\nIt replaces `GET /v1beta/organization` and\n`GET /api/enterprise/get_organization_details`. The response names the\nAvatar `id` and `name`; `org_id` and `org_name` are their `/v1beta` names.\n", "responses": { "200": { "description": "The Avatar.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AvatarResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b12", "name": "Northwind Leadership Coach", "type": "Enterprise Avatar" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/avatar/respond": { "post": { "tags": [ "Reply" ], "operationId": "avatarRespond", "summary": "Get the Avatar's reply for a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "replies", "x-required-scope": "chat", "description": "Returns the Avatar's reply to a message from one of its members. The\nreply is generated as it is for the member in the MaxGood.work web app:\nthe same retrieval, memory and tone. It draws on the member's stored\ninteraction history, so you do not manage threads. The Avatar stores the\nexchange as an interaction of the member; the API assigns\n`interaction_id`, and no request sets it.\n\nThe body is one JSON object with `user_id` and `prompt`. It is checked\nstrictly: a field that is not listed, a value of the wrong type and a\nmissing or blank value answer `400` `invalid_request`, and `fields`\nnames each refused field with a short reason. A prompt longer than\n10,000 characters or 4,096 tokens answers `400` `prompt_too_long` with\n`max_characters` or `max_tokens`.\n\nThe key needs the `chat` scope. The key's issuer must be allowed to see\nthe member's interactions (on an Enterprise Avatar, its Owner, the\nmember's Avatar Coach or MaxGood.work staff), or the call answers `403`\n`interaction_access_required`. A key reaches members only while it is\nattached to a confirmed member-event endpoint (`403`\n`member_events_endpoint_required` or `member_events_unreachable`).\n\nA person who is not a member of the key's Avatar, was removed from it or\nwas erased answers `404` `user_not_found`. A member who has not accepted\nthe Avatar's terms and conditions or agreement answers `403`\n`agreement_required` with `agreement_party` `member` and `agreement_url`,\nthe page where the member accepts; nothing is stored. A member whose\nmembership is archived, whose licence has expired or whose account is\nsuspended answers `403` `member_archived`, `member_license_expired` or\n`member_suspended`. These three store the turn: `response` is the refusal\ntext the member would read, and `interaction_id` names the stored turn.\nNo reply is generated.\n\nThe call counts as one Avatar reply in the Avatar's hourly limit, shared\nby all the Avatar's keys and by `/v1` and `/v1beta` together: 30 an hour\nfor an Enterprise Avatar and 6 for an Essential Avatar. An hour runs from\nthe top of the hour to the next, UTC. Only a turn that reaches the model\nis counted; a request refused by any check, including the three stored\nrefusals, costs nothing. Over the limit the call answers `429` with\n`Retry-After`. When MaxGood.work cannot read the limit's counter, the\ncall answers `503` `service_unavailable` with `Retry-After` and\ngenerates nothing. Retry it.\n\nWhen the Avatar produces no reply, the call answers `502`\n`avatar_no_response`; the attempt still counts.\n\nIt replaces `POST /v1beta/avatar/respond`, whose body field `mg_user_id`\nis `user_id` here and whose answer `response.response` is `reply` here.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RespondRequest" }, "example": { "user_id": "7c1d5e0a9b2f4c36a8e1d0b4f5a96c27", "prompt": "How can I make our sprint planning shorter?" } } } }, "responses": { "200": { "description": "The Avatar's reply.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RespondResponse" }, "example": { "result": "success", "response": { "reply": "Start with one clear sprint goal and timebox the meeting to 45 minutes.", "interaction_id": "0b4f1d6a8c2e4a79b3d5e7f9a1c3e5b7", "reference_urls": [ "https://app.example.com/reference/66a0d4e1c9b8f7a2d3e45f60" ] } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), is not valid\n(`invalid_request`, with `fields`), or the prompt is too long\n(`prompt_too_long`, with `max_characters` or `max_tokens`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "prompt": "required" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call or the member may not be answered.\n`error_code` is one of the key refusals (`key_frozen`,\n`api_not_available`, `insufficient_scope`, `issuer_not_authorized`,\n`agreement_required` for the Owner agreement), `member_events_endpoint_required`,\n`member_events_unreachable`, `interaction_access_required`,\n`agreement_required` for the member (`agreement_party` `member`, with\n`agreement_url`), or `member_archived`, `member_license_expired` or\n`member_suspended`. The last three carry the refusal text as `response`\nand the stored turn as `interaction_id`.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Error" }, { "$ref": "#/components/schemas/RespondRefusal" } ] }, "examples": { "member_agreement": { "summary": "The member has not accepted the Avatar's agreement", "value": { "result": "failure", "response": "An agreement must be accepted first.", "error_code": "agreement_required", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "agreement_party": "member", "agreement_url": "https://app.example.com/agreements/65f1c2a9b7d3e4a1c8f09b12" } }, "member_license_expired": { "summary": "The member's licence has expired", "value": { "result": "failure", "response": "Your access to this Avatar has ended. Contact the Avatar's owner.", "error_code": "member_license_expired", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "interaction_id": "0b4f1d6a8c2e4a79b3d5e7f9a1c3e5b8" } } } } } }, "404": { "description": "The person is not a member of the key's Avatar (`user_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is larger than 65,536 bytes. `max_bytes` gives the limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The `Content-Type` is not `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "502": { "description": "The Avatar produced no reply (`avatar_no_response`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Avatar produced no reply.", "error_code": "avatar_no_response", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/chunks/{chunk_id}": { "delete": { "tags": [ "Content" ], "operationId": "deleteContentChunk", "summary": "Delete a section of Content", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "parameters": [ { "name": "chunk_id", "in": "path", "required": true, "description": "The id of the section (chunk) to delete.", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9_-]+$" } } ], "description": "Deletes one section (chunk) of the Avatar's Content. Its text and name\nare replaced with placeholders, it becomes inactive and its embedding is\nremoved, so the Avatar stops using it. The section's id stays readable,\nand replies that cited it keep their citations. The operation takes no\nbody.\n\nThe key needs the `write` scope, and the person who issued it must be an\nOwner or Admin of the Avatar. A section that does not exist, a section\nof another Avatar, a section that is already deleted and a section of a\ndeleted title all answer `404` `chunk_not_found`; the answer never shows\nwhether a section exists in another Avatar.\n\nThe call counts as one change in the Avatar's Content changes limit once\nthe section is found: 1 a day for an Avatar that has any member who is\nneither its Owner nor an Admin, and otherwise the Avatar's adding-documents\nlimit (120 a day for an Enterprise Avatar, 60 for an Essential Avatar).\nThe limit is shared by all the Avatar's keys, on `/v1` and `/v1beta`.\nOver the limit it returns `429` with `rate_class` `content_changes`. If\nthe counting service is unavailable, the call returns `503` and deletes\nnothing. A request refused before the section is found costs nothing.\nEvery response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `DELETE /v1beta/content/chunks/{chunk_id}`. The response holds\n`id` and `deleted` where `/v1beta` answered a message.\n", "responses": { "200": { "description": "The section is deleted.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletedResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b77", "deleted": true } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/ChunkNotFound" }, "429": { "description": "The Avatar has reached its Content changes limit (`error_code`\n`rate_limited`, `rate_class` `content_changes`), or too many failed\nkey checks came from your address (`auth_throttled`). `Retry-After`\ngives the seconds to wait.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "Retry-After": { "$ref": "#/components/headers/RetryAfter" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Too many requests. Try again later.", "error_code": "rate_limited", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "rate_class": "content_changes", "retry_after_seconds": 3600, "limit": 1, "window_seconds": 86400 } } } }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "parameters": [ { "name": "chunk_id", "in": "path", "required": true, "description": "The id of a chunk of the Avatar's own Content.", "schema": { "type": "string", "minLength": 1, "maxLength": 128 }, "example": "66a0d4e1c9b8f7a2d3e45f10" } ], "patch": { "tags": [ "Content" ], "operationId": "editContentChunk", "summary": "Edit a chunk", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "description": "Replaces the text of a chunk of the Avatar's Content and embeds it\nagain, so the Avatar retrieves the new text. HTML in `text` is\nconverted to Markdown. The body is a JSON object with the fields\nbelow; any other field is refused.\n\n- `text`, the new text. A string with something in it besides white\n space. It is required.\n- `source_document_title`, the new name of the source document, a\n string of at most 255 characters without control characters. Each\n chunk starts with a header that names its title and its source\n document, and the header is part of what the Avatar matches on. Send\n `source_document_title` to rebuild the header with the new name; leave\n it out to keep the current one. It is optional.\n\nThe request body is at most 1 MiB. The key needs the `write` scope and\nan issuer who manages members. A chunk that does not exist, a chunk that\nis deleted, a chunk of a deleted title and a chunk of another Avatar\nall answer `404` `chunk_not_found`.\n\nAn edit counts as one change in the Avatar's content-changes limit,\nshared by all the Avatar's keys and by `/v1` and `/v1beta` together. A\nrequest refused by a check costs nothing against the limit. When the\ncounting service is unavailable the edit is refused with `503` and\nnothing is changed. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`. Each\nedit is recorded in the Avatar's audit log.\n\nIt replaces `PUT /v1beta/content/chunks/{chunk_id}`, whose\n`chunk_text` is `text` here and whose answer was a message. This\noperation answers the edited chunk.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": [ "text" ], "properties": { "text": { "type": "string", "description": "The new text, as Markdown. HTML is converted to Markdown." }, "source_document_title": { "type": "string", "maxLength": 255, "description": "The new name of the source document. Leave it out to keep the current one." } } }, "example": { "text": "A sprint planning meeting sets the goal and the scope of the next sprint.", "source_document_title": "Sprint planning guide" } } } }, "responses": { "200": { "description": "The chunk after the edit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChunkResponse" }, "example": { "result": "success", "response": { "id": "66a0d4e1c9b8f7a2d3e45f10", "title_id": "66a0d4e1c9b8f7a2d3e45f01", "name": "Sprint planning guide", "text": "A sprint planning meeting sets the goal and the scope of the next sprint.", "is_active": true } } } } }, "400": { "description": "The body is not valid JSON (`error_code` `invalid_json`), or a field\nis not valid (`invalid_request`, with `fields` naming each invalid\nfield and the reason, never its value).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "text": "required" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "The Avatar has no such chunk (`error_code` `chunk_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such chunk in this Avatar.", "error_code": "chunk_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is over the limit (`error_code` `payload_too_large`, with `max_bytes`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 1048576 } } } }, "415": { "description": "The request is not declared as JSON (`error_code` `unsupported_media_type`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Content" ], "operationId": "getContentChunk", "summary": "Get a chunk", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Returns one chunk of the Avatar's Content: its `id`, the `title_id` of\nthe title it belongs to, its `name`, its `text` as Markdown and whether\nit is active. The operation reads chunks of the key's own Avatar only.\nAn id that no chunk of the Avatar has, an id of a chunk of another\nAvatar and an id that cannot be a chunk id all return `404`\n`chunk_not_found`, so the answer never tells a key whether a chunk\nexists elsewhere.\n\nA chunk that was deleted stays readable, with `is_active` `false` and\nplaceholder `text` and `name`, so a chunk id from an earlier reply\nremains valid to read. A chunk of a member's own profile file belongs to\nthe member and is not served here.\n\nThe key needs the `read` scope, and the person who issued it must be an\nOwner or Admin of the Avatar, because the operation reads Content. The\ncall counts as one lookup in the Avatar's reading limit: 15 lookups a\nminute for an Enterprise Avatar and 6 for an Essential Avatar, shared by\nall the Avatar's keys. Over the limit it returns `429`. Every response\nthat counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`.\n\nIt replaces `GET /v1beta/content/chunks/{chunk_id}`, whose\n`chunk_text` and `chunk_name` are `text` and `name` here.\n", "parameters": [ { "name": "chunk_id", "in": "path", "required": true, "description": "The id of the chunk, from 1 to 64 letters, digits, `.`, `_` and `-`, starting with a letter or digit.", "schema": { "type": "string", "minLength": 1, "maxLength": 64 }, "example": "66a0d4e1c9b8f7a2d3e45f11" } ], "responses": { "200": { "description": "The chunk.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChunkResponse" }, "example": { "result": "success", "response": { "id": "66a0d4e1c9b8f7a2d3e45f11", "title_id": "66a0d4e1c9b8f7a2d3e45f01", "name": "Sprint planning guide-1", "text": "A sprint planning meeting sets the goal for the next sprint.", "is_active": true } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/ChunkNotFound" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/facts": { "post": { "tags": [ "Facts" ], "operationId": "createFact", "summary": "Add a Fact to the Avatar", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "description": "Adds one Avatar-wide Fact to the Avatar the key is bound to. A Fact is a\nshort statement the Avatar keeps in mind and weaves into every reply, to\nevery member. The body holds `text` and nothing else; a Fact about one\nmember is added with the Members endpoints.\n\nThe key needs the `write` scope, and the person who issued it must\nmanage members (an Avatar Owner or Avatar Admin). The Fact is recorded\nas added by that person, and they can edit it in the MaxGood.work web\napp under the same rules.\n\nThe Avatar's type decides the largest Fact (`max_tokens`) and the total\nits active Facts may hold (`max_tokens` of `fact_budget_exceeded`). The\ntotal is checked while no other Fact of the Avatar is being added,\nchanged or switched on, so two requests together cannot pass it, and a\nrequest that is refused for the budget writes nothing.\n\nThe add counts as one change in the Avatar's content-change limit,\nshared by all its keys on `/v1/` and `/v1beta/`. A request refused before\nthe add costs nothing against the limit, and every response that counted\ncarries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\nIf the counting service is unavailable the request answers `503`\n`service_unavailable` and adds nothing.\n\nIt is the Avatar-wide half of `POST /v1beta/facts`.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FactCreateRequest" }, "example": { "text": "Prefers short replies with one concrete next step." } } } }, "responses": { "201": { "description": "The Fact that was added.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FactResponse" }, "example": { "result": "success", "response": { "id": "123", "text": "Prefers short replies with one concrete next step.", "token_count": 9, "status": "active", "source": "owner", "created_by_user_id": "65f1c2a9b7d3e4a1c8f09b13", "created_at": "2026-12-01T10:15:00+00:00", "updated_at": "2026-12-01T10:15:00+00:00", "version_count": 0, "access": "edit" } } } } }, "400": { "description": "The body is not acceptable. `error_code` is `invalid_json` (the body\nis not JSON), `invalid_request` (the body is not an object, holds a\nfield other than `text`, or `text` is not a string; `fields` names\nthe field and the reason), `fact_text_required` (`text` is missing,\nempty or only spaces) or `fact_too_long` (`text` is over 2,000\ncharacters, `max_characters`, or over the Avatar type's largest Fact,\n`token_count` and `max_tokens`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact text is required.", "error_code": "fact_text_required", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not add this Fact. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body\nnames `required_scope`), `issuer_not_authorized`,\n`agreement_required` (the body names `agreement_party` and\n`agreement_url`) or `facts_disabled` (the Avatar's type keeps no\nFacts).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Memory is off for this Avatar.", "error_code": "facts_disabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "409": { "description": "The Fact would take the Avatar's active Facts past the total its\ntype allows (`error_code` `fact_budget_exceeded`). The body names\n`active_tokens` (what the active Facts hold now), `max_tokens` (the\ntotal) and `token_count` (this Fact). Hide or delete a Fact, or\nshorten this one, and send the request again.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact budget is used up.", "error_code": "fact_budget_exceeded", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "active_tokens": 480, "max_tokens": 500, "token_count": 40 } } } }, "413": { "description": "The body is over 16,384 bytes (`max_bytes`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 16384 } } } }, "415": { "description": "The request is not sent as `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Facts" ], "operationId": "listContentFacts", "summary": "List the Avatar's Facts", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "status", "in": "query", "required": false, "description": "Keep the Facts with this status. `all` (the default) keeps every Fact.", "schema": { "type": "string", "enum": [ "active", "hidden", "all" ], "default": "all" } }, { "name": "page", "in": "query", "required": false, "description": "The page to return, from 1.", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "required": false, "description": "The number of Facts on a page, from 1 to 100.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "description": "Lists the Avatar's own Facts, in ascending order of their numeric `id`.\nA Fact is one short statement the Avatar keeps about itself and weaves\ninto its replies. The list holds the Avatar-wide Facts only; the Facts\nthe Avatar keeps about a member belong to that member's resource.\n\nThe list shows the Facts the person who issued the key may see in the\nMaxGood.work web app. Each Fact carries `access`: `edit` when that\nperson may change it and `view` when they may only read it. The author\nof a Fact (`created_by_user_id`) is `null` where that person may not\nsee who wrote it. `version_count` is the number of earlier versions of\nthe Fact's text, and is `null` when the Avatar's type keeps no edit\nhistory.\n\n`limits` reports the Avatar type's limits and the tokens the Avatar's\nactive Facts use now: `per_fact_tokens` is the most one Fact may hold,\n`total_tokens` the most all the Avatar's active Facts may hold together\n(the Avatar's Facts and its members' Facts count toward the same\ntotal), `active_tokens` what they use now, and `history_tracked`\nwhether the type keeps edit history.\n\n`page` starts at 1 and `page_size` goes from 1 to 100. A value outside\nthose ranges, or one that is not a whole number, returns `400` with\n`invalid_page` or `invalid_page_size`; the API never adjusts it. A page\npast the last one returns an empty `items` list. `status` must be\n`active`, `hidden` or `all`, in lower case, or the call returns `400`\n`invalid_status`. `total` counts every Fact that matches, across pages.\n\nThe key needs the `read` scope, and the person who issued it must\nmanage the Avatar's members (its Owner or an Avatar Admin); any other\nissuer receives `403` `issuer_not_authorized`. An Avatar whose type\nkeeps no Facts returns `403` `facts_disabled`.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys; a call refused by a check counts for nothing.\nOver the limit it returns `429`. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `GET /v1beta/facts` for the Avatar's own Facts.\n", "responses": { "200": { "description": "One page of the Avatar's Facts.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FactListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "412", "text": "Replies are short, concrete and end with one action step.", "token_count": 12, "status": "active", "source": "owner", "created_by_user_id": "3b9e1f6a2c8d4e57b0a1c9d8e7f64a35", "created_at": "2026-11-10T15:04:05.000Z", "updated_at": "2026-11-10T15:04:05.000Z", "version_count": 0, "access": "edit" } ], "page": 1, "page_size": 50, "total": 1, "limits": { "per_fact_tokens": 60, "total_tokens": 2000, "active_tokens": 12, "history_tracked": true } } } } } }, "400": { "description": "The paging or the status filter is not valid (`error_code`\n`invalid_page`, `invalid_page_size` or `invalid_status`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page size must be a whole number from 1 to 100.", "error_code": "invalid_page_size", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/FactsForbidden" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/facts/{fact_id}": { "delete": { "tags": [ "Content" ], "operationId": "deleteContentFact", "summary": "Delete an Avatar-wide Fact", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "parameters": [ { "name": "fact_id", "in": "path", "required": true, "description": "The id of the Fact, written as plain digits.", "schema": { "type": "string", "pattern": "^[1-9][0-9]{0,9}$" }, "example": "412" } ], "description": "Deletes one of the Avatar's own Facts, the ones that describe the Avatar\nitself, together with its edit history. The deletion cannot be undone.\nTo keep a Fact and stop the Avatar using it, hide it with\n`PATCH /v1/content/facts/{fact_id}`.\n\nThe call needs a key with the `write` scope whose issuer is the Avatar's\nOwner, an Avatar Admin or MaxGood.work staff acting for the Avatar. A Fact\nabout a member is not reached here and answers `404` `fact_not_found`, as\ndoes an id that names no Fact of this Avatar. A Fact the key's issuer may\nread but not change (for example one an Avatar Coach added) answers `403`\n`fact_view_only`. An Avatar whose type has no Facts answers `403`\n`facts_disabled`.\n\nThe deletion counts as one change in the Avatar's daily limit for changing\nContent, shared by all the Avatar's keys, once every other check has\npassed; a refused request costs nothing. If the limit cannot be counted\njust now, the call answers `503` `service_unavailable` and deletes\nnothing. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `DELETE /v1beta/facts/{fact_id}` for an Avatar-wide Fact. The\nresponse names the Fact `id` as a string where `/v1beta` answered\n`fact_id` as a number.\n", "responses": { "200": { "description": "The Fact is deleted.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletedResponse" }, "example": { "result": "success", "response": { "id": "412", "deleted": true } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is one of\nthe key checks (`key_frozen`, `api_not_available`,\n`insufficient_scope`, `issuer_not_authorized`, `agreement_required`),\n`facts_disabled` (the Avatar's type has no Facts) or `fact_view_only`\n(the issuer may read this Fact and not change it).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This key may only view this Fact.", "error_code": "fact_view_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such Fact in this Avatar's own Facts.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Content" ], "operationId": "getContentFact", "summary": "Get one Avatar-wide Fact", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "fact_id", "in": "path", "required": true, "description": "The id of the Fact, a whole number written in digits, for example 123.", "schema": { "type": "string", "minLength": 1, "maxLength": 10 }, "example": "123" } ], "description": "Returns one Fact the Avatar keeps about itself. A Fact is one short\nstatement the Avatar weaves into its replies. The key's issuer sees the\nFacts they could see in the MaxGood.work web app.\n\n`404` `fact_not_found` answers in one body for an id that is not a whole\nnumber, a Fact that does not exist, a Fact of another Avatar, a Fact\nabout a Member, and a Fact the key's issuer may not see. `403`\n`facts_disabled` answers when the Avatar's type has no Facts.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys. Over the limit it returns `429`. Every response\nthat counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`. The read is recorded in the Avatar's audit trail with\nthe Fact's id and never its text.\n\nIt replaces `GET /v1beta/facts/{fact_id}` for an Avatar-wide Fact. The\nresponse has no `scope` and no `user_id`: the path says which kind of\nFact it is, and `id` is a string.\n", "responses": { "200": { "description": "The Fact.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FactResponse" }, "example": { "result": "success", "response": { "id": "123", "text": "Our office is closed on public holidays.", "token_count": 8, "status": "active", "source": "owner", "created_by_user_id": "65f1c2a9b7d3e4a1c8f09b99", "created_at": "2026-11-01T09:30:00+00:00", "updated_at": "2026-11-02T10:00:00+00:00", "version_count": 2, "access": "edit" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body names\n`required_scope`), `issuer_not_authorized`, `agreement_required` (the\nbody names `agreement_party` and `agreement_url`) or `facts_disabled`\n(the Avatar's type has no Facts).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Memory is off for this Avatar.", "error_code": "facts_disabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such Fact for this key.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "patch": { "tags": [ "Content" ], "operationId": "updateContentFact", "summary": "Change a Fact of the Avatar", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "parameters": [ { "name": "fact_id", "in": "path", "required": true, "description": "The id of the Fact, as the other Fact operations return it.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateContentFactRequest" }, "example": { "text": "Prefers a short summary before the detail.", "status": "active" } } } }, "description": "Changes the text of one of the Avatar's own Facts, its status, or both,\nand returns the Fact. The whole change is one step: the new text, the\nnew status and the saved earlier version of the text (on an Avatar type\nthat keeps a Fact history) are written together or not at all, so a\nrefused change leaves the Fact as it was.\n\nThe Avatar's total Fact limit is checked against the Fact as it will\nstand after the change. A Fact that stays hidden never counts against\nit. Showing a hidden Fact, or making an active Fact longer, answers `409`\n`fact_budget_exceeded` when the Avatar's active Facts would pass the\nlimit; the body names `active_tokens` and `max_tokens`.\n\nThe key needs the `write` scope and an issuer who is the Avatar's Owner,\nan Avatar Admin or MaxGood.work staff. An Admin cannot change a Fact an\nAvatar Coach added (`403` `fact_view_only`). A Fact of a member, a Fact\nof another Avatar, a Fact the issuer may not see and an id that is not a\nwhole number all answer `404` `fact_not_found`.\n\nThe change counts as one change in the Avatar's daily limit for Content\nchanges, shared by all the Avatar's keys. A request refused before the\nchange is made costs nothing. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `PATCH /v1beta/facts/{fact_id}` for an Avatar-wide Fact.\n", "responses": { "200": { "description": "The Fact after the change.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateContentFactResponse" }, "example": { "result": "success", "response": { "id": "412", "text": "Prefers a short summary before the detail.", "token_count": 9, "status": "active", "source": "owner", "created_by_user_id": "65f1c2a9b7d3e4a1c8f09b13", "created_at": "2026-11-02T14:05:09+00:00", "updated_at": "2026-11-30T09:12:41+00:00", "version_count": 2, "access": "edit" } } } } }, "400": { "description": "The request is not valid. `error_code` is `invalid_json` (the body is\nnot JSON), `invalid_request` (the body is not an object, holds a field\nthat is not listed, or holds neither `status` nor `text`; `fields`\nnames each field), `invalid_status` (`status` is not `active` or\n`hidden`), `fact_text_required` (`text` is not a non-empty string) or\n`fact_too_long` (the text is over 2000 characters, with\n`max_characters`, or over the Avatar's limit for one Fact, with\n`token_count` and `max_tokens`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact text is too long.", "error_code": "fact_too_long", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_tokens": 64, "token_count": 101 } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is one of the key\nrefusals (`key_frozen`, `api_not_available`, `insufficient_scope`,\n`issuer_not_authorized`, `agreement_required`), `facts_disabled` (the\nAvatar's type keeps no Facts) or `fact_view_only` (the issuer may read\nthis Fact and not change it).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This key may only view this Fact.", "error_code": "fact_view_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such Fact for this key (`fact_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "409": { "description": "The change would take the Avatar's active Facts past their total\nlimit (`fact_budget_exceeded`, with `active_tokens` and\n`max_tokens`). Nothing was changed.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact budget is used up.", "error_code": "fact_budget_exceeded", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "active_tokens": 4096, "max_tokens": 4096 } } } }, "413": { "description": "The body is larger than the endpoint accepts (`payload_too_large`, with `max_bytes`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The body is not sent as `application/json` (`unsupported_media_type`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/facts/{fact_id}/history": { "get": { "tags": [ "Content" ], "operationId": "listFactHistory", "summary": "List the edit history of a Fact", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "fact_id", "in": "path", "required": true, "description": "The id of one of the Avatar's own Facts.", "schema": { "type": "string" }, "example": "123" }, { "name": "page", "in": "query", "required": false, "description": "The page to return, counted from 1. The default is 1.", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "required": false, "description": "How many versions a page holds, from 1 to 100. The default is 50.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "description": "Returns the earlier texts of one of the Avatar's own Facts, newest edit\nfirst. Each version is the text the Fact held before an edit. Only an\nEnterprise Avatar keeps a Fact's edit history; any other Avatar type\nreceives `403` `fact_history_not_enabled`. A Fact about a member is not\none of the Avatar's own Facts and answers `404` `fact_not_found`, as does\na Fact that does not exist.\n\nThe key needs the `read` scope and an issuer who manages the Avatar. The\ncall counts as one lookup in the Avatar's reading limit. Every response\nthat counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`. Each read is recorded in the Avatar's audit trail with\nthe Fact's id and the number of versions returned, never a Fact's text.\n\nIt replaces `GET /v1beta/facts/{fact_id}/history`, which answered every\nversion in one list named `versions` and served both kinds of Fact.\n", "responses": { "200": { "description": "One page of the Fact's versions.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FactHistoryResponse" }, "example": { "result": "success", "response": { "fact_id": "123", "items": [ { "id": "41", "fact_id": "123", "text": "Offers coaching in English and French.", "token_count": 7, "edited_at": "2026-11-02T15:20:41.125Z", "edited_by_user_id": "65f1c2a9b7d3e4a1c8f09b13", "edit_source": "owner" } ], "page": 1, "page_size": 50, "total": 1 } } } } }, "400": { "description": "The page or the page size is not valid.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page must be a whole number of at least 1.", "error_code": "invalid_page", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`facts_disabled` (the Avatar's type has no Facts),\n`fact_history_not_enabled` (the Avatar's type keeps no edit\nhistory), or one of the key checks of `GET /v1/avatar`\n(`key_frozen`, `api_not_available`, `insufficient_scope`,\n`issuer_not_authorized`, `agreement_required`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar keeps no Fact history.", "error_code": "fact_history_not_enabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such Fact: it does not exist, belongs to another Avatar, is about\na member, or the issuer of the key may not view it.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/logistics": { "get": { "tags": [ "Content" ], "operationId": "getLogistics", "summary": "Get the Avatar's Logistics", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Returns the Logistics of the Avatar the key is bound to: the contact and\navailability details the Avatar shows, which its Owner and Admins edit\nin Avatar Admin under Logistics. The operation takes no parameters and\nreads the key's own Avatar only.\n\nThe object always holds the same ten keys: `support_email`, `whatsapp`,\n`booking_url`, `website_url`, `linkedin_url`, `x_url`, `instagram_url`,\n`phone`, `office_hours` and `preferred_channel_note`. Each key has one\n`enabled` switch, true until the Avatar's Owner or Admin switches it off,\nand its value or values. `phone` groups `number` and `country` under one\nswitch, and `office_hours` groups `hours` and `timezone` under one\nswitch. A detail that is not stored is the empty string, and for\n`support_email` an empty array.\n\nThe key's issuer must be an Owner or Admin of the Avatar. The call counts\nas one lookup in the Avatar's reading limit, shared by all the Avatar's\nkeys. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n", "responses": { "200": { "description": "The Avatar's Logistics.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogisticsResponse" }, "example": { "result": "success", "response": { "support_email": { "enabled": true, "value": [ "help@northwind.example.com" ] }, "whatsapp": { "enabled": true, "value": "" }, "booking_url": { "enabled": true, "value": "https://northwind.example.com/book" }, "website_url": { "enabled": true, "value": "https://northwind.example.com" }, "linkedin_url": { "enabled": false, "value": "" }, "x_url": { "enabled": true, "value": "" }, "instagram_url": { "enabled": true, "value": "" }, "phone": { "enabled": true, "number": "+1 555 010 0199", "country": "Canada" }, "office_hours": { "enabled": true, "hours": "Monday to Friday, 9 am to 5 pm", "timezone": "America/Toronto" }, "preferred_channel_note": { "enabled": true, "value": "Email is the fastest way to reach us." } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "put": { "tags": [ "Content" ], "operationId": "putLogistics", "summary": "Replace the Avatar's Logistics", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "description": "Replaces the Logistics of the Avatar the key is bound to: the contact and\navailability details the Avatar shows, which its Owner and Admins also\nedit in Avatar Admin under Logistics. The call replaces the whole\nobject. Send the same ten keys that `GET /v1/content/logistics` answers,\neach with its `enabled` switch and its value or values: `support_email`,\n`whatsapp`, `booking_url`, `website_url`, `linkedin_url`, `x_url`,\n`instagram_url`, `phone` (`number` and `country`), `office_hours`\n(`hours` and `timezone`) and `preferred_channel_note`. To clear a\ndetail, send the empty string (for `support_email`, an empty array).\n\nThe body is checked strictly. A missing key, a key that is not listed,\nan `enabled` that is not `true` or `false` and a value of the wrong type\nanswer `400` `invalid_request`, and `fields` names each refused path\nwith a short reason such as `required`, `unknown_field`,\n`must_be_boolean` or `must_be_string`. Every value is then checked with\nthe same checks as Avatar Admin: a link is an http or https address of at\nmost 500 characters; `whatsapp` is a link or a phone number; a phone\nnumber holds 7 to 20 digits, with an optional leading plus sign, spaces,\nbrackets, dots and hyphens; `support_email` holds email addresses, which\nare put in lower case without repeats; `country`, `hours` and\n`preferred_channel_note` are text of at most 1,000 characters; `timezone`\nis a name from the IANA time zone database. The first value that fails\nanswers `400` `invalid_request` with `fields` naming its path, such as\n`phone.number`, and the reason `too_long` or `invalid_format`. Nothing\nis written when any check fails. The reply never repeats what you sent.\n\nThe key needs the `write` scope and must have been issued by a person\nwho manages the Avatar (its Owner, an Avatar Admin or MaxGood.work\nstaff); otherwise the call answers `403` `issuer_not_authorized`.\n\nThe call counts as one Content change in the Avatar's daily limit,\nshared by all the Avatar's keys and by `/v1` and `/v1beta` together. An\nAvatar that has any member who is neither its Owner nor an Admin may make\none Content change a day. An Avatar whose members are all its Owner and\nAdmins may make as many Content changes a day as it may add documents to\nContent: 120 for an Enterprise Avatar and 60 for an Essential Avatar. A\nday runs from 00:00 to 24:00 UTC. Over the limit the call answers `429`\nwith `Retry-After`. A call refused by any check costs nothing against the\nlimit. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nWhen MaxGood.work cannot read the limit's counter, the call answers `503`\n`service_unavailable` with `Retry-After` and changes nothing. Retry it.\n\nThe Logistics reach every reply the Avatar gives. MaxGood.work screens\nwhat Avatar Owners and Admins write, Logistics included, for abuse, and\nits staff review what the screen flags. The screen never refuses or\ndelays this call.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Logistics" }, "example": { "support_email": { "enabled": true, "value": [ "help@northwind.example.com" ] }, "whatsapp": { "enabled": true, "value": "" }, "booking_url": { "enabled": true, "value": "https://northwind.example.com/book" }, "website_url": { "enabled": true, "value": "https://northwind.example.com" }, "linkedin_url": { "enabled": false, "value": "" }, "x_url": { "enabled": true, "value": "" }, "instagram_url": { "enabled": true, "value": "" }, "phone": { "enabled": true, "number": "+1 555 010 0199", "country": "Canada" }, "office_hours": { "enabled": true, "hours": "Monday to Friday, 9 am to 5 pm", "timezone": "America/Toronto" }, "preferred_channel_note": { "enabled": true, "value": "Email is the fastest way to reach us." } } } } }, "responses": { "200": { "description": "The Avatar's Logistics now.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogisticsResponse" }, "example": { "result": "success", "response": { "support_email": { "enabled": true, "value": [ "help@northwind.example.com" ] }, "whatsapp": { "enabled": true, "value": "" }, "booking_url": { "enabled": true, "value": "https://northwind.example.com/book" }, "website_url": { "enabled": true, "value": "https://northwind.example.com" }, "linkedin_url": { "enabled": false, "value": "" }, "x_url": { "enabled": true, "value": "" }, "instagram_url": { "enabled": true, "value": "" }, "phone": { "enabled": true, "number": "+1 555 010 0199", "country": "Canada" }, "office_hours": { "enabled": true, "hours": "Monday to Friday, 9 am to 5 pm", "timezone": "America/Toronto" }, "preferred_channel_note": { "enabled": true, "value": "Email is the fastest way to reach us." } } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), or is not valid\n(`invalid_request`, with `fields`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "phone.number": "invalid_format" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "413": { "description": "The body is larger than 65,536 bytes. `max_bytes` gives the limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The `Content-Type` is not `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/titles": { "post": { "tags": [ "Content" ], "operationId": "createContentTitle", "summary": "Create a Content title", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "description": "Creates an empty Content title in the Avatar the key is bound to. The\ntitle is switched off, holds no sections and has the priority `normal`;\nadd text and files to it, then switch it on, to make the Avatar use it.\n\nThe body is one JSON object with one field, `name`. The body is checked\nstrictly: a field that is not listed, a value of the wrong type (the\nstring `\"true\"` is not a boolean, a number is not a string) and a name\nthat is empty or longer than 300 characters answer `400`\n`invalid_request`, and `fields` names each refused field with a short\nreason such as `required`, `must_be_string`, `too_long` or\n`unknown_field`. The reply never repeats what you sent.\n\nThe key needs the `write` scope and must have been issued by a person\nwho manages the Avatar's members (its Owner, an Avatar Admin or MaxGood.work\nstaff); otherwise the call answers `403` `issuer_not_authorized`.\n\nThe call counts as one Content change in the Avatar's daily limit,\nshared by all the Avatar's keys and by `/v1` and `/v1beta` together. An\nAvatar that has any member who is neither its Owner nor an Admin may make\none Content change a day. An Avatar whose members are all its Owner and\nAdmins may make as many Content changes a day as it may add documents to\nContent: 120 for an Enterprise Avatar and 60 for an Essential Avatar. A\nday runs from 00:00 to 24:00 UTC. Over the limit the call answers `429`\nwith `Retry-After`. A call refused by any check costs nothing against the\nlimit. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nWhen MaxGood.work cannot read the limit's counter, the call answers `503`\n`service_unavailable` with `Retry-After` and creates nothing. Retry it.\n\nIt replaces `POST /v1beta/content/titles`, whose body field `title` is\n`name` here.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateContentTitleRequest" }, "example": { "name": "Leadership playbook" } } } }, "responses": { "201": { "description": "The title was created.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TitleResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b99", "name": "Leadership playbook", "is_enabled": false, "chunk_count": 0, "created_at": "2026-12-01T15:04:05.123Z", "is_linked_from_other_avatar": false, "priority": "normal" } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), or is not valid\n(`invalid_request`, with `fields`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "name": "required" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "413": { "description": "The body is larger than 65,536 bytes. `max_bytes` gives the limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The `Content-Type` is not `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Content" ], "operationId": "listContentTitles", "summary": "List the Avatar's Content titles", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" } ], "description": "Lists the Content titles of the Avatar the key is bound to: the titles\nthe Avatar owns, then the titles other Avatars have shared into it. Each\ngroup is listed newest first, with the title `id` ordering titles\ncreated in the same second. The list is paged with `page` and\n`page_size` (1 to 100, default 50), and `total` is the number of titles\nacross all pages. Foundation titles are not part of an Avatar's Content\nand do not appear.\n\nEvery title carries its `priority`, the Avatar's own preference for the\ntitle (`high`, `normal` or `low`; `normal` until it is set). A title\nwith `is_linked_from_other_avatar` true is shared in: the Avatar reads\nit, and its Owner chooses in the MaxGood.work web app whether it is\nenabled.\n\nThe key needs the `read` scope, and its issuer must manage the Avatar\n(an Avatar Owner or an Avatar Admin), because Content is managed by\nthose people. A `200` counts as one lookup in the Avatar's reading\nlimit: 15 lookups a minute for an Enterprise Avatar and 6 for an\nEssential Avatar, shared by all the Avatar's keys. A request refused for\nits `page` or `page_size` is not counted. Over the limit the operation\nreturns `429`. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `GET /v1beta/content/titles`. The response is paged and\nnames its list `items` where `/v1beta` named it `titles`; `title_id` and\n`title_name` are `id` and `name` here, `count` is `chunk_count`,\n`is_linked_from_other_organization` is `is_linked_from_other_avatar`,\n`titles_count` is `total`, and `priority` is new.\n", "responses": { "200": { "description": "One page of the Avatar's titles.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TitleListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "65f1c2a9b7d3e4a1c8f09b21", "name": "Leadership handbook", "is_enabled": true, "chunk_count": 42, "created_at": "2026-11-14T15:04:05.000Z", "is_linked_from_other_avatar": false, "priority": "high" }, { "id": "65f1c2a9b7d3e4a1c8f09b33", "name": "Coaching interactions", "is_enabled": false, "chunk_count": 18, "created_at": "2026-10-02T09:30:00.000Z", "is_linked_from_other_avatar": true, "priority": "normal" } ], "page": 1, "page_size": 50, "total": 2 } } } } }, "400": { "$ref": "#/components/responses/InvalidPaging" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/titles/{title_id}": { "delete": { "tags": [ "Content" ], "operationId": "deleteContentTitle", "summary": "Delete a title", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "parameters": [ { "in": "path", "name": "title_id", "required": true, "description": "The id of a title of the key's Avatar.", "schema": { "type": "string" } } ], "description": "Deletes a title of the key's Avatar, and the deletion cannot be undone.\nThe title's name, description and footer, and each chunk's name and\ntext, are replaced with placeholders. Each document's file name is\nreplaced, the chunks stop being retrieved, and the original uploaded\nfiles are permanently deleted from storage. Keep your own copy of any\ndocument you may need again. Replies that already cited the chunks keep\ntheir citations.\n\nThe call needs the `write` scope and a key whose issuer is an Owner or\nAdmin of the Avatar. It counts as one change in the Avatar's content\nchanges limit. A title that does not exist, that is already deleted,\nthat another Avatar owns, or that is shared into this Avatar answers\n`404` `title_not_found`, and a refused request costs nothing against a\nlimit.\n\nIt replaces `DELETE /v1beta/content/titles/{title_id}`. The response is\n`{\"id\", \"deleted\": true}` where the earlier route answered a message.\n", "responses": { "200": { "description": "The title is deleted.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletedResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b13", "deleted": true } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No such title in this Avatar.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Content" ], "operationId": "getContentTitle", "summary": "Get one Content title", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "in": "path", "name": "title_id", "required": true, "description": "The title's `id`, as the title list returns it.", "schema": { "type": "string" } } ], "description": "Returns one Content title of the Avatar the key is bound to: a title the\nAvatar owns or a title another Avatar has shared into it.\n`is_linked_from_other_avatar` says which. The title is the one the list\nof titles shows, with the same fields and the Avatar's own `priority`.\n\nA title that does not exist, a title that has been deleted and a title\nthat no Avatar has shared into this one all return `404` with\n`error_code` `title_not_found`, so the answer never shows whether a\ntitle of another Avatar exists. Foundation titles are not part of an\nAvatar's Content and return `404`.\n\nThe key needs the `read` scope, and its issuer must manage the Avatar\n(an Avatar Owner or an Avatar Admin), because Content is managed by\nthose people. A `200` or a `404` counts as one lookup in the Avatar's\nreading limit: 15 lookups a minute for an Enterprise Avatar and 6 for\nan Essential Avatar, shared by all the Avatar's keys. Over the limit the\noperation returns `429`. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `GET /v1beta/content/titles/`, which returned `404`\nfor a title shared into the Avatar. `title_id` and `title_name` are `id`\nand `name` here, `count` is `chunk_count`,\n`is_linked_from_other_organization` is `is_linked_from_other_avatar`, and\n`priority` is new.\n", "responses": { "200": { "description": "The title.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TitleResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b33", "name": "Coaching interactions", "is_enabled": false, "chunk_count": 18, "created_at": "2026-10-02T09:30:00.000Z", "is_linked_from_other_avatar": true, "priority": "normal" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "The Avatar has no such title. `error_code` is `title_not_found`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "patch": { "tags": [ "Content" ], "operationId": "updateContentTitle", "summary": "Rename a title, switch it on or off, or set its priority", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "parameters": [ { "in": "path", "name": "title_id", "required": true, "schema": { "type": "string" }, "description": "The id of the title." } ], "description": "Changes one title of the Avatar. Send at least one of `name`,\n`is_enabled` and `priority`. Every field is checked before any is\napplied, so a request with one invalid field changes nothing. The call\nanswers the title as it is afterwards.\n\n`priority` is the Avatar's own preference for the title, `high`,\n`normal` or `low`, and it applies to the Avatar's own titles and to\ntitles shared into the Avatar. Only a key issued by the Avatar's\ncurrent Owner may send it; any other key receives `403`\n`priority_owner_key_only` and nothing is changed. A title shared in\nfrom another Avatar accepts `priority` only: `name` and `is_enabled`\nanswer `400` `invalid_request` with the reason `not_editable`.\n\nA title with no active chunks cannot be switched on (`409`\n`title_empty`); switching a title off is always allowed. A title that\nis missing, deleted or not reachable by the Avatar answers `404`\n`title_not_found`. A title's weight, owner and description are not\npart of this operation: a body that names any other field answers\n`400` with the reason `unknown_field`.\n\nThe call needs the `write` scope and a key whose issuer manages the\nAvatar's members. It counts as one change in the Avatar's content\nlimit, whatever the number of fields. Over the limit it returns `429`;\nwhen the counting service is unavailable it returns `503`. Every\nresponse that counted carries `RateLimit-Limit`, `RateLimit-Remaining`\nand `RateLimit-Reset`.\n\nIt replaces `PUT /v1beta/content/titles/{title_id}` and\n`PUT /v1beta/content/titles/{title_id}/is_enabled`. `title_name` is\n`name` here.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateContentTitleRequest" }, "example": { "name": "Coaching for Scrum Masters", "is_enabled": true, "priority": "high" } } } }, "responses": { "200": { "description": "The title after the change.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TitleResponse" }, "example": { "result": "success", "response": { "id": "66a0d4e1c9b8f7a2d3e45f01", "name": "Coaching for Scrum Masters", "is_enabled": true, "chunk_count": 12, "created_at": "2026-11-14T15:04:05.000Z", "is_linked_from_other_avatar": false, "priority": "high" } } } } }, "400": { "description": "The body is not valid. `error_code` is `invalid_json`,\n`invalid_request` (the body names each field at fault in `fields`,\nwith the reasons `required`, `must_be_object`, `must_be_string`,\n`must_be_boolean`, `invalid_format`, `too_long`, `unknown_field`\nand `not_editable`) or `payload_too_large`.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "priority": "invalid_format" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No such title in this Avatar (`error_code` `title_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "409": { "description": "The title has no active chunks and cannot be switched on (`error_code` `title_empty`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "A title with no active chunks cannot be enabled.", "error_code": "title_empty", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is over 8,192 bytes (`error_code` `payload_too_large`, with `max_bytes`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 8192 } } } }, "415": { "description": "The content type is not `application/json` (`error_code` `unsupported_media_type`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/titles/{title_id}/chunks": { "get": { "tags": [ "Content" ], "operationId": "listContentTitleChunks", "summary": "List the chunks of a title", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Returns one page of the active chunks of one of the Avatar's own titles,\nordered by `id` ascending, which is the order the chunks were created in.\nA page holds `page_size` chunks, 50 by default and at most 100. `total` is\nthe number of active chunks the title holds. A chunk that was deleted is\nnot listed; read it by its id to see it with `is_active` false.\n\nA title that does not exist, a title that was deleted and a title that\nbelongs to another Avatar all answer `404` `title_not_found`.\n\nThe key needs the `read` scope, and the person who issued it must be an\nOwner or Admin of the Avatar. The call counts as one lookup in the\nAvatar's reading limit, shared by all the Avatar's keys. A request that a\ncheck refuses costs nothing.\n\nIt replaces `GET /v1beta/content/titles/{title_id}/chunks`, which listed\nevery chunk at once as `chunk_id`, `chunk_name` and `chunk_text` in a\n`chunks` list with `chunk_count`.\n", "parameters": [ { "name": "title_id", "in": "path", "required": true, "description": "The id of the title.", "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "description": "The page to return, counted from 1. Default 1.", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "required": false, "description": "The number of chunks a page holds, from 1 to 100. Default 50.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "responses": { "200": { "description": "One page of the title's active chunks.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChunkListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "65f1c2a9b7d3e4a1c8f09b21", "title_id": "65f1c2a9b7d3e4a1c8f09b20", "name": "Onboarding checklist", "text": "## Week one\n\nMeet your team and set up your tools.", "is_active": true } ], "page": 1, "page_size": 50, "total": 1 } } } } }, "400": { "description": "The `page` or `page_size` query is not a whole number in range. `error_code` is `invalid_page` or `invalid_page_size`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page size must be a whole number from 1 to 100.", "error_code": "invalid_page_size", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "The Avatar has no live title with this id. `error_code` is `title_not_found`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/titles/{title_id}/documents": { "get": { "tags": [ "Content" ], "operationId": "listTitleDocuments", "summary": "List the documents of a title", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Lists the source documents of one of the Avatar's own Content titles,\nnewest `uploaded_at` first and then by `id`, one page at a time. The key\nneeds the `read` scope and an issuer who manages the Avatar.\n\nEach document carries a `download_url`, a link to the original file that\nworks for 15 minutes; `download_url_expires_at` says when it stops. The\nlink is `null` for a document that is not active. Call the operation\nagain for a fresh link. A link opens the file without a key, so treat it\nas you would the file.\n\nOnly a title of the key's own Avatar is listed. A title that does not\nexist, that was deleted, that belongs to another Avatar or that is\nshared into this Avatar from another answers `404` `title_not_found`;\nthe answers are alike.\n\nA request that passes the checks counts as one lookup in the Avatar's\nreading limit: 15 lookups a minute for an Enterprise Avatar and 6 for an\nEssential Avatar, shared by all the Avatar's keys. A refused request\ncosts nothing. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `GET /v1beta/content/titles/{title_id}/documents`, whose\n`document_id`, `filetype`, `mimetype`, `filesize` and `upload_date` are\n`id`, `extension`, `content_type`, `size_bytes` and `uploaded_at` here.\nThe list is paged, and `document_count` is `total`.\n", "parameters": [ { "name": "title_id", "in": "path", "required": true, "description": "The id of a Content title of the Avatar.", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9_-]+$" }, "example": "65f1c2a9b7d3e4a1c8f09b21" }, { "name": "page", "in": "query", "required": false, "description": "The page to return, counting from 1. Default 1.", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "required": false, "description": "The most documents a page holds, 1 to 100. Default 50.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "responses": { "200": { "description": "One page of the title's documents.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentPageResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "65f1c2a9b7d3e4a1c8f09c01", "title_id": "65f1c2a9b7d3e4a1c8f09b21", "filename": "Team handbook.pdf", "extension": "pdf", "content_type": "application/pdf", "size_bytes": 482113, "uploaded_at": "2026-03-02T15:04:05.000Z", "is_active": true, "download_url": "https://files.example.com/documents/65f1c2a9b7d3e4a1c8f09c01?signature=example", "download_url_expires_at": "2026-03-02T15:19:05.000Z" } ], "page": 1, "page_size": 50, "total": 1 } } } } }, "400": { "description": "`page` or `page_size` is not a whole number in range. `error_code` is `invalid_page` or `invalid_page_size`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page size must be a whole number from 1 to 100.", "error_code": "invalid_page_size", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "The Avatar has no such title (`title_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/titles/{title_id}/footer": { "get": { "tags": [ "Content" ], "operationId": "getContentTitleFooter", "summary": "Get a title's footer", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "in": "path", "name": "title_id", "required": true, "description": "The id of one of the Avatar's own titles.", "schema": { "type": "string" } } ], "description": "Returns the footer the Avatar shows with content from one of its own\ntitles, for example an attribution or a licensing notice. When the title\nhas no footer of its own, the footer is the default of the Avatar's type:\n`id` is `null` and `is_default` is `true`.\n\nThe key needs the `read` scope, and the person who issued it must be the\nAvatar's Owner or an Avatar Admin. A title that does not exist, is\ndeleted, belongs to another Avatar or is only shared into this Avatar\nanswers `404` `title_not_found`, as does an id that cannot name a title.\n\nThe call counts as one lookup in the Avatar's reading limit: 15 lookups\na minute for an Enterprise Avatar and 6 for an Essential Avatar, shared\nby all the Avatar's keys. Over the limit it returns `429`. Every response\nthat counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`.\n\nIt replaces `GET /v1beta/content/titles/{title_id}/footer`. The response\nnames the footer `id` where `/v1beta` named it `footer_id`, and adds\n`title_id` and `is_default`.\n", "responses": { "200": { "description": "The footer the title shows.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FooterResponse" }, "example": { "result": "success", "response": { "id": "66a0d4e1c9b8f7a2d3e45f30", "title_id": "66a0d4e1c9b8f7a2d3e45f10", "footer_html": "

Source: Sprint planning guide

", "is_default": false } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No title of this Avatar has that id (`error_code` `title_not_found`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "put": { "tags": [ "Content" ], "operationId": "setContentTitleFooter", "summary": "Set the footer of a title", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_changes", "x-required-scope": "write", "parameters": [ { "name": "title_id", "in": "path", "required": true, "description": "The id of one of the Avatar's own Content titles.", "schema": { "type": "string" } } ], "description": "Sets the footer shown under the title's Content, and replaces the footer\nthe title already has. Send the whole footer each time: the call is an\nupsert and always answers `200`, whether the title had a footer or not.\nThe body is `{\"footer_html\": \"\"}` and nothing else. The HTML is\nsanitized before it is stored, and the response shows what was stored.\n\nThe title must be a title the Avatar owns and has not deleted. A title\nshared into the Avatar from another Avatar, a Foundation title, a deleted\ntitle and a title that does not exist all answer `404` `title_not_found`.\nAn Avatar whose type does not allow footer edits receives `403`\n`footer_not_editable`.\n\nThe key needs the `write` scope, and the person who issued it must\nmanage the Avatar's members (an Owner or an Admin). The call counts as\none change in the Avatar's Content-changes limit, shared by all the\nAvatar's keys and by `/v1beta`. A request refused by a check costs\nnothing against the limit. If the counting service is unavailable the\ncall answers `503` and changes nothing. Every response that counted\ncarries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `PUT /v1beta/content/titles/{title_id}/footer`. The response\nshows the whole footer (`id`, `title_id`, `footer_html`, `is_default`)\nwhere `/v1beta` showed `footer_id` and a message.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetFooterRequest" }, "example": { "footer_html": "

Prepared by Northwind Leadership Coaching.

" } } } }, "responses": { "200": { "description": "The footer as stored.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FooterResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b44", "title_id": "65f1c2a9b7d3e4a1c8f09b31", "footer_html": "

Prepared by Northwind Leadership Coaching.

", "is_default": false } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), or it is not an object\nholding exactly `footer_html` as a string of at most 500 characters\n(`invalid_request`, with `fields` naming each fault: `required`,\n`must_be_string`, `too_long`, `unknown_field` or `must_be_object`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "footer_html": "too_long" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call (`key_frozen`, `api_not_available`,\n`insufficient_scope`, `issuer_not_authorized` or\n`agreement_required`, as for every key operation), or the Avatar's\ntype does not allow footer edits (`footer_not_editable`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar's plan does not allow footer edits.", "error_code": "footer_not_editable", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "The Avatar has no such live title of its own.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The request body is too large.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "415": { "description": "The request is not `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/content/titles/{title_id}/uploads": { "parameters": [ { "in": "path", "name": "title_id", "required": true, "description": "The id of one of the Avatar's own Content titles.", "schema": { "type": "string" } } ], "post": { "tags": [ "Content" ], "operationId": "uploadContent", "summary": "Add a file or text to a Content title", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "content_uploads", "x-required-scope": "write", "description": "Adds a file or Markdown text to one of the Avatar's own Content titles.\nThe text of a file is read out of it (PDF, DOCX, PPTX and other common\nformats), divided into sections, embedded and stored, and the answer\nlists the sections created.\n\nSend a file as `multipart/form-data` with the part `file`, or send text\nas `application/json` with `text`. HTML in the text is converted to\nMarkdown. The optional `source_document_title` names the document the\ncontent comes from, at most 500 characters, and is kept on the\nsections. A request is at most 25 MiB; the size is measured on the\nbody as it arrives. A title that does not exist, is deleted, belongs\nto another Avatar or is shared in from another Avatar answers `404`\n`title_not_found`.\n\nThe key needs the `write` scope and must be one whose issuer still\nmanages the Avatar. Each upload counts as one in the Avatar's upload\nlimit: 120 a day for an Enterprise Avatar and 60 a day for an\nEssential Avatar, shared by all the Avatar's keys and counted for\n`/v1/` and `/v1beta/` together. Over the limit it returns `429`. When\nthe counting service is unavailable the upload is refused with `503`\nand is not counted. A request refused by a check costs nothing against\nthe limit. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `POST /v1beta/content/titles/{title_id}/upload`. The\n`files` part name is not accepted: use `file`. The success status is\n`201`, and the answer names the document and its sections.\n", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "file" ], "properties": { "file": { "type": "string", "format": "binary", "description": "The file to add." }, "source_document_title": { "type": "string", "maxLength": 500, "description": "The name of the document this upload represents." } } } }, "application/json": { "schema": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string", "description": "The text to add, as Markdown. HTML in it is converted to Markdown." }, "source_document_title": { "type": "string", "maxLength": 500, "description": "The name of the document this text represents." } } }, "example": { "text": "# Sprint planning\n\nA sprint planning meeting sets the goal for the next sprint.", "source_document_title": "Sprint planning guide" } } } }, "responses": { "201": { "description": "The upload was stored.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UploadResponse" }, "example": { "result": "success", "response": { "title_id": "66a0d4e1c9b8f7a2d3e45f01", "document_id": "0b6f2c1e-8a4d-4f0e-9a57-3d1c2b7e9a10", "chunk_ids": [ "66a0d4e1c9b8f7a2d3e45f60", "66a0d4e1c9b8f7a2d3e45f61" ], "chunk_count": 2 } } } } }, "400": { "description": "The request is not valid. `error_code` is `invalid_json` (the body is\nnot JSON), `invalid_request` (the body names `fields`, each with a\nreason such as `required`, `must_be_string`, `too_long` or\n`unknown_field`), `empty_file`, `file_type_not_allowed` or\n`no_text_extracted`.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "file": "required" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "The title does not exist or is not one of the Avatar's own titles.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such title in this Avatar.", "error_code": "title_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The request is over 25 MiB. `max_bytes` gives the limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 26214400 } } } }, "415": { "description": "The request is neither `multipart/form-data` nor `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "description": "The upload could not be completed, or the counting service is\nunavailable. `error_code` is `extraction_failed`, `embedding_failed`,\n`storage_failed` (nothing is stored; retry the upload) or\n`service_unavailable` (nothing was counted; `Retry-After` gives the\nseconds to wait).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The file could not be read. Try again shortly.", "error_code": "extraction_failed", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } } } } }, "/v1/interactions": { "get": { "tags": [ "Interactions" ], "operationId": "listInteractions", "summary": "List the Avatar's interactions", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "$ref": "#/components/parameters/Since" } ], "description": "Returns one page of the interactions with the Avatar the key is bound\nto, the newest first (the interaction's `id` orders interactions stored\nat the same moment, the greater `id` first). `total` counts every\ninteraction the key may read, whatever the page; a page past the end\nholds no items. The Avatar comes from the key, never from the request.\n\nA key reads what the person who issued it reads in the MaxGood.work web\napp, as the roles that person holds when the call arrives. `scope` says\nwhich members' interactions the list holds: `all` (every member's: the\nAvatar Owner, MaxGood.work staff, and an Avatar Admin on an Avatar type\nwithout the Avatar Coach role, who does not read the interactions of\nthe Owner and other Admins), `own_and_clients` (an Avatar Admin's own\nand their clients') or `clients` (an Avatar Coach's clients'). An\nissuer who left the Avatar, or who holds no Owner, Admin or Coach role,\nreads no interactions, and the call answers `403`\n`issuer_not_authorized`.\n\n`since` keeps the interactions stored at or after that moment: an RFC\n3339 timestamp (`2026-11-01T09:30:00Z`; a timestamp without an offset is\nUTC) or a date (`2026-11-01`, midnight UTC). A value that cannot be read\nis refused.\n\nEach interaction carries its text (`user_text` and `reply`) when its\n`access` is `content`. An interaction that the retention rules blanked,\nsuch as one of a member who has stopped, has `access` `metadata`, no\ntext, and a null `user_id`. `reference_chunk_ids` are the ids of the\nContent the reply cited, as MaxGood.work shows them to the Avatar's Owner\nand Admins.\n\nThe key needs the `read` scope. Interactions are member data, so the\ncall also needs a confirmed member-event endpoint: until the Avatar has\nadded one and attached this key to it the call answers `403`\n`member_events_endpoint_required`, and while the endpoint has been\nunreachable for 24 hours `403` `member_events_unreachable`. The call\ncounts as one lookup in the Avatar's reading limit, shared by all the\nAvatar's keys, once its query is valid. Every response that counted\ncarries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\nEach read is recorded in the Avatar's audit log.\n\nIt replaces `GET /v1beta/interactions`. The Avatar is `avatar_id` where\n`/v1beta` named it `org_id`, the cited Content is `reference_chunk_ids`\nwhere `/v1beta` named it `references`, the list is `items` where\n`/v1beta` named it `interactions`, and an issuer who reads nothing\nreceives `403` where `/v1beta` answered `404`.\n", "responses": { "200": { "description": "One page of interactions.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InteractionListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "65f1c2a9b7d3e4a1c8f09c01", "avatar_id": "65f1c2a9b7d3e4a1c8f09b21", "user_id": "65f1c2a9b7d3e4a1c8f09b77", "created_at": "2026-11-14T15:04:05.250Z", "access": "content", "reference_chunk_ids": [ "65f1c2a9b7d3e4a1c8f09d10" ], "user_text": "How should I prepare for my first one-to-one?", "reply": "Start by writing down the two outcomes you want from the meeting." }, { "id": "65f1c2a9b7d3e4a1c8f09c00", "avatar_id": "65f1c2a9b7d3e4a1c8f09b21", "user_id": null, "created_at": "2026-11-10T09:30:00.000Z", "access": "metadata", "reference_chunk_ids": [] } ], "page": 1, "page_size": 50, "total": 2, "access": "content", "scope": "all" } } } } }, "400": { "$ref": "#/components/responses/InvalidInteractionQuery" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members": { "post": { "tags": [ "Members" ], "operationId": "addMember", "summary": "Add a Member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "description": "Adds one person to the Avatar the key is bound to and answers with the\nnew Member. If the email has no account yet, MaxGood.work creates one;\neither way the person receives an invitation to the Avatar. The answer is\nthe same in both cases: it never tells you whether the email had an\naccount, and it never returns the `profile` values.\n\nThe body is one JSON object. `email` and `name` are required. The body is\nchecked strictly: a field that is not listed, a value of the wrong type\n(the string `\"false\"` is not a boolean) and an email that is not an\naddress answer `400` `invalid_request`, and `fields` names each refused\nfield with a short reason such as `required`, `must_be_string`,\n`must_be_boolean`, `invalid_format` or `unknown_field`. `notes` and\n`structured_data` are not part of adding a Member: sending either answers\n`400` with the reason `not_editable`. A value over its save limit answers\n`400` `field_too_long`, `field_too_large` or `field_not_object`, with\n`field` (a `profile` value is `profile.`) and `max_length`. The\nreply never repeats what you sent.\n\nThe key needs the `write` scope and must have been issued by a person who\nmanages the Avatar's members (its Owner, an Avatar Admin or MaxGood.work\nstaff); otherwise the call answers `403` `issuer_not_authorized`. Setting\n`is_admin` or `is_coach` to `true` needs a key issued by the Avatar's\nOwner or by MaxGood.work staff (`403` `role_change_owner_key_only`), and\n`is_coach` needs an Avatar whose plan has the Coach role (`403`\n`coach_role_not_enabled`). Member operations need the Avatar's\nmember-event endpoint to be confirmed (`403`\n`member_events_endpoint_required` or `member_events_unreachable`).\n\nA person who is already a Member answers `409` `already_member`. An\nAvatar with no open seat answers `409` `avatar_full` with `needed` and\n`open_seats`, and an Avatar at its member limit answers `403`\n`user_cap_reached`.\n\nThe call counts as one member change in the Avatar's daily limit, shared\nby all the Avatar's keys and by `/v1` and `/v1beta` together: 1,440 a day\nfor an Enterprise Avatar and 360 a day for an Essential Avatar. A day runs\nfrom 00:00 to 24:00 UTC. Over the limit the call answers `429` with\n`Retry-After`. A call refused by any check costs nothing against the\nlimit. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`.\n\nWhen MaxGood.work cannot read the limit's counter, the call answers `503`\n`service_unavailable` with `Retry-After` and adds nobody. Retry it.\n\nIt replaces `POST /v1beta/users`, whose answer was `user_id`, `email`,\n`name`, `existing_user` and `invitation_sent`.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateMemberRequest" }, "example": { "email": "pat.example@example.com", "name": "Pat Example", "license_expires_at": "2027-03-01", "profile": { "role": "Team lead" } } } } }, "responses": { "201": { "description": "The person was added.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f0a001", "email": "pat.example@example.com", "name": "Pat Example", "is_admin": false, "is_coach": false, "is_owner": false, "license_expires_at": "2027-03-01T00:00:00.000Z", "joined_at": "2026-12-01T15:04:05.123Z", "coach_user_id": null, "status": "active", "archived_at": null } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), is not valid\n(`invalid_request`, with `fields`), or holds a value over its save\nlimit (`field_too_long`, `field_too_large`, `field_not_object`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "email": "invalid_format", "notes": "not_editable" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "description": "The person is already a Member (`already_member`), or the Avatar has no\nopen seat (`avatar_full`, with `needed` and `open_seats`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar has no open seat.", "error_code": "avatar_full", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "needed": 1, "open_seats": 0 } } } }, "413": { "description": "The body is larger than 65,536 bytes. `max_bytes` gives the limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The `Content-Type` is not `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Members" ], "operationId": "listMembers", "summary": "List the Avatar's members", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" } ], "description": "Returns one page of the active members of the Avatar the key is bound\nto, the member who joined last first (the member's id breaks a tie).\n`total` counts every active member, whatever the page; a page past the\nend holds no items. A member who was removed or whose account was erased\nis not listed. The Avatar comes from the key, never from the request.\n\nThe key needs the `read` scope and an issuer who manages members (the\nAvatar's Owner or an Avatar Admin, or MaxGood.work staff). Member data\nalso needs a confirmed member-event endpoint: until the Avatar has added\none and attached this key to it the call answers `403`\n`member_events_endpoint_required`, and while the endpoint has been\nunreachable for 24 hours `403` `member_events_unreachable`. See the\nmember-event endpoint guide.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys, once its paging is valid. Every response that\ncounted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`.\n\nIt replaces `GET /v1beta/users`. A member's `id` is `user_id` there, and\n`license_expires_at` is `license_expiry_date`. The profile fields, notes\nand structured data are not part of a member here; notes and structured\ndata have their own endpoints.\n", "responses": { "200": { "description": "One page of members.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "65f1c2a9b7d3e4a1c8f09b21", "email": "jordan.lee@example.com", "name": "Jordan Lee", "is_admin": false, "is_coach": false, "is_owner": false, "license_expires_at": "2027-03-31T00:00:00.000Z", "joined_at": "2026-11-02T15:20:41.000Z", "coach_user_id": null, "status": "active", "archived_at": null } ], "page": 1, "page_size": 50, "total": 1 } } } } }, "400": { "$ref": "#/components/responses/InvalidPaging" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/batch": { "post": { "tags": [ "Members" ], "operationId": "createMembersBatch", "summary": "Add up to 100 members", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "description": "Adds 1 to 100 people to the Avatar the key is bound to in one request.\nThe body is `{\"users\": [...]}`, and each row has the fields of\n`POST /v1/members`: `email` and `name`, and optionally `is_admin`,\n`is_coach`, `license_expires_at` and `profile`. The body is checked\nstrictly: a field that is not listed (`notes` and `structured_data`\nincluded) and a value of the wrong type are refused.\n\nThe key needs the `write` scope and must have been issued by a person\nwho manages the Avatar's members (its Owner, an Avatar Admin or\nMaxGood.work staff). Only a key issued by the Avatar's Owner or by\nMaxGood.work staff may set `is_admin` or `is_coach`.\n\nThe request is checked in this order, and a request refused by any\ncheck writes nothing and costs nothing against a limit:\n\n1. The body: `400` `invalid_json`, `400` `invalid_request` when the body\n is not an object with the one field `users`, `400` `invalid_batch`\n when `users` is not a list of 1 to 100 rows, `413` and `415`.\n2. The key's issuer, for every row: `403` `role_change_owner_key_only`\n or `403` `coach_role_not_enabled`.\n3. The seats: `409` `avatar_full` with `needed` and `open_seats` when\n the Avatar has no open seat for every person in the list who needs\n one. A row that is invalid, repeated or already a member needs none.\n4. The limit: the call counts one for each row in the Avatar's daily\n member-change limit (1,440 for an Enterprise Avatar and 360 for an\n Essential Avatar), shared by all the Avatar's keys and by `/v1` and\n `/v1beta` together. A list that does not fit what is left of the day\n is refused whole with `429` and `Retry-After`. When MaxGood.work\n cannot read the limit's counter, the call answers `503`\n `service_unavailable` with `Retry-After` and adds nobody. Every\n response that counted carries `RateLimit-Limit`,\n `RateLimit-Remaining` and `RateLimit-Reset`.\n\nAfter these checks each row is added on its own, and a row that is\nrefused does not stop the rows after it. The answer is `200` with one\nresult for each row in request order. `status` is `added` (with the\nnew member's `id`), `already_member`, `invalid` or `failed`. A row with\n`status` `invalid` or `failed` has an `error_code`: `invalid_email`,\n`duplicate_email` (the second and later rows of one address),\n`invalid_request` (with `fields`), `avatar_full`, `user_cap_reached`,\n`rate_limited`, `coach_role_not_enabled`, `field_too_long`,\n`field_too_large`, `field_not_object`, `service_unavailable` or\n`internal_error`. The answer never says whether an address already had\nan account.\n\nIt replaces `POST /v1beta/users/batch`, whose `results` carry\n`user_id` and `existing_user` and whose `added` is `added_count` here.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateMembersBatchRequest" }, "example": { "users": [ { "email": "maria.santos@example.com", "name": "Maria Santos", "license_expires_at": "2027-06-30" }, { "email": "li.wei@example.com", "name": "Li Wei" } ] } } } }, "responses": { "200": { "description": "One result for each row, in request order.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchMembersResponse" }, "example": { "result": "success", "response": { "results": [ { "index": 0, "email": "maria.santos@example.com", "status": "added", "id": "65f1c2a9b7d3e4a1c8f09c01" }, { "index": 1, "email": "li.wei@example.com", "status": "already_member" } ], "added_count": 1 } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), is not an object with\nthe one field `users` (`invalid_request`, with `fields`), or holds no\nlist of 1 to 100 rows (`invalid_batch`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The batch must hold 1 to 100 members.", "error_code": "invalid_batch", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "description": "The Avatar has no open seat for everyone in the list who needs one. Nobody was added.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar has no open seat.", "error_code": "avatar_full", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "needed": 3, "open_seats": 1 } } } }, "413": { "description": "The body is larger than 65,536 bytes. `max_bytes` gives the limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The `Content-Type` is not `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}": { "delete": { "tags": [ "Members" ], "operationId": "deleteMember", "summary": "Remove a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member to remove, as `GET /v1/members` returns it.", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "description": "Ends the person's membership in the Avatar of the key. Their account and\ntheir memberships in other Avatars stay. The membership's notes, structured\ndata and licence date are cleared with it, and adding the person again\nstarts a new membership. The Avatar's member-event endpoint receives a\n`member.removed` event for the removal.\n\nThe Avatar's Owner is never removed, with any key (`403`\n`owner_not_removable`). An Admin or a Coach is removed only with a key\nissued by the Avatar's current Owner or by MaxGood.work staff (`403`\n`role_change_owner_key_only`). Every other member is removed with any key\nwhose issuer manages members. A refusal is recorded in the Avatar's audit\nlog and writes nothing else.\n\nA person who is not a member of the Avatar, is unknown, or has been erased\nanswers `404` `user_not_found`; the answer is the same for all three.\n\nThe call counts as one change in the Avatar's member-changes limit, shared\nby all the Avatar's keys. Over the limit it returns `429`.\n\nIt replaces `DELETE /v1beta/users/{user_id}`.\n", "responses": { "200": { "description": "The membership is ended.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberDeletedResponse" }, "example": { "result": "success", "response": { "id": "7c1d5e0a9b2f4c36a8e1d0b4f5a96c27", "deleted": true } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is `owner_not_removable`\n(the member is the Avatar's Owner), `role_change_owner_key_only` (the\nmember is an Admin or a Coach and the key was not issued by the Owner\nor MaxGood.work staff), `member_events_endpoint_required` or\n`member_events_unreachable` (the Avatar's member-event endpoint is\nmissing or unreachable), or one of the key refusals every key\noperation can answer (`key_frozen`, `api_not_available`,\n`insufficient_scope`, `issuer_not_authorized`, `agreement_required`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Owner cannot be removed.", "error_code": "owner_not_removable", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such member in this Avatar.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Members" ], "operationId": "getMember", "summary": "Get one Member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Returns one Member of the Avatar the key is bound to: the person's\nstanding in this Avatar only. The record holds the member's id, email\nand name, their roles, licence date, Avatar Coach, status and the dates\nthey joined and were archived. It holds no notes, structured data,\nFacts, tags or Files; those have their own endpoints. Fields a person\nkeeps across Avatars, such as their role, industry and goal, are never\nreturned.\n\nA Member whose licence has expired or who is archived is returned, with\nthe `status` that says so. A person who is unknown, who is not a Member\nof this Avatar, who was removed from it or whose account was erased\nreceives the same `404` `user_not_found`, so the response tells nothing\nabout people outside the Avatar. A `user_id` that cannot be a Member id\nalso receives `404`.\n\nThe key's issuer must be the Avatar's Owner, an Avatar Admin or\nMaxGood.work staff: a key issued by anyone else receives `403`\n`issuer_not_authorized`. Member access also needs a confirmed\nmember-event endpoint attached to the key: without one the call\nreceives `403` `member_events_endpoint_required`, and when the endpoint\nhas been unreachable for 24 hours, `403` `member_events_unreachable`.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys. A request refused before the lookup, including a\nmalformed `user_id`, costs nothing. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `GET /v1beta/users/{user_id}`. `id` is the `user_id` of\n`/v1beta`, `license_expires_at` is `license_expiry_date`, and the\nprofile fields, `notes` and `structured_data` are not returned.\n", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The Member's id, as `GET /v1/members` returns it.", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9_-]+$" } } ], "responses": { "200": { "description": "The Member.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b44", "email": "una.example@example.com", "name": "Una Example", "is_admin": false, "is_coach": false, "is_owner": false, "license_expires_at": "2027-06-30T00:00:00Z", "joined_at": "2026-03-12T15:04:05Z", "coach_user_id": null, "status": "active", "archived_at": null } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No such Member in this Avatar (`error_code` `user_not_found`): the id\nis unknown, is not a Member of the Avatar, was removed or was erased,\nor cannot be a Member id.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "patch": { "tags": [ "Members" ], "operationId": "updateMember", "summary": "Update a member's roles and licence date", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The member's `id`.", "schema": { "type": "string", "minLength": 1, "maxLength": 128 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberUpdate" }, "example": { "is_admin": true, "license_expires_at": "2027-06-30" } } } }, "description": "Changes the per-Avatar fields of one member: `is_admin`, `is_coach` and\n`license_expires_at`. Send at least one; a field that is not sent stays as\nit is, and `license_expires_at` set to `null` removes the end date. The\nresponse is the member as stored.\n\nThe checks run in this order, and a refused request changes nothing and\ncosts nothing against a limit:\n\n1. The key's checks, then the member-event endpoint check that every\n member operation makes.\n2. `400` `invalid_json`, `invalid_request` (the `fields` object names each\n field and the reason: `must_be_boolean`, `invalid_format`,\n `not_editable`, `unknown_field`, and `required` at the empty path for a\n body with none of the three fields), `413` and `415`.\n3. `404` `user_not_found` for a person who is not an active member of the\n Avatar.\n4. `403` `role_change_owner_key_only` when a role would change and the key\n was not issued by the Avatar's Owner (or by MaxGood.work staff);\n `403` `coach_role_not_enabled` when `is_coach` would become `true` on\n an Avatar type with no Coach role. Re-sending the stored values changes\n nothing and is accepted from any key.\n5. The change counts as one call in the Avatar's member-change limit, then\n is written in one step.\n\nIt replaces the role and licence fields of `PUT /v1beta/users/{user_id}`.\n`license_expiry_date` is `license_expires_at` here and `is_admin` and\n`is_coach` must be JSON booleans. `notes` and `structured_data` have their\nown operations.\n", "responses": { "200": { "description": "The member after the change.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberUpdateResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b13", "email": "sam.rivera@example.com", "name": "Sam Rivera", "is_admin": true, "is_coach": false, "is_owner": false, "license_expires_at": "2027-06-30T00:00:00Z", "joined_at": "2026-03-02T15:04:05Z", "coach_user_id": null, "status": "active", "archived_at": null } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`) or a field is not valid (`invalid_request`, with `fields`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "license_expires_at": "invalid_format" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No such member in this Avatar (`user_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is larger than `max_bytes` (`payload_too_large`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The body is not `application/json` (`unsupported_media_type`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/archive": { "post": { "tags": [ "Members" ], "operationId": "archiveMember", "summary": "Archive a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member, as the `id` of a Member.", "schema": { "type": "string" } } ], "description": "Pauses a member of the key's Avatar. Everything stored about the member\nstays: notes, structured data, the Coach link, the licence date, User\nFiles and interactions. The member cannot chat with the Avatar, leaves the\nAvatar dropdown and holds no seat. `unarchive` restores the member exactly.\nThe call takes no body; a body is ignored. It is idempotent: archiving a\nmember who is already archived answers `200` with the same Member and\nchanges nothing.\n\nThe Owner, an Admin and the members of the MaxGood.work User Support\nAvatar cannot be archived, and the account of an erased member cannot be\nchanged.\n\nThe key's issuer must be an Avatar Owner, an Avatar Admin or MaxGood.work\nstaff; a key issued by anyone else receives `403` `issuer_not_authorized`.\nThe Avatar needs its member-event endpoint attached and verified\n(`member_events_endpoint_required`), and the endpoint must be reachable\n(`member_events_unreachable`).\n\nA change counts as one in the Avatar's member-change limit: 1440 a day\nfor an Enterprise Avatar and 360 a day for an Essential Avatar, shared by\nall the Avatar's keys. A request refused by any check costs nothing. Every\nresponse that counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`.\n\nIt replaces `POST /v1beta/users/{user_id}/archive`. The response is the\nMember, not the `/v1beta` user object, and a refusal is the failure shape\nwith an `error_code` of its own, without `error` and `message`.\n", "responses": { "200": { "description": "The Member, with `status` `archived` and `archived_at` set.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09c77", "email": "casey.lee@example.com", "name": "Casey Lee", "is_admin": false, "is_coach": false, "is_owner": false, "license_expires_at": null, "joined_at": "2026-03-18T14:05:09.000Z", "coach_user_id": null, "status": "archived", "archived_at": "2026-11-30T15:20:00.000Z" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is one of the key checks\n(`key_frozen`, `api_not_available`, `insufficient_scope`,\n`agreement_required`), `issuer_not_authorized` (the person who issued\nthe key may not archive members), `member_events_endpoint_required`\nor `member_events_unreachable` (the Avatar's member-event endpoint),\n`owner_not_archivable`, `admin_not_archivable` or\n`support_avatar_not_archivable` (this member cannot be archived).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Owner cannot be archived.", "error_code": "owner_not_archivable", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such member in this Avatar (`error_code` `user_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "409": { "description": "The member's account has been erased and cannot be changed (`error_code` `member_erased`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This member's account has been erased.", "error_code": "member_erased", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/coach": { "put": { "tags": [ "Members" ], "operationId": "setMemberCoach", "summary": "Assign or remove a member's Coach", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The `id` of the member whose Coach changes.", "schema": { "type": "string" } } ], "description": "Makes the member named by `coach_user_id` the Coach of the member in the\npath, or leaves that member without a Coach when `coach_user_id` is\n`null`. The call replaces the member's one Coach, so it is a `PUT`. It\nanswers the member as it is afterwards, also when the member already had\nthat Coach.\n\nOnly an Avatar whose plan has the Coach role has Coaches. The Coach is a\nmember of the Avatar who holds the Coach role and is not the member\nthemself. The Owner has no Coach. A key issued by the Owner or by\nMaxGood.work staff may assign any Coach to any member who is not the\nOwner. A key issued by an Admin may not assign a Coach to another Admin\nand may not name its own issuer as the Coach. A key whose issuer holds\nneither role is refused.\n\nThe body is exactly `{\"coach_user_id\": }`: any other field is\nrefused, and the answer to a body that is not an object, or that names a\nfield other than `coach_user_id`, is `invalid_request` with `fields`.\n\nThe call counts as one change in the Avatar's member-change limit,\nshared by all the Avatar's keys and counted for `/v1/` and `/v1beta/`\ntogether. A call refused by a check counts for nothing. Every response\nthat counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`.\n\nIt replaces `PUT /v1beta/users/{user_id}/coach`, whose `user_id` is `id`\nhere and whose answer is the member in the `/v1` shape. The `/v1beta`\nrefusal `not_org_admin` is `issuer_not_authorized` here, and a person who\nis not a member of the Avatar is `user_not_found`.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CoachAssignmentRequest" }, "example": { "coach_user_id": "65f1c2a9b7d3e4a1c8f09b21" } } } }, "responses": { "200": { "description": "The member, with the Coach the call set.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CoachAssignmentResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b33", "email": "member@example.com", "name": "Casey Member", "is_admin": false, "is_coach": false, "is_owner": false, "license_expires_at": null, "joined_at": "2026-03-02T14:05:09.000Z", "coach_user_id": "65f1c2a9b7d3e4a1c8f09b21", "status": "active", "archived_at": null } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), is not an object or names\nanother field (`invalid_request`, with `fields`), carries no usable\n`coach_user_id` (`coach_user_id_required`), names the member as their\nown Coach (`coach_is_client`) or names a member who is not a Coach\n(`not_a_coach`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "A coach user id is required.", "error_code": "coach_user_id_required", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call: `key_frozen`, `api_not_available`,\n`insufficient_scope`, `issuer_not_authorized` (the person who issued\nthe key may not assign Coaches), `agreement_required`,\n`member_events_endpoint_required`, `member_events_unreachable`,\n`coach_role_not_enabled` (the Avatar's plan has no Coach role),\n`owner_has_no_coach` or `coach_assign_owner_only` (only the Owner's\nkey assigns a Coach to an Admin or names the key's own issuer).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar's plan has no Coach role.", "error_code": "coach_role_not_enabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "The Avatar has no such member.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is over the size limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 1048576 } } } }, "415": { "description": "The request is not sent as `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/facts": { "post": { "tags": [ "Facts" ], "operationId": "createMemberFact", "summary": "Add a Fact about a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member the Fact is about.", "schema": { "type": "string" } } ], "description": "Adds one Fact about one member to the Avatar the key is bound to. A\nFact is a short statement the Avatar keeps in mind and weaves into its\nreplies to that member. The body holds `text` and nothing else. A Fact\nabout the Avatar itself is added with `POST /v1/content/facts`.\n\nThe key needs the `write` scope, and the Avatar needs a confirmed\nmember-event endpoint. The Fact is recorded as added by the person who\nissued the key, who can edit it in the MaxGood.work web app under the\nsame rules. The Avatar's Owner and Admins add a Fact about any active\nmember. An Avatar Coach adds a Fact only about a current client; for\nany other person the answer is `403` `fact_clients_only`.\n\nThe Avatar's type decides the largest Fact (`max_tokens`) and the total\nits active Facts may hold, the Avatar's own Facts and its members'\nFacts together (`max_tokens` of `fact_budget_exceeded`). The total is\nchecked while no other Fact of the Avatar is being added, changed or\nswitched on, so two requests together cannot pass it, and a request\nrefused for the budget writes nothing.\n\nThe add counts as one change in the Avatar's member-change limit,\nshared by all its keys on `/v1/` and `/v1beta/`. A request refused\nbefore the add costs nothing against the limit, and every response that\ncounted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`.\n\nIt is the member half of `POST /v1beta/facts`.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberFactCreateRequest" }, "example": { "text": "Prefers one concrete next step at the end of each reply." } } } }, "responses": { "201": { "description": "The Fact that was added.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberFactResponse" }, "example": { "result": "success", "response": { "id": "418", "user_id": "7c2d9e4b1a3f4685b0e1d2c3a4b5f607", "text": "Prefers one concrete next step at the end of each reply.", "token_count": 11, "status": "active", "source": "owner", "created_by_user_id": "3b9e1f6a2c8d4e57b0a1c9d8e7f64a35", "created_at": "2026-12-01T10:15:00.000Z", "updated_at": "2026-12-01T10:15:00.000Z", "version_count": 0, "access": "edit" } } } } }, "400": { "description": "The body is not acceptable. `error_code` is `invalid_json` (the body\nis not JSON), `invalid_request` (the body is not an object, holds a\nfield other than `text`, or `text` is not a string; `fields` names\nthe field and the reason), `fact_text_required` (`text` is missing,\nempty or only spaces) or `fact_too_long` (`text` is over 2,000\ncharacters, `max_characters`, or over the Avatar type's largest Fact,\n`token_count` and `max_tokens`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact text is required.", "error_code": "fact_text_required", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not add this Fact. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body\nnames `required_scope`), `issuer_not_authorized`,\n`agreement_required` (the body names `agreement_party` and\n`agreement_url`), `member_events_endpoint_required` or\n`member_events_unreachable` (the Avatar has no confirmed\nmember-event endpoint), `facts_disabled` (the Avatar's type keeps no\nFacts) or `fact_clients_only` (the issuer is an Avatar Coach and the\nperson is not a current client).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Memory is off for this Avatar.", "error_code": "facts_disabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "`user_not_found`: the id is not an active member of the Avatar, or\nthe member is erased.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "409": { "description": "The Fact would take the Avatar's active Facts past the total its\ntype allows (`error_code` `fact_budget_exceeded`). The body names\n`active_tokens` (what the active Facts hold now), `max_tokens` (the\ntotal) and `token_count` (this Fact). Hide or delete a Fact, or\nshorten this one, and send the request again.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact budget is used up.", "error_code": "fact_budget_exceeded", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "active_tokens": 480, "max_tokens": 500, "token_count": 40 } } } }, "413": { "description": "The body is over 65,536 bytes (`max_bytes`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The request is not sent as `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Facts" ], "operationId": "listMemberFacts", "summary": "List the Facts about a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member.", "schema": { "type": "string" } }, { "name": "status", "in": "query", "required": false, "description": "Keep the Facts with this status. `all` (the default) keeps every Fact.", "schema": { "type": "string", "enum": [ "active", "hidden", "all" ], "default": "all" } }, { "name": "page", "in": "query", "required": false, "description": "The page to return, from 1.", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "required": false, "description": "The number of Facts on a page, from 1 to 100.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "description": "Lists the Facts the Avatar keeps about one member, in ascending order of\ntheir numeric `id`. A Fact is one short statement the Avatar weaves\ninto its replies to that member. The list holds only Facts about this\nmember; the Avatar's own Facts belong to the Avatar's content.\n\nThe list shows the Facts the person who issued the key may see in the\nMaxGood.work web app. The Avatar's Owner and Admins see every Fact\nabout the member. An Avatar Coach sees the Facts about their current\nclients only. Each Fact carries `access`: `edit` when that person may\nchange it and `view` when they may only read it. The author of a Fact\n(`created_by_user_id`) is `null` where that person may not see who\nwrote it. `version_count` is the number of earlier versions of the\nFact's text, and is `null` when the Avatar's type keeps no edit history.\n\n`limits` reports the Avatar type's limits and the tokens the Avatar's\nactive Facts use now: `per_fact_tokens` is the most one Fact may hold,\n`total_tokens` the most all the Avatar's active Facts may hold together\n(the Avatar's own Facts and its members' Facts count toward the same\ntotal), `active_tokens` what they use now, and `history_tracked`\nwhether the type keeps edit history.\n\n`page` starts at 1 and `page_size` goes from 1 to 100. A value outside\nthose ranges, or one that is not a whole number, returns `400` with\n`invalid_page` or `invalid_page_size`; the API never adjusts it. A page\npast the last one returns an empty `items` list. `status` must be\n`active`, `hidden` or `all`, in lower case, or the call returns `400`\n`invalid_status`. `total` counts every Fact about the member that\nmatches, across pages.\n\nA `user_id` that is not an active member of the Avatar, an erased\nmember, and a member the issuer may not reach all return `404`\n`user_not_found`. An Avatar whose type keeps no Facts returns `403`\n`facts_disabled`.\n\nThe key needs the `read` scope, and the Avatar needs a confirmed\nmember-event endpoint, or the call returns `403`\n`member_events_endpoint_required` or `member_events_unreachable`.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys; a call refused by a check counts for nothing.\nOver the limit it returns `429`. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `GET /v1beta/facts`: the `user_id` filter is the path, and\n`scope` is gone.\n", "responses": { "200": { "description": "One page of the Facts about the member.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberFactListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "418", "user_id": "7c2d9e4b1a3f4685b0e1d2c3a4b5f607", "text": "Prefers one concrete action step at the end of each reply.", "token_count": 11, "status": "active", "source": "coach", "created_by_user_id": "3b9e1f6a2c8d4e57b0a1c9d8e7f64a35", "created_at": "2026-11-12T10:20:30.000Z", "updated_at": "2026-11-12T10:20:30.000Z", "version_count": 0, "access": "edit" } ], "page": 1, "page_size": 50, "total": 1, "limits": { "per_fact_tokens": 60, "total_tokens": 2000, "active_tokens": 23, "history_tracked": true } } } } } }, "400": { "description": "The paging or the status filter is not valid (`error_code`\n`invalid_page`, `invalid_page_size` or `invalid_status`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page size must be a whole number from 1 to 100.", "error_code": "invalid_page_size", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body\nnames `required_scope`), `agreement_required` (the body names\n`agreement_party` and `agreement_url`), `member_events_endpoint_required`\nor `member_events_unreachable` (the Avatar has no confirmed\nmember-event endpoint) or `facts_disabled` (the Avatar's type keeps\nno Facts).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Memory is off for this Avatar.", "error_code": "facts_disabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "There is no such member for this key (`error_code`\n`user_not_found`): the id is unknown, the person is not an active\nmember of the Avatar, was erased, or is not one the key's issuer\nmay reach.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/facts/{fact_id}": { "delete": { "tags": [ "Members" ], "operationId": "deleteMemberFact", "summary": "Delete a member's Fact", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member the Fact is about, as `GET /v1/members` returns it.", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "fact_id", "in": "path", "required": true, "description": "The id of the Fact, written as plain digits.", "schema": { "type": "string", "pattern": "^[1-9][0-9]{0,9}$" }, "example": "412" } ], "description": "Deletes one Fact the Avatar keeps about a member, together with its edit\nhistory. The deletion cannot be undone. To keep a Fact and stop the\nAvatar using it, hide it with `PATCH /v1/members/{user_id}/facts/{fact_id}`.\n\nThe call needs a key with the `write` scope whose issuer may change the\nFact: the Avatar's Owner, an Avatar Admin, MaxGood.work staff acting for\nthe Avatar, or an Avatar Coach for a Fact about one of their own clients\nthat the Coach added. A key whose issuer holds no role over Facts answers\n`403` `issuer_not_authorized`. A Fact the issuer may read but not change\nanswers `403` `fact_view_only`. An Avatar whose type has no Facts answers\n`403` `facts_disabled`. The Avatar needs a confirmed member-event\nendpoint.\n\nA person who is unknown, is not a member of the Avatar or has been erased\nanswers `404` `user_not_found`; the answer is the same for all three. An\nid that names no Fact, an Avatar-wide Fact, a Fact about another member\nand a Fact of another Avatar all answer `404` `fact_not_found`.\n\nThe deletion counts as one change in the Avatar's member-changes limit,\nshared by all the Avatar's keys, once every other check has passed; a\nrefused request costs nothing. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `DELETE /v1beta/facts/{fact_id}` for a Fact about a member.\nThe response names the Fact `id` as a string where `/v1beta` answered\n`fact_id` as a number.\n", "responses": { "200": { "description": "The Fact is deleted.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletedResponse" }, "example": { "result": "success", "response": { "id": "412", "deleted": true } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is one of\nthe key checks (`key_frozen`, `api_not_available`,\n`insufficient_scope`, `agreement_required`), `issuer_not_authorized`\n(the issuer holds no role over Facts), `member_events_endpoint_required`\nor `member_events_unreachable` (the Avatar's member-event endpoint is\nmissing or unreachable), `facts_disabled` (the Avatar's type has no\nFacts) or `fact_view_only` (the issuer may read this Fact and not\nchange it).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This key may only view this Fact.", "error_code": "fact_view_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such member in this Avatar (`user_not_found`), or no such Fact about that member (`fact_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Members" ], "operationId": "getMemberFact", "summary": "Get one Fact about a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member the Fact is about, from `GET /v1/members`.", "schema": { "type": "string", "minLength": 1, "maxLength": 64 }, "example": "65f1c2a9b7d3e4a1c8f09b21" }, { "name": "fact_id", "in": "path", "required": true, "description": "The id of the Fact, a whole number written in digits, for example 123.", "schema": { "type": "string", "minLength": 1, "maxLength": 10 }, "example": "123" } ], "description": "Returns one Fact the Avatar keeps about one of its members. A Fact is a\nshort statement the Avatar weaves into its replies to that member. The\nkey's issuer sees the Facts they could see in the MaxGood.work web app:\nthe Avatar's Owner and Admins see the Facts they may see about any\nmember, and an Avatar Coach sees the Facts about their own clients.\n\n`404` `user_not_found` answers when the member does not exist, is not an\nactive member of the Avatar, has erased their account, or (for an Avatar\nCoach) is not one of the issuer's clients. `404` `fact_not_found`\nanswers in one body for an id that is not a whole number, a Fact that\ndoes not exist, a Fact of another Avatar, a Fact about the Avatar\nitself, a Fact about another member, and a Fact the key's issuer may not\nsee. `403` `facts_disabled` answers when the Avatar's type has no Facts.\n\nMember data needs a confirmed member-event endpoint: until the Avatar\nhas added one and attached this key to it the call answers `403`\n`member_events_endpoint_required`, and while the endpoint has been\nunreachable for 24 hours `403` `member_events_unreachable`.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys, once the request has passed its checks. Every\nresponse that counted carries `RateLimit-Limit`, `RateLimit-Remaining`\nand `RateLimit-Reset`. The read is recorded in the Avatar's audit trail\nwith the Fact's id and the member's id and never the Fact's text.\n\nIt replaces `GET /v1beta/facts/{fact_id}` for a Fact about a member. The\nresponse has no `scope`: the path says which kind of Fact it is, `id` is\na string and the member is `user_id`.\n", "responses": { "200": { "description": "The Fact.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberFactResponse" }, "example": { "result": "success", "response": { "id": "123", "user_id": "65f1c2a9b7d3e4a1c8f09b21", "text": "Prefers morning calls and a short written summary.", "token_count": 9, "status": "active", "source": "owner", "created_by_user_id": "65f1c2a9b7d3e4a1c8f09b99", "created_at": "2026-11-01T09:30:00.000Z", "updated_at": "2026-11-02T10:00:00.000Z", "version_count": 2, "access": "edit" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body names\n`required_scope`), `issuer_not_authorized`, `agreement_required` (the\nbody names `agreement_party` and `agreement_url`),\n`member_events_endpoint_required`, `member_events_unreachable` or\n`facts_disabled` (the Avatar's type has no Facts).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Memory is off for this Avatar.", "error_code": "facts_disabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such member, or no such Fact about this member, for this key. `error_code` is `user_not_found` or `fact_not_found`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "patch": { "tags": [ "Members" ], "operationId": "updateMemberFact", "summary": "Change a Fact about a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member the Fact is about, as the member operations return it.", "schema": { "type": "string" } }, { "name": "fact_id", "in": "path", "required": true, "description": "The id of the Fact, as the other Fact operations return it.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMemberFactRequest" }, "example": { "text": "Prefers a short summary before the detail.", "status": "active" } } } }, "description": "Changes the text of one Fact about a member, its status, or both, and\nreturns the Fact. The whole change is one step: the new text, the new\nstatus and the saved earlier version of the text (on an Avatar type that\nkeeps a Fact history) are written together or not at all, so a refused\nchange leaves the Fact as it was.\n\nThe Avatar's total Fact limit is checked against the Fact as it will\nstand after the change. A Fact that stays hidden never counts against\nit. Showing a hidden Fact, or making an active Fact longer, answers `409`\n`fact_budget_exceeded` when the Avatar's active Facts would pass the\nlimit; the body names `active_tokens` and `max_tokens`.\n\nThe key needs the `write` scope and an issuer who may change the Fact in\nthe MaxGood.work web app: the Avatar's Owner, an Avatar Admin (not for a\nFact an Avatar Coach added, `403` `fact_view_only`) or MaxGood.work\nstaff, or an Avatar Coach for Facts about their own clients (`403`\n`fact_clients_only` otherwise). A Fact of the whole Avatar, a Fact about\nanother member, a Fact of another Avatar, a Fact the issuer may not see\nand an id that is not a whole number all answer `404` `fact_not_found`;\na member the Avatar does not have answers `404` `user_not_found`.\n\nMember data needs a confirmed member-event endpoint: until the Avatar has\nadded one and attached this key to it the call answers `403`\n`member_events_endpoint_required`, and while the endpoint has been\nunreachable for 24 hours `403` `member_events_unreachable`. See the\nmember-event endpoint guide.\n\nThe change counts as one change in the Avatar's daily limit for member\nchanges, shared by all the Avatar's keys. A request refused before the\nchange is made costs nothing. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `PATCH /v1beta/facts/{fact_id}`: that endpoint's `scope` and\n`user_id` are in the path here, and the Fact has a string `id`.\n", "responses": { "200": { "description": "The Fact after the change.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMemberFactResponse" }, "example": { "result": "success", "response": { "id": "412", "user_id": "65f1c2a9b7d3e4a1c8f09b44", "text": "Prefers a short summary before the detail.", "token_count": 9, "status": "active", "source": "owner", "created_by_user_id": "65f1c2a9b7d3e4a1c8f09b13", "created_at": "2026-11-02T14:05:09.000Z", "updated_at": "2026-11-30T09:12:41.000Z", "version_count": 2, "access": "edit" } } } } }, "400": { "description": "The request is not valid. `error_code` is `invalid_json` (the body is\nnot JSON), `invalid_request` (the body is not an object, holds a field\nthat is not listed, or holds neither `status` nor `text`; `fields`\nnames each field), `invalid_status` (`status` is not `active` or\n`hidden`), `fact_text_required` (`text` is not a non-empty string) or\n`fact_too_long` (the text is over 2000 characters, with\n`max_characters`, or over the Avatar's limit for one Fact, with\n`token_count` and `max_tokens`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact text is too long.", "error_code": "fact_too_long", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_tokens": 64, "token_count": 101 } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is one of the key\nrefusals (`key_frozen`, `api_not_available`, `insufficient_scope`,\n`agreement_required`), `member_events_endpoint_required` or\n`member_events_unreachable` (the member-event endpoint), `facts_disabled`\n(the Avatar's type keeps no Facts), `fact_view_only` (the issuer may\nread this Fact and not change it) or `fact_clients_only` (the issuer\nis an Avatar Coach and the Fact is not about one of their clients).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This key may only view this Fact.", "error_code": "fact_view_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such Fact for this member (`fact_not_found`), or no such member in\nthis Avatar (`user_not_found`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "409": { "description": "The change would take the Avatar's active Facts past their total\nlimit (`fact_budget_exceeded`, with `active_tokens` and\n`max_tokens`). Nothing was changed.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The Fact budget is used up.", "error_code": "fact_budget_exceeded", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "active_tokens": 4096, "max_tokens": 4096 } } } }, "413": { "description": "The body is larger than the endpoint accepts (`payload_too_large`, with `max_bytes`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The body is not sent as `application/json` (`unsupported_media_type`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/facts/{fact_id}/history": { "get": { "tags": [ "Members" ], "operationId": "listMemberFactHistory", "summary": "List the edit history of a Fact about a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member the Fact is about.", "schema": { "type": "string" }, "example": "65f1c2a9b7d3e4a1c8f09b13" }, { "name": "fact_id", "in": "path", "required": true, "description": "The id of a Fact about that member.", "schema": { "type": "string" }, "example": "123" }, { "name": "page", "in": "query", "required": false, "description": "The page to return, counted from 1. The default is 1.", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "required": false, "description": "How many versions a page holds, from 1 to 100. The default is 50.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "description": "Returns the earlier texts of one Fact about a member, newest edit first.\nEach version is the text the Fact held before an edit. Only an Enterprise\nAvatar keeps a Fact's edit history; any other Avatar type receives `403`\n`fact_history_not_enabled`. A Fact that does not exist, is one of the\nAvatar's own Facts, is about another member, or may not be viewed by the\nissuer of the key answers `404` `fact_not_found`. A `user_id` that names\nno active member of the Avatar answers `404` `user_not_found`.\n\nThe key needs the `read` scope and an issuer who may view the Facts about\nthe member: the Avatar's Owner, an Admin, MaxGood.work staff acting as\nOwner, or a Coach for a current client. A key reaches a member's data\nonly while it is attached to a confirmed member-event endpoint that\nanswers; otherwise the call answers `403` `member_events_endpoint_required`\nor `member_events_unreachable`. The call counts as one lookup in the\nAvatar's reading limit. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`. Each read\nis recorded in the Avatar's audit trail with the Fact's id, the member's\nid and the number of versions returned, never a Fact's text.\n\nIt replaces `GET /v1beta/facts/{fact_id}/history` for the Facts about a\nmember; the Avatar's own Facts are read at\n`GET /v1/content/facts/{fact_id}/history`.\n", "responses": { "200": { "description": "One page of the Fact's versions.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FactHistoryResponse" }, "example": { "result": "success", "response": { "fact_id": "123", "items": [ { "id": "41", "fact_id": "123", "text": "Prefers evening sessions.", "token_count": 4, "edited_at": "2026-11-02T15:20:41.125Z", "edited_by_user_id": "65f1c2a9b7d3e4a1c8f09b13", "edit_source": "owner" } ], "page": 1, "page_size": 50, "total": 1 } } } } }, "400": { "description": "The page or the page size is not valid.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page must be a whole number of at least 1.", "error_code": "invalid_page", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`facts_disabled` (the Avatar's type has no Facts),\n`fact_history_not_enabled` (the Avatar's type keeps no edit\nhistory), `member_events_endpoint_required` or\n`member_events_unreachable` (the key's member-event endpoint is\nmissing or not answering), or one of the key checks of\n`GET /v1/avatar` (`key_frozen`, `api_not_available`,\n`insufficient_scope`, `agreement_required`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar keeps no Fact history.", "error_code": "fact_history_not_enabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "`error_code` is `user_not_found` (the path names no active member of\nthe Avatar) or `fact_not_found` (no such Fact about that member, or\nthe issuer of the key may not view it).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such Fact.", "error_code": "fact_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/files": { "get": { "tags": [ "Members" ], "operationId": "listMemberFiles", "summary": "List a member's User Files", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member, as `GET /v1/members` returns it in `id`.", "schema": { "type": "string" } }, { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" } ], "description": "Lists the User Files the Avatar keeps about one member: the documents\nthe Avatar's Owner and Admins uploaded for that person, whose text the\nAvatar reads when it answers them. Only active files appear, newest\n`uploaded_at` first, with the `id` ordering files uploaded in the same\nsecond. The list is paged with `page` and `page_size` (1 to 100,\ndefault 50), and `total` is the number of files across all pages. Only\nthe extracted text is ever available through the API: the original file\nis never offered for download.\n\nA key does no more than the person who issued it can do in the\nMaxGood.work web app. The response carries `access`: `content` shows\neach file's `filename` and `content_type`; `metadata` leaves both\n`null` (an Avatar Admin who is not the member's Avatar Coach may know\nthat files exist, their types and sizes, but not their names). The\nperson is `404` `user_not_found` when they are not an active member of\nthe Avatar and when the issuer of the key may not see their files at\nall, so the answer reveals nothing about people outside the key's\nreach. `limits` gives the largest upload in bytes (`max_bytes`) and the\nextensions an upload may have (`allowed_extensions`); `chunks_in_prompt`\nis how many file chunks the Avatar's replies to this member carry.\n\nThe key needs the `read` scope and, like every member operation, must\nbe attached to the Avatar's confirmed member-event endpoint (`403`\n`member_events_endpoint_required` otherwise, `member_events_unreachable`\nwhen that endpoint has been failing for 24 hours). A `200` counts as one\nlookup in the Avatar's reading limit: 15 lookups a minute for an\nEnterprise Avatar and 6 for an Essential Avatar, shared by all the\nAvatar's keys. A request refused for its `page` or `page_size` is not\ncounted. Over the limit the operation returns `429`. Every response\nthat counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`. Every read is recorded in the Avatar's audit trail\nwith ids and counts only.\n\nIt replaces `GET /v1beta/users/{user_id}/files`. The response is paged\nin `items` where `/v1beta` named the list `files`; `file_id` is `id`\nand `user_id` is on every file; the top-level `user_id` is gone.\n", "responses": { "200": { "description": "One page of the member's files.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "65f1c2a9b7d3e4a1c8f09c55", "user_id": "65f1c2a9b7d3e4a1c8f01a10", "filename": "coaching-notes.txt", "extension": "txt", "content_type": "text/plain", "size_bytes": 2048, "chunk_count": 3, "uploaded_at": "2026-11-14T15:04:05Z" } ], "page": 1, "page_size": 50, "total": 1, "access": "content", "limits": { "max_bytes": 5242880, "allowed_extensions": [ "txt", "md", "pdf" ] }, "chunks_in_prompt": 3 } } } } }, "400": { "$ref": "#/components/responses/InvalidPaging" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body\nnames `required_scope`), `issuer_not_authorized`,\n`agreement_required`, `member_events_endpoint_required` (the key is\nnot attached to a confirmed member-event endpoint) or\n`member_events_unreachable` (that endpoint has been failing for 24\nhours).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This API key needs a confirmed member-event endpoint.", "error_code": "member_events_endpoint_required", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "`user_not_found`: no such person is a member of the Avatar, or the\nissuer of the key may not see their files.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "description": "`user_documents_unavailable` (the platform's User Files settings\ncannot be read) or `service_unavailable`. Retry the request.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Member files are temporarily unavailable.", "error_code": "user_documents_unavailable", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } } } }, "parameters": [ { "in": "path", "name": "user_id", "required": true, "description": "The member's user id, as `GET /v1/members` lists it.", "schema": { "type": "string" } } ], "post": { "tags": [ "Members" ], "operationId": "uploadMemberFile", "summary": "Upload a User File about a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "description": "Stores a document about one active member of the Avatar the key is bound\nto. The Avatar reads the text of the document when it answers that\nmember. The text is read out of the file (PDF, DOCX, PPTX, plain text and\nother common formats), divided into sections, embedded and stored. The\noriginal is kept by MaxGood.work and is never returned: read the text\nthrough the member's file operations.\n\nSend `multipart/form-data` with exactly one part, `file`. Any other part\nor field, and a second `file` part, is refused. The file must have an\nextension the Avatar's file settings allow, must not be empty and must\nbe within the size limit that `GET /v1/members/{user_id}/files` reports\nas `limits.max_bytes`. The size is measured on the body as it arrives.\n\nThe key needs the `write` scope. It acts as the person who issued it\ndoes in the web app: only a key whose issuer has full access to the\nmember's files uploads. A person who is not an active member of the\nAvatar, a person who does not exist, an erased person and a member the\nissuer has no access to all return `404` with `user_not_found`. An\nissuer who may list the member's files without their names but not open\nthem gets `403` with `user_files_owner_coach_only`. A key reaches Members\nonly while it is attached to its Avatar's verified member-event endpoint;\nwithout it the operation returns `403` with `member_events_endpoint_required`\nor `member_events_unreachable`.\n\nEach upload counts as one member change in the Avatar's daily limit: 1,440\na day for an Enterprise Avatar and 360 a day for an Essential Avatar,\nshared by all the Avatar's keys and counted for `/v1/` and `/v1beta/`\ntogether. Over the limit the operation returns `429`. The count is made\nafter every check above has passed, so a refused request costs nothing;\nwhen the counting service is unavailable the operation returns `503`\n`service_unavailable` and stores nothing. Every response that counted\ncarries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`.\n\nIt replaces `POST /v1beta/users/{user_id}/files`. The answer is the File\nitself, where `/v1beta` wrapped it in `file`; it names the file `id`\nand carries the member's `user_id`; and a file over the limit answers\n`413` `payload_too_large` with `max_bytes`, where `/v1beta` answered\n`file_too_large`.\n", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "file" ], "properties": { "file": { "type": "string", "format": "binary", "description": "The document." } } } } } }, "responses": { "201": { "description": "The file was stored.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileResponse" }, "example": { "result": "success", "response": { "id": "0b6f2c1e-8a4d-4f0e-9a57-3d1c2b7e9a10", "user_id": "65f1c2a9b7d3e4a1c8f09b12", "filename": "intake-notes.txt", "extension": "txt", "content_type": "text/plain", "size_bytes": 2048, "chunk_count": 2, "uploaded_at": "2026-11-30T14:05:09Z" } } } } }, "400": { "description": "The request is not valid. `error_code` is `missing_file` (no file part,\nor no file name), `empty_file`, `file_type_not_allowed`,\n`no_text_extracted` (no text could be read from the file) or\n`invalid_request` (the body names `fields`: a part other than `file`\nis `unknown_field`, a second `file` part is `invalid_format`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The file is empty.", "error_code": "empty_file", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is one of the key\nrefusals (`key_frozen`, `api_not_available`, `insufficient_scope`,\n`issuer_not_authorized`, `agreement_required`), `member_events_endpoint_required`\nor `member_events_unreachable` (the key has no working member-event\nendpoint), or `user_files_owner_coach_only` (the key's issuer may list\nthe member's files without their names but may not upload).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Only the Owner and Coaches may read file contents.", "error_code": "user_files_owner_coach_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "The person is not an active member of the Avatar, or the key's issuer has no access to them.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The file is over the size limit. `max_bytes` gives the largest file.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 10485760 } } } }, "415": { "description": "The request is not `multipart/form-data`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "description": "The file could not be stored, or the counting service is unavailable.\n`error_code` is `extraction_failed`, `embedding_failed`, `storage_failed`\nor `user_documents_unavailable` (nothing is stored; retry the upload)\nor `service_unavailable` (nothing was counted; `Retry-After` gives the\nseconds to wait).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The file could not be read. Try again shortly.", "error_code": "extraction_failed", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } } } } }, "/v1/members/{user_id}/files/{file_id}": { "delete": { "tags": [ "Members" ], "operationId": "deleteMemberFile", "summary": "Delete a member's User File", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member, as `GET /v1/members` returns it in `id`.", "schema": { "type": "string" } }, { "name": "file_id", "in": "path", "required": true, "description": "The id of the file, as `GET /v1/members/{user_id}/files` returns it in `id`.", "schema": { "type": "string" } } ], "description": "Deletes one User File the Avatar keeps about a member, and the original\nthe Avatar stored with it. The answer carries the file's `id`,\n`deleted: true` and the `mode`. `hard` means the file was removed. `soft`\nmeans an earlier reply cited one of its chunks: the text is redacted and\na record of the citation stays, so that reply can still show where its\nwords came from. The member's list omits the file, and a\nsecond delete of the same file is `404` `file_not_found`.\n\nA key does no more than the person who issued it can do in the\nMaxGood.work web app. An issuer who may list the member's files without\ntheir names (an Avatar Admin who is not the member's Avatar Coach)\nreceives `403` `user_files_owner_coach_only`. The person is `404`\n`user_not_found` when they are not an active member of the Avatar and\nwhen the issuer may not reach their files at all; the file is `404`\n`file_not_found` when it does not exist, is already deleted, belongs to\nanother member or to another Avatar. A `user_id` or `file_id` that\ncannot name anything (empty, over 64 characters, or with a space or\ncontrol character) receives the same `404`, so no answer shows whether\na person or a file exists outside the key's reach.\n\nThe key needs the `write` scope and, like every member operation, must\nbe attached to the Avatar's confirmed member-event endpoint (`403`\n`member_events_endpoint_required` otherwise, `member_events_unreachable`\nwhen that endpoint has been failing for 24 hours). A `200` counts as one\nmember change in the Avatar's daily limit: 1440 a day for an Enterprise\nAvatar and 360 for an Essential Avatar, shared by all the Avatar's\nkeys, and counted for `/v1/` and `/v1beta/` together. A request refused by any check is not counted. Over the limit the\noperation returns `429`. Every response that counted carries\n`RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`. If the\ncounting service is unavailable the delete runs and is not counted.\nEvery delete and every refusal is recorded in the Avatar's audit trail\nwith ids only.\n\nIt replaces `DELETE /v1beta/users/{user_id}/files/{file_id}`. The answer\nadds the file's `id`; the `/v1beta` answer held `deleted` and `mode`.\n", "responses": { "200": { "description": "The file is deleted.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileDeletedResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09c55", "deleted": true, "mode": "hard" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body\nnames `required_scope`), `issuer_not_authorized`,\n`agreement_required`, `member_events_endpoint_required`,\n`member_events_unreachable`, or `user_files_owner_coach_only` (the\nissuer may list the member's files without their names but may not\ndelete them).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Only the Owner and Coaches may read file contents.", "error_code": "user_files_owner_coach_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "`user_not_found`: no such person is a member of the Avatar, or the\nissuer of the key may not see their files. `file_not_found`: no such\nfile for this member.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such file for this member.", "error_code": "file_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" } } }, "get": { "tags": [ "User Files" ], "operationId": "getMemberFile", "summary": "Get a member's User File", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 }, "description": "The id of the member, from `GET /v1/members`." }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 }, "description": "The id of the User File, from `GET /v1/members/{user_id}/files`." } ], "description": "Returns the details of one User File an Avatar keeps about a member: its\nid, the member's id, the file name and type, its size, the number of text\nchunks the Avatar reads when it answers that member, and when it was\nuploaded. The text the Avatar extracted is at\n`GET /v1/members/{user_id}/files/{file_id}/chunks`; the original file is\nnever offered for download.\n\nA key acts with the access its issuer has in the MaxGood.work web app. A\nkey whose issuer may read the member's files in full gets the file. A\nkey whose issuer may only list the member's files without their names\ngets `403` `user_files_owner_coach_only`. A key whose issuer has no\naccess to the member, a person who is not a member of the Avatar and a\nmember who has been erased all get the same `404` `user_not_found`. A\nfile that does not exist, belongs to another member or belongs to\nanother Avatar gets `404` `file_not_found`.\n\nThe key's Avatar needs a confirmed member-event endpoint attached to the\nkey (`403` `member_events_endpoint_required` and\n`member_events_unreachable`). The call counts as one lookup in the\nAvatar's reading limit, shared by all the Avatar's keys, and every\nresponse that counted carries `RateLimit-Limit`, `RateLimit-Remaining`\nand `RateLimit-Reset`. The read is recorded in the Avatar's audit trail\nwith ids only.\n\nIt replaces `GET /v1beta/users/{user_id}/files/{file_id}`, whose answer\nwrapped the file in `{\"file\": ...}`, named the id `file_id` and did not\ncarry `user_id`.\n", "responses": { "200": { "description": "The User File.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileResponse" }, "example": { "result": "success", "response": { "id": "4f2a9c1e8b7d4a63b5c0e1f2a3b4c5d6", "user_id": "65f1c2a9b7d3e4a1c8f09b13", "filename": "intake-notes.pdf", "extension": "pdf", "content_type": "application/pdf", "size_bytes": 48213, "chunk_count": 6, "uploaded_at": "2026-11-09T14:20:00Z" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is\n`key_frozen`, `api_not_available`, `insufficient_scope` (with\n`required_scope`), `issuer_not_authorized`, `agreement_required`\n(with `agreement_party` and `agreement_url`),\n`member_events_endpoint_required`, `member_events_unreachable` or\n`user_files_owner_coach_only` (the key's issuer may list the\nmember's files but not open one).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Only the Owner and Coaches may read file contents.", "error_code": "user_files_owner_coach_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "`error_code` is `user_not_found` (no such member in this Avatar, or\nthe key's issuer has no access to the member) or `file_not_found`\n(no such file for this member).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such file for this member.", "error_code": "file_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/files/{file_id}/chunks": { "get": { "tags": [ "User Files" ], "operationId": "listMemberFileChunks", "summary": "Read a User File's text", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Returns the text the Avatar extracted from a Member's User File, in\nchunks by `position`, lowest first, one page at a time. This is the text\nthe Avatar reads when it answers the Member. `page` starts at 1 and\n`page_size` defaults to 50 and is at most 100; a value outside the range\nreturns `400`. A file's own details come from the file operations; the\nresponse holds the chunks only. The original file is never offered.\n\nThe key's issuer needs full access to the Member's User Files. An issuer\nwho may list the files without their names returns `403`\n`user_files_owner_coach_only`. A Member who is not in the Avatar, or whom\nthe key's issuer may not reach, returns `404` `user_not_found`; a file\nthat does not exist, is another Member's or belongs to another Avatar\nreturns `404` `file_not_found`.\n\nThe key needs the `read` scope, and the Avatar needs a member-event\nendpoint that is attached and answering. The call counts as one lookup\nin the Avatar's reading limit once it has passed its checks; a refused\nrequest counts nothing. Each read is recorded in the Avatar's audit log\nwith ids and counts, never the text.\n\nIt replaces `GET /v1beta/users/{user_id}/files/{file_id}/chunks`. The\nresponse is the standard list: `items` holds the chunks, each with `id`\n(`chunk_id` in `/v1beta`), `position`, `text` and `token_count`, and the\n`file` object of `/v1beta` is not repeated.\n", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 }, "description": "The id of the Member, from `GET /v1/members`." }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 }, "description": "The id of the User File." }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "responses": { "200": { "description": "One page of the file's chunks.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileChunkListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "65f1c2a9b7d3e4a1c8f09b31", "position": 0, "text": "Maria leads a team of eight and wants shorter planning meetings.", "token_count": 12 } ], "page": 1, "page_size": 50, "total": 1 } } } } }, "400": { "description": "The `page` or `page_size` is not valid (`error_code` `invalid_page` or `invalid_page_size`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page size must be a whole number from 1 to 100.", "error_code": "invalid_page_size", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is one of the key checks (`key_frozen`, `api_not_available`, `insufficient_scope`, `issuer_not_authorized`, `agreement_required`), `member_events_endpoint_required` or `member_events_unreachable` (the Avatar has no attached, answering member-event endpoint), or `user_files_owner_coach_only` (the key's issuer may list the Member's files without their names and may not read their content).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Only the Owner and Coaches may read file contents.", "error_code": "user_files_owner_coach_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "The Member or the file was not found (`error_code` `user_not_found` or `file_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such file for this member.", "error_code": "file_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/interactions": { "get": { "tags": [ "Interactions" ], "operationId": "listMemberInteractions", "summary": "List a member's interactions", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "The member's id, as `id` of a Member." }, { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "$ref": "#/components/parameters/Since" } ], "description": "Returns one page of one member's interactions with the Avatar the key\nis bound to, newest first (the interaction's id breaks a tie), as the\nperson who issued the key reads them in the MaxGood.work web app.\n`total` counts every interaction the query selects, whatever the page.\n\n`access` says what the key reads of this member.\n\n- `content`: `items` holds the page, each with the member's words and\n the Avatar's reply, and `summary` is `null`.\n- `metadata`: the issuer reads this member's size and activity only.\n `items` is empty, `total` is `0` and `summary` holds counts and\n sizes, with the titles the Avatar cited and no words from the\n interactions.\n\nA member who left the Avatar is read where the key's issuer reads\nformer members (the Avatar's Owner and MaxGood.work staff read every\nformer member), under the Avatar's retention rules: an interaction the\nrules keep as metadata only has `access` `metadata`, `user_id` `null`\nand no text. A person who is not a member, an erased account and a\nmember whose interactions the issuer may not read all answer `404`\n`user_not_found`, so the answer names no one.\n\n`since` keeps interactions stored at or after it: an RFC 3339\ntimestamp, or a date (`YYYY-MM-DD`, midnight UTC); a timestamp with no\noffset is UTC.\n\nThe key needs the `read` scope. Member data also needs a confirmed\nmember-event endpoint: until the Avatar has added one and attached\nthis key to it the call answers `403`\n`member_events_endpoint_required`, and while the endpoint has been\nunreachable for 24 hours `403` `member_events_unreachable`. The call\ncounts as one lookup in the Avatar's reading limit once its query is\nvalid; every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`. Every read is recorded in\nthe Avatar's audit trail.\n\nIt replaces `GET /v1beta/users/{user_id}/interactions`, which answered\n`user_id`, `interactions` and `org_id`; here the page is `items` and\neach interaction names its Avatar `avatar_id`.\n", "responses": { "200": { "description": "One page of the member's interactions, or their summary.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberInteractionListResponse" }, "example": { "result": "success", "response": { "items": [ { "id": "1048223", "avatar_id": "65f1c2a9b7d3e4a1c8f09b12", "user_id": "65f1c2a9b7d3e4a1c8f09b21", "created_at": "2026-11-17T15:04:05.120Z", "access": "content", "reference_chunk_ids": [ "66a0d4e1c9b8f7a2d3e45f60" ], "user_text": "How can I make our sprint planning shorter?", "reply": "Start with a clear timebox for each topic." } ], "page": 1, "page_size": 50, "total": 1, "access": "content", "summary": null } } } } }, "400": { "description": "The query is refused. `error_code` is `invalid_page`,\n`invalid_page_size` or `invalid_since`. The request is not counted\nagainst a limit.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The since value cannot be read.", "error_code": "invalid_since", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No such member the key may read: the person is not a member, the\naccount was erased, or the issuer may not read the member's\ninteractions. `error_code` is `user_not_found`.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/notes": { "get": { "tags": [ "Members" ], "operationId": "getMemberNotes", "summary": "Get the Avatar's notes about a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The member's id.", "schema": { "type": "string", "maxLength": 64 } } ], "description": "Returns the notes the Avatar keeps about one of its members, with when\nthey were last written and by which role. The notes are not part of a\nMember; this is the one operation that reads them.\n\nWhat a key reads follows the person who issued it. On an Avatar type\nwithout the Avatar Coach role, a key issued by the Owner, an Avatar\nAdmin or MaxGood.work staff reads the notes; on an Avatar type with the\nrole, only a key issued by the Owner or by MaxGood.work staff does. Any\nother key receives `200` with `withheld` set to `true`, `notes` set to\n`null` and `meta`.\n\nA key needs the `read` scope and a member-event endpoint attached to it\nand confirmed: without one the call answers `403`\n`member_events_endpoint_required`, and `member_events_unreachable` when\nthe endpoint has failed for 24 hours. A person who is not an active\nmember of the Avatar, and a person who does not exist, answer the same\n`404` `user_not_found`.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys.\n", "responses": { "200": { "description": "The notes.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberNotesResponse" }, "example": { "result": "success", "response": { "user_id": "65f1c2a9b7d3e4a1c8f09b34", "notes": "Prefers morning sessions.", "withheld": false, "meta": { "chars": 25, "updated_at": "2026-11-02T09:30:15.123Z", "updated_by_role": "owner" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No active member of the Avatar has this id (`error_code`\n`user_not_found`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "put": { "tags": [ "Members" ], "operationId": "replaceMemberNotes", "summary": "Replace a member's notes", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of a member of the Avatar the key is bound to.", "schema": { "type": "string" } } ], "description": "Replaces the Avatar's notes about one member with the text in the body\nand answers with the notes as stored. The notes belong to this Avatar\nand this member only; no other Avatar and no member read sees them.\n\nThe body is one JSON object with one field, `notes`: a text, or `null`\nto clear the notes (an empty text clears them too). The body is checked\nstrictly: a missing `notes`, a field that is not listed and a value that\nis not a text or `null` (a number, a boolean, an object) answer `400`\n`invalid_request`, and `fields` names each refused field with a short\nreason such as `required`, `must_be_string`, `invalid_format` or\n`unknown_field`. A text over the limit of 2,500 characters answers `400`\n`field_too_long`, with `field` and `max_length`; nothing is truncated.\nThe reply never repeats what you sent. Sending the text already stored\nis accepted and changes nothing.\n\nWho may write notes follows the person who issued the key. On an Avatar\nwhose type has no Avatar Coach role, a key issued by MaxGood.work staff,\nthe Avatar's Owner or an Avatar Admin may write them. On an Avatar whose\ntype has the Avatar Coach role, only a key issued by MaxGood.work staff\nor the Owner may. Any other key is refused with `403`\n`notes_owner_key_only`, even when it sends the text already stored, so\nthat a key that cannot read the notes learns nothing by writing them.\n\nThe key needs the `write` scope and the Avatar's member-event endpoint\n(`403` `member_events_endpoint_required` or `member_events_unreachable`\notherwise). A `404` `user_not_found` means the id is not that of a\nmember of this Avatar.\n\nThe call counts as one member change in the Avatar's daily limit,\nshared by all the Avatar's keys and by `/v1` and `/v1beta` together. A\nday runs from 00:00 to 24:00 UTC. Over the limit the call answers `429`\nwith `Retry-After`. A call refused by any check costs nothing against\nthe limit. Every response that counted carries `RateLimit-Limit`,\n`RateLimit-Remaining` and `RateLimit-Reset`. When MaxGood.work cannot\nread the limit's counter the call is made and is not counted. When it\ncannot read the notes' size limit the call answers `503`\n`service_unavailable` and changes nothing.\n\nEach write is recorded in the Avatar's audit trail with the key, the\nmember and the size of the text, never the text.\n", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplaceMemberNotesRequest" }, "example": { "notes": "Prefers morning sessions. Working towards a team lead role." } } } }, "responses": { "200": { "description": "The notes as stored.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplaceMemberNotesResponse" }, "example": { "result": "success", "response": { "user_id": "65f1c2a9b7d3e4a1c8f09b44", "notes": "Prefers morning sessions. Working towards a team lead role.", "withheld": false, "meta": { "chars": 59, "updated_at": "2026-12-01T15:04:05.123Z", "updated_by_role": "api" } } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), is not valid\n(`invalid_request`, with `fields`), or the text is over the limit\n(`field_too_long`, with `field` and `max_length`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "A field is too long.", "error_code": "field_too_long", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "field": "notes", "max_length": 2500 } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key is known but may not make this call. `error_code` is one of\n`key_frozen`, `api_not_available`, `insufficient_scope` (the body\nnames `required_scope`), `issuer_not_authorized`,\n`agreement_required` (the body names `agreement_party` and\n`agreement_url`), `member_events_endpoint_required`,\n`member_events_unreachable`, or `notes_owner_key_only` (the key's\nissuer may not write the Avatar's notes).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This key may not write notes.", "error_code": "notes_owner_key_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "The id is not that of a member of the Avatar.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is larger than 65,536 bytes. `max_bytes` gives the limit.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The `Content-Type` is not `application/json`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/structured-data": { "get": { "tags": [ "Members" ], "operationId": "getMemberStructuredData", "summary": "Get a Member's structured data", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "description": "Returns the structured data the Avatar keeps about one Member: a JSON\nobject, or `null` when there is none. No other `/v1` endpoint returns\nit; a Member read holds no structured data.\n\nA key issued by the Avatar's Owner, an Avatar Admin or MaxGood.work\nstaff reads the value on every Avatar type and receives `withheld`\n`false`. A key issued by anyone else still receives `200`, with\n`structured_data` `null`, `withheld` `true` and `meta`, the size of\nthe stored value in characters of compact JSON. `meta` is present in\nboth cases.\n\nA person who is unknown, who is not a Member of this Avatar, who was\nremoved from it or whose account was erased receives the same `404`\n`user_not_found`, so the response tells nothing about people outside\nthe Avatar. A `user_id` that cannot be a Member id also receives\n`404`. An archived Member or one whose licence has expired is shown.\n\nThe key's issuer must still be a member of the Avatar: a key whose\nissuer has left receives `403` `issuer_not_authorized`. Member access\nalso needs a confirmed member-event endpoint attached to the key:\nwithout one the call receives `403` `member_events_endpoint_required`,\nand when the endpoint has been unreachable for 24 hours, `403`\n`member_events_unreachable`.\n\nThe call counts as one lookup in the Avatar's reading limit, shared by\nall the Avatar's keys. A request refused before the lookup, including\na malformed `user_id`, costs nothing. Every response that counted\ncarries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`. Each read is recorded in the Avatar's audit log with\nthe Member's id and never the value.\n\n`/v1beta` returned `structured_data`, `structured_data_withheld` and\n`structured_data_meta` inside every user object; here they have their\nown endpoint.\n", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The Member's id, as `GET /v1/members` returns it.", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9_-]+$" } } ], "responses": { "200": { "description": "The Member's structured data, or its size alone.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberStructuredDataResponse" }, "examples": { "read": { "summary": "A key that reads the value", "value": { "result": "success", "response": { "user_id": "65f1c2a9b7d3e4a1c8f09b44", "structured_data": { "goal": "Plan sprints in half the time", "team_size": 8 }, "withheld": false, "meta": { "chars": 54 } } } }, "withheld": { "summary": "A key that holds the metadata only", "value": { "result": "success", "response": { "user_id": "65f1c2a9b7d3e4a1c8f09b44", "structured_data": null, "withheld": true, "meta": { "chars": 54 } } } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "No such Member in this Avatar (`error_code` `user_not_found`): the id\nis unknown, is not a Member of the Avatar, was removed or was erased,\nor cannot be a Member id.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "put": { "tags": [ "Members" ], "operationId": "replaceMemberStructuredData", "summary": "Replace or clear a member's structured data", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The member's `id`.", "schema": { "type": "string", "minLength": 1, "maxLength": 128 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberStructuredDataReplace" }, "example": { "structured_data": { "goal": "Lead a team of ten", "cohort": "2027-spring" } } } } }, "description": "Replaces the structured data your Avatar keeps about one member with the\nobject you send, or removes it when you send `null`. The value is stored\nas a whole: a key you leave out of the object is gone afterwards. The\nresponse is the value as stored.\n\nOnly a key issued by the Avatar's Owner, an Avatar Admin or MaxGood.work\nstaff may write structured data. Any other key answers `403`\n`user_data_admin_key_only`, even when it sends the value already stored.\n\nThe checks run in this order, and a refused request changes nothing and\ncosts nothing against a limit:\n\n1. The key's checks, then the member-event endpoint check that every\n member operation makes.\n2. `400` `invalid_json`, `invalid_request` (the `fields` object names\n `structured_data` with the reason `required` or `must_be_object`, and\n any other field with `unknown_field`), `413` and `415`.\n3. `404` `user_not_found` for a person who is not an active member of\n the Avatar.\n4. `403` `user_data_admin_key_only`.\n5. `400` `field_too_large` when the compact JSON of the object holds more\n than `max_length` characters (262,144), or `field_not_object`; a value\n already stored over the limit may be replaced by a smaller one. `503`\n `service_unavailable` when the limit cannot be read.\n6. The change counts as one call in the Avatar's member-change limit,\n then is written in one step.\n\nA value over the limit is refused, never shortened. It replaces the\n`structured_data` field of `PUT /v1beta/users/{user_id}`.\n", "responses": { "200": { "description": "The structured data as stored.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberStructuredDataResponse" }, "example": { "result": "success", "response": { "user_id": "65f1c2a9b7d3e4a1c8f09b13", "structured_data": { "goal": "Lead a team of ten", "cohort": "2027-spring" }, "withheld": false, "meta": { "chars": 52 } } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), a field is not valid\n(`invalid_request`, with `fields`), or the value is over its limit\n(`field_too_large`, with `field` and `max_length`) or is not an object\n(`field_not_object`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "structured_data": "must_be_object" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `user_data_admin_key_only`: the key\nwas not issued by the Avatar's Owner, an Avatar Admin or MaxGood.work\nstaff. The key checks and the member-event endpoint checks answer\nhere too.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This key may not write structured data.", "error_code": "user_data_admin_key_only", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such member in this Avatar (`user_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is larger than `max_bytes` (`payload_too_large`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 2097152 } } } }, "415": { "description": "The body is not `application/json` (`unsupported_media_type`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/tags": { "post": { "tags": [ "Members" ], "operationId": "addMemberTags", "summary": "Add tags to a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The member's `id`.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddTagsRequest" }, "example": { "tags": [ { "name": "completed-onboarding", "description": "Finished the onboarding course", "source": "lms-sync" } ] } } } }, "description": "Adds 1 to 50 tags to a member of the Avatar the key is bound to. The\nmember is the `user_id` of the path. The call is an upsert by tag name:\na name the member already holds keeps its `applied_at` and takes the new\ndescription and source, and any other name is added. The tags are written\ntogether or not at all. The Avatar uses a member's tags when it replies to\nthem.\n\nMember tags are available on Enterprise Avatars; the key of an Avatar\nwhose type has no member tags receives `403` `user_tags_not_enabled`. The\nkey needs the `write` scope, its issuer must be the Avatar's Owner, an\nAvatar Admin or MaxGood.work staff, and the Avatar must have a confirmed\nmember-event endpoint attached to the key (`403`\n`member_events_endpoint_required` or `member_events_unreachable`).\n\nThe checks run in this order: the Avatar's type offers member tags, the\nbody is valid, the issuer may tag members, and the member belongs to the\nAvatar. A request refused by a check costs nothing against a limit. The\ncall then counts once in the Avatar's member-changes limit, whatever the\nnumber of tags: 1,440 a day for an Enterprise Avatar, shared by all the\nAvatar's keys and counted for `/v1/` and `/v1beta/` together. Every\nresponse that counted carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset`. If the counting service is unavailable, the call runs\nand is not counted.\n\nA member's tags in an Avatar together hold at most the number of\ncharacters the Avatar's type allows. A call that would pass it answers\n`400` `invalid_request` with `fields` naming `tags` and the reason\n`too_long`, and nothing is written. An unknown member, a member of\nanother Avatar, a person who left the Avatar and a person whose account\nwas erased all answer the same `404` `user_not_found`.\n\nIt replaces `POST /v1beta/tags` and `POST /api/enterprise/add_tags_to_user`.\nThe member is addressed by `user_id` in the path, not by `user_email` in\nthe body; `tags_to_add` is `tags`; and the answer is the list of applied\ntags, not a message. Each `/v1beta` route carries `Deprecation`, `Sunset`\nand `Link` headers.\n", "responses": { "200": { "description": "The tags applied, as one page.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TagListResponse" }, "example": { "result": "success", "response": { "items": [ { "name": "completed-onboarding", "description": "Finished the onboarding course", "source": "lms-sync", "applied_at": "2026-12-01T15:04:05.123Z" } ], "page": 1, "page_size": 1, "total": 1 } } } } }, "400": { "description": "The body is not valid JSON (`invalid_json`), or a field is invalid\n(`invalid_request`). `fields` names each invalid path, for example\n`tags[2].name`, with a short reason: `required`, `must_be_string`,\n`must_be_array`, `must_be_object`, `invalid_format`, `too_long` or\n`unknown_field`. A body that is not a JSON object is the path `\"\"`\nwith `must_be_object`. The answer never repeats a value you sent.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "tags[2].name": "invalid_format" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is `key_frozen`,\n`api_not_available`, `insufficient_scope` (the body names\n`required_scope`), `issuer_not_authorized`, `agreement_required` (the\nbody names `agreement_party` and `agreement_url`),\n`member_events_endpoint_required`, `member_events_unreachable` or\n`user_tags_not_enabled`.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar's plan has no member tags.", "error_code": "user_tags_not_enabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such member in this Avatar (`user_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "413": { "description": "The body is larger than the largest the API reads (`payload_too_large`, with `max_bytes`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is too large.", "error_code": "payload_too_large", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "max_bytes": 65536 } } } }, "415": { "description": "The body is not sent as `application/json` (`unsupported_media_type`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The content type is not supported.", "error_code": "unsupported_media_type", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "delete": { "tags": [ "Members" ], "operationId": "deleteMemberTag", "summary": "Remove a tag from a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The id of the member, as `GET /v1/members` returns it.", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "name", "in": "query", "required": true, "description": "The name of the tag to remove, given exactly once and exactly as it was added.", "schema": { "type": "string", "minLength": 1, "maxLength": 2000 } } ], "description": "Removes the tag named in the `name` query parameter from a member of the\nAvatar of the key. Available on Enterprise Avatars; the key of an Avatar\nwhose plan has no member tags answers `403` `user_tags_not_enabled`.\n\nThe call needs the `write` scope, a key whose issuer is an Owner or Admin\nof the Avatar, and an Avatar with a member-event endpoint. A `name` that\nis missing or blank answers `400` `tag_name_required`; one that is given\nmore than once, is longer than 2,000 characters or holds one of the\ncharacters `{ } [ ] < > \" '` answers `400` `tag_name_invalid`. A person\nwho is not a member of the Avatar, is unknown, or has been erased answers\n`404` `user_not_found`, the same for all three. A member who holds no\ntag of that name answers `404` `tag_not_found`.\n\nThe call counts as one change in the Avatar's member-changes limit,\nshared by all the Avatar's keys, and a refused request costs nothing. The\nremoval is recorded in the Avatar's audit log with the length of the\nname, never the name.\n\nIt replaces `DELETE /v1beta/users/{user_id}/tags`.\n", "responses": { "200": { "description": "The tag is removed.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletedResponse" }, "example": { "result": "success", "response": { "id": "completed-onboarding", "deleted": true } } } } }, "400": { "description": "The `name` is missing or blank (`tag_name_required`) or is not a usable tag name (`tag_name_invalid`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "A tag name is required.", "error_code": "tag_name_required", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is `user_tags_not_enabled`\n(the Avatar's plan has no member tags), `member_events_endpoint_required`\nor `member_events_unreachable` (the Avatar's member-event endpoint is\nmissing or unreachable), or one of the key refusals every key operation\ncan answer (`key_frozen`, `api_not_available`, `insufficient_scope`,\n`issuer_not_authorized`, `agreement_required`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar's plan has no member tags.", "error_code": "user_tags_not_enabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "No such member in this Avatar (`user_not_found`), or the member does not hold the tag (`tag_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The member does not hold that tag.", "error_code": "tag_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }, "get": { "tags": [ "Members" ], "operationId": "listMemberTags", "summary": "List a member's tags", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "reads", "x-required-scope": "read", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The member's user id, as `GET /v1/members` lists it.", "schema": { "type": "string" } }, { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" } ], "description": "Lists the tags an integration has attached to one active member of the\nAvatar the key is bound to. The oldest tag comes first, and tags applied\nat the same moment are listed by `name`. The list is paged with `page`\nand `page_size` (1 to 100, default 50), and `total` is the number of\ntags the member holds across all pages. A page past the last has no items\nand the same `total`.\n\nMember tags are part of Enterprise Avatars: on any other Avatar the\noperation returns `403` with `user_tags_not_enabled`. The key needs the\n`read` scope and its issuer must manage the Avatar (an Avatar Owner or an\nAvatar Admin). A key reaches Members only while it is attached to its\nAvatar's verified member-event endpoint; without it the operation\nreturns `403` with `member_events_endpoint_required` or\n`member_events_unreachable`.\n\nA person who is not an active member of the Avatar, a person who does not\nexist and a person whose account was erased all return `404` with\n`user_not_found`.\n\nA `200` counts as one lookup in the Avatar's reading limit: 15 lookups a\nminute for an Enterprise Avatar, shared by all the Avatar's keys. A\nrequest refused for its `page` or `page_size`, its Avatar type or its\nmember is not counted. Over the limit the operation returns `429`. Every\nresponse that counted carries `RateLimit-Limit`, `RateLimit-Remaining`\nand `RateLimit-Reset`.\n\nIt replaces `GET /v1beta/users/{user_id}/tags`. The list is paged and\nnames its tags `items` where `/v1beta` named them `tags` and repeated the\nmember's `user_id`; each tag keeps `name`, `description`, `source` and\n`applied_at`, and `applied_at` is written to the millisecond.\n", "responses": { "200": { "description": "One page of the member's tags.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TagListResponse" }, "example": { "result": "success", "response": { "items": [ { "name": "onboarding-complete", "description": "The member finished the onboarding course.", "source": "learning-platform", "applied_at": "2026-10-02T09:30:00.000Z" }, { "name": "renewal-due", "description": "The member's licence ends within 30 days.", "source": "crm", "applied_at": "2026-11-14T15:04:05.250Z" } ], "page": 1, "page_size": 50, "total": 2 } } } } }, "400": { "$ref": "#/components/responses/InvalidPaging" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/MemberNotFound" }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/members/{user_id}/unarchive": { "post": { "tags": [ "Members" ], "operationId": "unarchiveMember", "summary": "Unarchive a member", "security": [ { "AvatarApiKey": [] } ], "x-rate-limit-class": "member_changes", "x-required-scope": "write", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "The id of the member." } ], "description": "Restores an archived member exactly as archiving paused them: the\nmember's notes, structured data, Avatar Coach, licence date, User Files\nand interactions are as they were, the member can chat again and holds a\nseat again. The request takes no body, and a body is ignored. It\nsucceeds again for a member who is not archived and changes nothing.\n\nUnarchiving takes a seat, so an Avatar with no open seat returns `409`\n`avatar_full` with `needed` and `open_seats`. A key whose issuer is the\nAvatar Owner, an Avatar Admin or MaxGood.work staff may unarchive;\nany other issuer receives `403` `issuer_not_authorized`. The Avatar\nOwner, an Avatar Admin and the members of the MaxGood.work User Support\nAvatar are never archived, so they are never unarchived. A member whose\naccount was erased cannot be changed (`409` `member_erased`). A person\nwho is not an active member of the key's Avatar returns `404`\n`user_not_found`.\n\nThe call needs the member-event endpoint of the Avatar's keys to be\nconfirmed (`403` `member_events_endpoint_required` or\n`member_events_unreachable` otherwise). It counts as one change in the\nAvatar's member-changes limit, shared by all the Avatar's keys, after\nevery refusal that needs no change; a refused call costs nothing. Every\nresponse that counted carries `RateLimit-Limit`, `RateLimit-Remaining`\nand `RateLimit-Reset`.\n\nIt replaces `POST /v1beta/users/{user_id}/unarchive`. The member has\n`id` where `/v1beta` has `user_id`, and a refusal carries neither\n`error` nor `message`.\n", "responses": { "200": { "description": "The member, now without `archived_at`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemberResponse" }, "example": { "result": "success", "response": { "id": "65f1c2a9b7d3e4a1c8f09b34", "email": "una.rivers@example.com", "name": "Una Rivers", "is_admin": false, "is_coach": false, "is_owner": false, "license_expires_at": null, "joined_at": "2026-10-02T14:03:11.000Z", "coach_user_id": null, "status": "active", "archived_at": null } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The key may not make this call. `error_code` is one of the key\nrefusals (`key_frozen`, `api_not_available`, `insufficient_scope`,\n`issuer_not_authorized`, `agreement_required`), `member_events_endpoint_required`\nor `member_events_unreachable` (the member-event endpoint), or\n`owner_not_archivable`, `admin_not_archivable` or\n`support_avatar_not_archivable` (the member is never archived).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "An Admin cannot be archived.", "error_code": "admin_not_archivable", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "404": { "description": "The person is not an active member of the Avatar (`user_not_found`).", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "409": { "description": "The Avatar has no open seat (`avatar_full`, with `needed` 1 and\n`open_seats` 0), or the member's account was erased (`member_erased`).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This Avatar has no open seat.", "error_code": "avatar_full", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "needed": 1, "open_seats": 0 } } } }, "429": { "$ref": "#/components/responses/KeyRateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/public/avatars": { "get": { "tags": [ "Public" ], "operationId": "listPublicAvatars", "summary": "List publicly listed Avatars", "security": [], "x-rate-limit-class": "public", "description": "Lists the Avatars whose public listing is on and whose Avatar type has\na public listing category, in ascending order of Avatar id. The list is\nnot paged. Each entry carries only public fields. The optional `type`\nquery narrows the list to one Avatar type, by exact name; a name that\nmatches no listed Avatar answers an empty list. A change to an Avatar's\nlisting state appears on the next request, and any other change to an\nentry within 2 minutes. The operation needs no key.\n\n`vision`, `mission`, `values`, `expertise` and `industries` are the\nAvatar's current Align settings, empty when the Avatar's Owner has not\nsaved them. `expertise` is the Avatar's area of expertise as its Owner\npublished it, a different concept from Content. `category` is the\nheading the Avatar belongs under, with its `rank`; show the list\ngrouped by `category.rank`, lowest first, and render whatever `key`,\n`label` and `rank` you receive, because categories can be added. The\ncurrent categories are `featured` (\"Featured Avatars\", rank 1: Author\nand Enterprise Avatars), `essential` (\"Essential Avatars\", rank 2),\n`sai_starter` (\"Coach Avatars in Partnership with Scrum Alliance\",\nrank 3) and `tester` (\"Tester Avatars\", rank 4).\n\n`popularity` is `WAITLIST` when anyone is waiting to join the Avatar,\n`POPULAR` when half or more of the Avatar type's member capacity is\nfilled, and `NEW` otherwise, including when the type has no capacity\nlimit. Member and waitlist counts are not published. `public_link` is\nthe page to send a visitor to: the Avatar's newest intake form that is\nopen to the public without an access code, an absolute URL on the\nMaxGood.work web app of the form `…/forms//
`; otherwise\n`avatar_info_url` when it is not empty; otherwise null. `created_at` is\nthe moment the Avatar was created, or null when it is not known.\n\nIt replaces `GET /v1beta/public/avatars`, whose `created_on` date is\n`created_at` here, an RFC 3339 timestamp in UTC.\n", "parameters": [ { "name": "type", "in": "query", "required": false, "description": "Narrows the list to one Avatar type, by exact name, for example \"Author Avatar\". Send it at most once, with 1 to 100 printable characters.", "schema": { "type": "string", "minLength": 1, "maxLength": 100 }, "example": "Author Avatar" } ], "responses": { "200": { "description": "The listed Avatars.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicAvatarsResponse" }, "example": { "result": "success", "response": { "avatars": [ { "id": "65f1c2a9b7d3e4a1c8f09b12", "name": "Northwind Leadership Coach", "mission": "Help leaders build teams that trust each other.", "vision": "Workplaces where people do their best work.", "values": "Candour, curiosity, care", "industries": "Software, professional services", "expertise": "Team coaching", "avatar_info_url": "https://northwind.example.com/coach", "avatar_logo_url": "/api/avatar_image/binary/65f1c2a9b7d3e4a1c8f09b12?v=0123456789ab", "type": "Author Avatar", "category": { "key": "featured", "label": "Featured Avatars", "rank": 1 }, "created_at": "2026-03-18T14:05:09.000Z", "has_icon": true, "popularity": "POPULAR", "public_link": "https://app.example.com/forms/65f1c2a9b7d3e4a1c8f09b12/intake", "public_sort_rank": 1 } ] } } } } }, "400": { "description": "The `type` query is not valid. `fields` names it with its reason.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The request is not valid.", "error_code": "invalid_request", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "fields": { "type": "invalid_format" } } } } }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/public/foundation/authors": { "get": { "tags": [ "Public" ], "operationId": "listPublicFoundationAuthors", "summary": "List public Foundation Authors", "security": [], "x-rate-limit-class": "public", "description": "Lists the Foundation Authors who are publicly shown: authors who own a\npublic Author Avatar or have at least one public Foundation title. Each\nentry has the author's id, display name, bio, backlink and the path of\nthe author's photo. Entries are ordered by display name. The operation\ntakes no parameters, needs no key and caches its answer for up to 60\nseconds.\n\n`photo_url` is the path of the author's public photo. The path answers\nthe photo once MaxGood.work has approved it and `404` until then.\n\nIt replaces `GET /v1beta/public/authors`.\n", "responses": { "200": { "description": "The public Foundation Authors.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicFoundationAuthorsResponse" }, "example": { "result": "success", "response": { "authors": [ { "id": "5d2c9a7e1b3f4086a9c1e2d3f4a5b6c7", "display_name": "Jordan Lee", "bio": "Jordan coaches teams through change.", "backlink": "https://jordanlee.example.com", "photo_url": "/api/image-assets/users/5d2c9a7e1b3f4086a9c1e2d3f4a5b6c7" } ] } } } } }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/public/foundation/showcase": { "get": { "tags": [ "Public" ], "operationId": "getPublicFoundationShowcase", "summary": "Get the Foundation showcase", "security": [], "x-rate-limit-class": "public", "description": "Returns the two collections a Foundation Author showcase page shows\ntogether: the public Foundation titles and the publicly listed Author\nAvatars. The operation needs no key.\n\nEach entry of `titles` appears once, ordered by `name` without regard\nto case, with its `description` and the author names to print: the\nnames the title carries, otherwise the display name of the Foundation\nAuthor who owns it, otherwise an empty list. `image_url` and\n`owner_image_url` hold the address of an approved image and are the\nempty string when there is none.\n\nEach entry of `author_avatars` carries the Avatar's logo address\n(`avatar_logo_url`), its information page (`avatar_info_url`, the empty\nstring when there is none) and a `blurb` composed from the Avatar's\nmission, vision, values, industries and expertise, in that order, with\nblank fields left out. Entries are ordered by Avatar id.\n\nThe operation takes no parameters; a query string is ignored. The\nFoundation titles are cached for up to 2 minutes; the Author Avatars,\nauthor names and image addresses are read at each call.\n\nIt replaces `GET /v1beta/public/showcase`, whose answer has the same\nshape.\n", "responses": { "200": { "description": "The showcase.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FoundationShowcaseResponse" }, "example": { "result": "success", "response": { "titles": [ { "id": "66a0d4e1c9b8f7a2d3e45f77", "name": "The Team Retrospective Handbook", "description": "A practical guide to running retrospectives.", "authors": [ "Jordan Lee" ], "image_url": "/api/image-assets/content_titles/66a0d4e1c9b8f7a2d3e45f77", "owner_image_url": "/api/image-assets/users/5d2c9a7e1b3f4086a9c1e2d3f4a5b6c7" } ], "author_avatars": [ { "id": "65f1c2a9b7d3e4a1c8f09b12", "name": "Northwind Leadership Coach", "type": "Author Avatar", "blurb": "Help leaders build teams that trust each other. Workplaces where people do their best work.", "avatar_logo_url": "https://app.example.com/logos/northwind.png", "avatar_info_url": "https://northwind.example.com/coach" } ] } } } } }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/public/foundation/titles": { "get": { "tags": [ "Public" ], "operationId": "listPublicFoundationTitles", "summary": "List public Foundation Titles", "security": [], "x-rate-limit-class": "public", "description": "Lists the public Foundation Titles (the licensed expert content shared\nwith every Avatar), each with its description and a live usage count,\nthe number of times the title's content has been cited in an Avatar\nreply. A title is public when its content is visible to the public and\nit is not deleted. The titles are ordered by `name`, without regard to\ncase. The collection is bounded and not paged. It is cached for up to\n2 minutes. The operation needs no key and takes no parameters.\n\nIt replaces `GET /v1beta/public/foundation-titles`, whose `title` is\n`name` here and whose `title_usage_count` is `usage_count` here.\n", "responses": { "200": { "description": "The public Foundation Titles.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicFoundationTitlesResponse" }, "example": { "result": "success", "response": { "titles": [ { "id": "66a0d4e1c9b8f7a2d3e45f77", "name": "The Team Retrospective Handbook", "description": "A practical guide to running retrospectives.", "authors": [ "Jordan Lee" ], "owner": "5d2c9a7e1b3f4086a9c1e2d3f4a5b6c7", "usage_count": 1280, "image_url": "/api/image-assets/content_titles/66a0d4e1c9b8f7a2d3e45f77" } ] } } } } }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/public/free-avatars": { "get": { "tags": [ "Public" ], "operationId": "listPublicFreeAvatars", "summary": "List the free Avatars", "security": [], "x-rate-limit-class": "public", "description": "Lists the Avatars that every new MaxGood.work account receives for free\n(the Avatars granted to everyone who signs up and to every free\naccount), once per Avatar, ordered by `name` without regard to case.\nEach entry has exactly three fields:\n\n- `name`, the Avatar's name.\n- `free_trial_days`, how long the Avatar is free for a new account.\n `0` means free with no end date; any other value is the free period\n in days. When an Avatar is granted more than once, the grant a new\n free account receives applies; among several such grants `0` wins\n over any period, otherwise the longest period.\n- `key_benefit`, one short sentence naming what a person gets from the\n Avatar, or the empty string when none is written.\n\nThe list holds only the Avatars MaxGood.work offers for free, and the\noperation takes no parameter and addresses no Avatar by id. The\nresponse is cached for up to 5 minutes, and a change to the free\nAvatars or their key benefits appears on the next request after the\nchange. The operation needs no key.\n\nIt replaces `GET /v1beta/public/free-avatars`, which answers the same\nentries.\n", "responses": { "200": { "description": "The free Avatars.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicFreeAvatarsResponse" }, "example": { "result": "success", "response": { "avatars": [ { "name": "MaxGood.work User Support", "free_trial_days": 0, "key_benefit": "Get quick, friendly answers about using MaxGood.work whenever you need them." } ] } } } } }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/v1/public/stats": { "get": { "tags": [ "Public" ], "operationId": "getPublicStats", "summary": "Get platform statistics", "security": [], "x-rate-limit-class": "public", "description": "Returns platform-wide historical totals: the number of Avatars, user\naccounts and stored interactions. The totals are historical and\ninclude archived and removed accounts and interactions, so they only\ngrow. The response is cached for up to 2 minutes. The operation needs\nno key.\n\nIt replaces `GET /v1beta/public/stats`, whose `total_organizations`\nfield is `total_avatars` here.\n", "responses": { "200": { "description": "The totals.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicStatsResponse" }, "example": { "result": "success", "response": { "total_avatars": 412, "total_users": 18230, "total_interactions": 1204518 } } } } }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } } }, "components": { "headers": { "RateLimitLimit": { "description": "The limit of the row this request counted against, for the Avatar and its current period.", "schema": { "type": "integer", "minimum": 1 }, "example": 15 }, "RateLimitRemaining": { "description": "How many more requests of this kind the Avatar may make in the current period, after this one.", "schema": { "type": "integer", "minimum": 0 }, "example": 14 }, "RateLimitReset": { "description": "The seconds until the current period ends and the count starts again from zero.", "schema": { "type": "integer", "minimum": 1 }, "example": 40 }, "RetryAfter": { "description": "The seconds to wait before the same request can succeed.", "schema": { "type": "integer", "minimum": 0 }, "example": 40 }, "XRequestId": { "description": "The identifier of this request, `req_` followed by 32 lowercase hexadecimal characters. Quote it when you ask support about the request.", "schema": { "type": "string", "pattern": "^req_[0-9a-f]{32}$" }, "example": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } }, "parameters": { "Page": { "name": "page", "in": "query", "required": false, "description": "The page of the list to return, counted from 1. The default is 1. A page past the last returns no items and the same `total`.", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, "PageSize": { "name": "page_size", "in": "query", "required": false, "description": "The number of items on a page, from 1 to 100. The default is 50. A value outside the range is refused, never changed.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }, "Since": { "name": "since", "in": "query", "required": false, "description": "Keeps the interactions stored at or after this moment, an RFC 3339 timestamp (`2026-11-01T09:30:00Z`; one without an offset is UTC) or a date (`2026-11-01`, midnight UTC). A value that cannot be read is refused.", "schema": { "type": "string" } } }, "responses": { "ChunkNotFound": { "description": "No chunk of this Avatar has the id (`error_code` `chunk_not_found`). A chunk of another Avatar and an id that cannot be a chunk id answer the same.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such chunk in this Avatar.", "error_code": "chunk_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "FactsForbidden": { "description": "The key is known but may not make this call. `error_code` is `key_frozen`\n(the key is paused), `api_not_available` (the Avatar's type does not offer\nthe API), `insufficient_scope` (the body names `required_scope`),\n`issuer_not_authorized` (the person who issued the key may not do this),\n`agreement_required` (the body names `agreement_party` and `agreement_url`)\nor `facts_disabled` (the Avatar's type keeps no Facts).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Memory is off for this Avatar.", "error_code": "facts_disabled", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "Forbidden": { "description": "The key is known but may not make this call. `error_code` is `key_frozen`\n(the key is paused), `api_not_available` (the Avatar's type does not offer\nthe API), `insufficient_scope` (the body names `required_scope`),\n`issuer_not_authorized` (the person who issued the key may not do this),\n`agreement_required` (the body names `agreement_party` and `agreement_url`),\n`member_events_endpoint_required` (a member operation needs a key attached\nto a confirmed member-event endpoint) or `member_events_unreachable` (that\nendpoint has failed for 24 hours; a fresh one-time code restores it).\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "This API key does not have the scope this call needs.", "error_code": "insufficient_scope", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "required_scope": "read" } } } }, "InternalError": { "description": "An unexpected fault. The message is fixed text.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Something went wrong on our side.", "error_code": "internal_error", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "InvalidInteractionQuery": { "description": "The `page`, `page_size` or `since` query value is refused. `error_code` is\n`invalid_page` (`page` is not a whole number of at least 1),\n`invalid_page_size` (`page_size` is not a whole number from 1 to 100) or\n`invalid_since` (`since` is not an RFC 3339 timestamp or a date, or is given\ntwice). The request is not counted against a limit.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The since value cannot be read.", "error_code": "invalid_since", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "InvalidPaging": { "description": "The `page` or `page_size` query value is refused. `error_code` is\n`invalid_page` (`page` is not a whole number of at least 1) or\n`invalid_page_size` (`page_size` is not a whole number from 1 to 100). The\nrequest is not counted against a limit.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The page size must be a whole number from 1 to 100.", "error_code": "invalid_page_size", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "KeyRateLimited": { "description": "The Avatar has reached the limit of this kind of request (`error_code`\n`rate_limited`, with `rate_class`, `retry_after_seconds`, `limit` and\n`window_seconds`), or too many failed key checks came from your address\n(`auth_throttled`). `Retry-After` gives the seconds to wait.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "Retry-After": { "$ref": "#/components/headers/RetryAfter" }, "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" }, "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" }, "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Too many requests. Try again later.", "error_code": "rate_limited", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "rate_class": "reads", "retry_after_seconds": 40, "limit": 15, "window_seconds": 60 } } } }, "MemberNotFound": { "description": "The person is not an active member of the Avatar. `error_code` is\n`user_not_found`. The answer is the same for a person who does not exist, a\nperson who belongs to another Avatar, a person who left and a person whose\naccount was erased.\n", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "No such member in this Avatar.", "error_code": "user_not_found", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "RateLimited": { "description": "The limit of the public read tier is reached. `Retry-After` gives the seconds to wait.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" }, "Retry-After": { "description": "Seconds until you may retry.", "schema": { "type": "integer", "minimum": 0 } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Too many requests. Try again later.", "error_code": "rate_limited", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d", "retry_after_seconds": 42, "limit": 600, "window_seconds": 60 } } } }, "ServiceUnavailable": { "description": "A service the request needs is unavailable. Retry the request.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "The service is temporarily unavailable. Try again shortly.", "error_code": "service_unavailable", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } }, "Unauthorized": { "description": "The key is missing, malformed, unknown or revoked. `error_code` is `api_key_missing`, `api_key_invalid` or `api_key_revoked`.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "result": "failure", "response": "Send your API key as a Bearer token.", "error_code": "api_key_missing", "request_id": "req_3f9a1c07b2d84e5a9c6d0e1f2a3b4c5d" } } } } }, "schemas": { "AddTagsRequest": { "type": "object", "additionalProperties": false, "required": [ "tags" ], "properties": { "tags": { "type": "array", "minItems": 1, "maxItems": 50, "description": "The tags to add, 1 to 50. A name that appears twice is applied once, with the last description and source.", "items": { "$ref": "#/components/schemas/TagInput" } } } }, "Avatar": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "type" ], "properties": { "id": { "type": "string", "description": "The Avatar's id." }, "name": { "type": "string", "description": "The Avatar's name." }, "type": { "type": "string", "description": "The name of the Avatar's Avatar type, for example `Enterprise Avatar`. The type decides which operations the Avatar offers." } } }, "AvatarResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Avatar" } } }, "BatchMemberResult": { "type": "object", "additionalProperties": false, "required": [ "index", "email", "status" ], "properties": { "index": { "type": "integer", "minimum": 0, "description": "The row's position in the request, counting from 0." }, "email": { "type": "string", "nullable": true, "description": "The row's email address with spaces removed and letters in lower case, or `null` when the row has no usable address." }, "status": { "type": "string", "enum": [ "added", "already_member", "invalid", "failed" ], "description": "What happened to the row." }, "id": { "type": "string", "description": "The new member's id. Present only when `status` is `added`." }, "error_code": { "type": "string", "description": "Why the row was not added. Present when `status` is `invalid` or `failed`." }, "fields": { "type": "object", "additionalProperties": { "type": "string" }, "description": "For `error_code` `invalid_request`, each refused field and a short reason." } } }, "BatchMemberRow": { "type": "object", "additionalProperties": false, "required": [ "email", "name" ], "description": "One person to add. The fields are those of the body of `POST /v1/members`.", "properties": { "email": { "type": "string", "description": "The person's email address." }, "name": { "type": "string", "description": "The person's name. Used only when the email has no account yet." }, "is_admin": { "type": "boolean", "description": "Make the person an Avatar Admin. Only a key issued by the Avatar's Owner or MaxGood.work staff may set it." }, "is_coach": { "type": "boolean", "description": "Make the person an Avatar Coach. Only a key issued by the Avatar's Owner or MaxGood.work staff may set it, and only on an Avatar whose plan has the Coach role." }, "license_expires_at": { "type": "string", "nullable": true, "description": "When the person's licence ends, as an RFC 3339 timestamp or a `YYYY-MM-DD` date. `null` or no value means the licence does not end." }, "profile": { "type": "object", "description": "Optional `role`, `expertise`, `industry`, `goal`, `problem` and `language`, all strings. They are used only when the email has no account yet.", "additionalProperties": { "type": "string" } } } }, "BatchMembersResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/BatchMembersResult" } } }, "BatchMembersResult": { "type": "object", "additionalProperties": false, "required": [ "results", "added_count" ], "properties": { "results": { "type": "array", "description": "One result for each row, in request order.", "items": { "$ref": "#/components/schemas/BatchMemberResult" } }, "added_count": { "type": "integer", "minimum": 0, "description": "The number of rows with status `added`." } } }, "Chunk": { "type": "object", "additionalProperties": false, "required": [ "id", "title_id", "name", "text", "is_active" ], "properties": { "id": { "type": "string", "description": "The chunk's id. Ids are in creation order." }, "title_id": { "type": "string", "description": "The id of the title the chunk belongs to." }, "name": { "type": "string", "description": "The chunk's name. A deleted chunk has a placeholder name." }, "text": { "type": "string", "description": "The chunk's text, as Markdown. A deleted chunk has placeholder text." }, "is_active": { "type": "boolean", "description": "`true` while the chunk is part of the Avatar's Content, `false` for a deleted chunk, which the Avatar does not retrieve. A list holds active chunks only." } } }, "ChunkList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total" ], "properties": { "items": { "type": "array", "description": "The chunks of the page, ordered by `id` ascending (creation order).", "items": { "$ref": "#/components/schemas/Chunk" } }, "page": { "type": "integer", "description": "The page returned, counted from 1." }, "page_size": { "type": "integer", "description": "The number of chunks a page holds at most." }, "total": { "type": "integer", "description": "The number of active chunks the title holds." } } }, "ChunkListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/ChunkList" } } }, "ChunkResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Chunk" } } }, "CoachAssignmentRequest": { "type": "object", "additionalProperties": false, "required": [ "coach_user_id" ], "properties": { "coach_user_id": { "type": "string", "nullable": true, "minLength": 1, "maxLength": 128, "description": "The id of the member who becomes the Coach, or `null` to leave the member\nwithout one. The id is the `id` of a Member.\n" } } }, "CoachAssignmentResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Member" } } }, "CreateContentTitleRequest": { "type": "object", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 300, "description": "The new title's name. Leading and trailing spaces are removed. A name that is empty after that, or holds a control character, or is longer than 300 characters is refused." } } }, "CreateMemberProfile": { "type": "object", "additionalProperties": false, "description": "Profile text for a person who has no account yet. It is ignored for a person who has one, and it is never returned. Each value must be within the platform's save limit for that field.", "properties": { "role": { "type": "string" }, "expertise": { "type": "string" }, "industry": { "type": "string" }, "goal": { "type": "string" }, "problem": { "type": "string" }, "language": { "type": "string" } } }, "CreateMemberRequest": { "type": "object", "additionalProperties": false, "required": [ "email", "name" ], "properties": { "email": { "type": "string", "maxLength": 254, "description": "The person's email address. Leading and trailing spaces are removed and the address is read in lower case." }, "name": { "type": "string", "minLength": 1, "description": "The person's name. It is used only when the email has no account yet. It must be within the platform's save limit for a name." }, "is_admin": { "type": "boolean", "description": "Make the person an Avatar Admin. Only a key issued by the Avatar's Owner or by MaxGood.work staff may set it to `true`. The default is `false`." }, "is_coach": { "type": "boolean", "description": "Make the person an Avatar Coach. Only a key issued by the Avatar's Owner or by MaxGood.work staff may set it to `true`, and only on an Avatar whose plan has the Coach role. The default is `false`." }, "license_expires_at": { "type": "string", "nullable": true, "description": "When the person's licence ends, as an RFC 3339 timestamp with a zone (`2027-03-01T00:00:00Z`) or a date (`2027-03-01`, read as UTC). `null` or no value sets no end." }, "profile": { "$ref": "#/components/schemas/CreateMemberProfile" } } }, "CreateMembersBatchRequest": { "type": "object", "additionalProperties": false, "required": [ "users" ], "properties": { "users": { "type": "array", "minItems": 1, "maxItems": 100, "description": "The people to add, 1 to 100 rows.", "items": { "$ref": "#/components/schemas/BatchMemberRow" } } } }, "Deleted": { "type": "object", "additionalProperties": false, "required": [ "id", "deleted" ], "properties": { "id": { "type": "string", "description": "The id of the thing that was deleted." }, "deleted": { "type": "boolean", "enum": [ true ], "description": "Always `true`." } } }, "DeletedResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Deleted" } } }, "Document": { "type": "object", "description": "A source document of a Content title.", "additionalProperties": false, "required": [ "id", "title_id", "filename", "extension", "content_type", "size_bytes", "uploaded_at", "is_active", "download_url", "download_url_expires_at" ], "properties": { "id": { "type": "string", "description": "The document's id." }, "title_id": { "type": "string", "description": "The id of the title the document belongs to." }, "filename": { "type": "string", "description": "The file name the document was uploaded with. A removed document carries a placeholder name." }, "extension": { "type": "string", "description": "The file extension without the dot, for example `pdf`. Empty when the file had none." }, "content_type": { "type": "string", "description": "The media type of the stored file, for example `application/pdf`." }, "size_bytes": { "type": "integer", "minimum": 0, "description": "The size of the stored file in bytes." }, "uploaded_at": { "type": "string", "nullable": true, "description": "When the document was uploaded, an RFC 3339 timestamp in UTC. `null` when the upload time was not recorded." }, "is_active": { "type": "boolean", "description": "`false` for a document whose title was deleted or whose stored file was removed." }, "download_url": { "type": "string", "nullable": true, "description": "A link that downloads the original file, valid for 15 minutes. `null` when the document is not active or its file cannot be linked. Call the operation again for a fresh link." }, "download_url_expires_at": { "type": "string", "nullable": true, "description": "When `download_url` stops working, an RFC 3339 timestamp in UTC. `null` exactly when `download_url` is `null`." } } }, "DocumentPage": { "type": "object", "description": "One page of a title's documents.", "additionalProperties": false, "required": [ "items", "page", "page_size", "total" ], "properties": { "items": { "type": "array", "description": "The documents of this page, newest `uploaded_at` first, then by `id`.", "items": { "$ref": "#/components/schemas/Document" } }, "page": { "type": "integer", "minimum": 1, "description": "The page number returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The most documents a page holds." }, "total": { "type": "integer", "minimum": 0, "description": "The number of documents the title holds, on all pages." } } }, "DocumentPageResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/DocumentPage" } } }, "Error": { "type": "object", "description": "Every failure answers in this shape. An operation lists the named extra fields it adds.", "additionalProperties": false, "required": [ "result", "response", "error_code", "request_id" ], "properties": { "result": { "type": "string", "enum": [ "failure" ] }, "response": { "type": "string", "description": "The fixed message for the `error_code`." }, "error_code": { "type": "string", "description": "The stable identifier to branch on.", "enum": [ "coach_is_client", "coach_user_id_required", "duplicate_email", "empty_file", "fact_text_required", "fact_too_long", "field_not_object", "field_too_large", "field_too_long", "file_type_not_allowed", "invalid_batch", "invalid_email", "invalid_json", "invalid_page", "invalid_page_size", "invalid_request", "invalid_since", "invalid_status", "missing_file", "no_text_extracted", "not_a_coach", "prompt_too_long", "tag_name_invalid", "tag_name_required", "api_key_invalid", "api_key_missing", "api_key_revoked", "admin_not_archivable", "agreement_required", "api_not_available", "coach_assign_owner_only", "coach_role_not_enabled", "fact_clients_only", "fact_history_not_enabled", "fact_view_only", "facts_disabled", "footer_not_editable", "insufficient_scope", "interaction_access_required", "issuer_not_authorized", "key_frozen", "member_archived", "member_events_endpoint_required", "member_events_unreachable", "member_license_expired", "member_suspended", "notes_owner_key_only", "owner_has_no_coach", "owner_not_archivable", "owner_not_removable", "priority_owner_key_only", "role_change_owner_key_only", "support_avatar_not_archivable", "user_cap_reached", "user_data_admin_key_only", "user_files_owner_coach_only", "user_tags_not_enabled", "chunk_not_found", "fact_not_found", "file_not_found", "route_not_found", "tag_not_found", "title_not_found", "user_not_found", "method_not_allowed", "already_member", "avatar_full", "fact_budget_exceeded", "member_erased", "title_empty", "endpoint_retired", "payload_too_large", "unsupported_media_type", "auth_throttled", "rate_limited", "internal_error", "avatar_no_response", "embedding_failed", "extraction_failed", "service_unavailable", "storage_failed", "user_documents_unavailable" ] }, "request_id": { "type": "string", "pattern": "^req_[0-9a-f]{32}$", "description": "The value of the `X-Request-Id` response header." }, "retry_after_seconds": { "type": "integer", "minimum": 0, "description": "On a `rate_limited` failure, the seconds to wait before the next request." }, "limit": { "type": "integer", "minimum": 0, "description": "On a `rate_limited` failure, the limit that was reached." }, "window_seconds": { "type": "integer", "minimum": 0, "description": "On a `rate_limited` failure, the length in seconds of the window the limit counts over." }, "successor": { "type": "string", "nullable": true, "description": "On an `endpoint_retired` failure, the path of the replacing endpoint, or `null` when there is none." }, "required_scope": { "type": "string", "description": "On an `insufficient_scope` failure, the scope the call needs." }, "rate_class": { "type": "string", "description": "On a `rate_limited` failure of a keyed call, the name of the limit row that was reached." }, "fields": { "type": "object", "additionalProperties": { "type": "string" }, "description": "On an `invalid_request` failure, a map from each invalid field path to a short reason." }, "max_bytes": { "type": "integer", "minimum": 0, "description": "On a `payload_too_large` failure, the largest body size in bytes." }, "max_characters": { "type": "integer", "minimum": 0, "description": "The character limit that was exceeded." }, "max_tokens": { "type": "integer", "minimum": 0, "description": "The token limit that was exceeded." }, "token_count": { "type": "integer", "minimum": 0, "description": "The token count of the refused text." }, "active_tokens": { "type": "integer", "minimum": 0, "description": "The tokens the Avatar's active Facts already use." }, "agreement_party": { "type": "string", "description": "On an `agreement_required` failure, whose agreement is pending: `owner` or `member`." }, "agreement_url": { "type": "string", "description": "On an `agreement_required` failure, where to accept the agreement." }, "interaction_id": { "type": "string", "description": "On a `member_archived`, `member_license_expired` or `member_suspended` failure of a reply, the id of the interaction that holds the refused turn." }, "needed": { "type": "integer", "minimum": 0, "description": "On an `avatar_full` failure, the seats the request needs." }, "open_seats": { "type": "integer", "minimum": 0, "description": "On an `avatar_full` failure, the seats that are open." }, "field": { "type": "string", "description": "On a field-limit failure, the name of the field." }, "max_length": { "type": "integer", "minimum": 0, "description": "On a field-limit failure, the largest length allowed." } } }, "Fact": { "type": "object", "description": "One Fact the Avatar keeps about itself, as the person who issued the key sees it.", "additionalProperties": false, "required": [ "id", "text", "token_count", "status", "source", "created_by_user_id", "created_at", "updated_at", "version_count", "access" ], "properties": { "id": { "type": "string", "description": "The Fact's id, a string of digits." }, "text": { "type": "string", "description": "The Fact." }, "token_count": { "type": "integer", "minimum": 0, "description": "The tokens the text uses." }, "status": { "type": "string", "enum": [ "active", "hidden" ], "description": "An `active` Fact is woven into the Avatar's replies and counts toward the total limit; a `hidden` one is kept and does neither." }, "source": { "type": "string", "nullable": true, "description": "Who the Fact came from, for example `owner`, `admin` or `coach`." }, "created_by_user_id": { "type": "string", "nullable": true, "description": "The id of the person who wrote the Fact, or `null` where the issuer of the key may not see who wrote it." }, "created_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the Fact was added." }, "updated_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the Fact last changed." }, "version_count": { "type": "integer", "minimum": 0, "nullable": true, "description": "The number of earlier versions of the text, or `null` when the Avatar's type keeps no edit history." }, "access": { "type": "string", "enum": [ "edit", "view" ], "description": "What the issuer of the key may do with this Fact in the MaxGood.work web app." } } }, "FactCreateRequest": { "type": "object", "additionalProperties": false, "required": [ "text" ], "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "The Fact, a short statement. Leading and trailing spaces are removed. It is at most 2,000 characters and at most the Avatar type's largest Fact in tokens." } } }, "FactHistory": { "type": "object", "additionalProperties": false, "required": [ "fact_id", "items", "page", "page_size", "total" ], "properties": { "fact_id": { "type": "string", "description": "The id of the Fact." }, "items": { "type": "array", "description": "The page's versions, newest edit first.", "items": { "$ref": "#/components/schemas/FactVersion" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The most versions a page holds." }, "total": { "type": "integer", "minimum": 0, "description": "How many versions the Fact has in all." } } }, "FactHistoryResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/FactHistory" } } }, "FactLimits": { "type": "object", "description": "The Avatar type's Fact limits and what the Avatar's active Facts use now.", "additionalProperties": false, "required": [ "per_fact_tokens", "total_tokens", "active_tokens", "history_tracked" ], "properties": { "per_fact_tokens": { "type": "integer", "nullable": true, "description": "The most tokens one Fact may hold." }, "total_tokens": { "type": "integer", "nullable": true, "description": "The most tokens all the Avatar's active Facts, its own and its members', may hold together." }, "active_tokens": { "type": "integer", "minimum": 0, "description": "The tokens the Avatar's active Facts use now." }, "history_tracked": { "type": "boolean", "description": "Whether the Avatar's type keeps the earlier versions of a Fact's text." } } }, "FactList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total", "limits" ], "properties": { "items": { "type": "array", "description": "The Facts of this page.", "items": { "$ref": "#/components/schemas/Fact" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The number of Facts a full page holds." }, "total": { "type": "integer", "minimum": 0, "description": "The number of Facts that match, across all pages." }, "limits": { "$ref": "#/components/schemas/FactLimits" } } }, "FactListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/FactList" } } }, "FactResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Fact" } } }, "FactVersion": { "type": "object", "additionalProperties": false, "required": [ "id", "fact_id", "text", "token_count", "edited_at", "edited_by_user_id", "edit_source" ], "properties": { "id": { "type": "string", "description": "The version's id." }, "fact_id": { "type": "string", "description": "The id of the Fact the version belongs to." }, "text": { "type": "string", "description": "The text the Fact held before the edit." }, "token_count": { "type": "integer", "minimum": 0, "description": "The number of tokens in `text`." }, "edited_at": { "type": "string", "nullable": true, "description": "When the edit was made, an RFC 3339 timestamp in UTC." }, "edited_by_user_id": { "type": "string", "nullable": true, "description": "The id of the person who made the edit, or `null` when the editor's name is not shown to this reader." }, "edit_source": { "type": "string", "nullable": true, "description": "The role the edit was made in, for example `owner`, `admin` or `coach`." } } }, "File": { "type": "object", "additionalProperties": false, "required": [ "id", "user_id", "filename", "extension", "content_type", "size_bytes", "chunk_count", "uploaded_at" ], "properties": { "id": { "type": "string", "description": "The file's id." }, "user_id": { "type": "string", "description": "The id of the member the file is kept about." }, "filename": { "type": "string", "nullable": true, "description": "The file's name. It is `null` when the key has `metadata` access." }, "extension": { "type": "string", "nullable": true, "description": "The file's extension, lower case and without the dot." }, "content_type": { "type": "string", "nullable": true, "description": "The file's content type. It is `null` when the key has `metadata` access." }, "size_bytes": { "type": "integer", "minimum": 0, "nullable": true, "description": "The size of the file in bytes." }, "chunk_count": { "type": "integer", "minimum": 0, "nullable": true, "description": "The number of text chunks the file was split into." }, "uploaded_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the file was uploaded, in UTC to the second." } } }, "FileChunk": { "type": "object", "additionalProperties": false, "required": [ "id", "position", "text", "token_count" ], "properties": { "id": { "type": "string", "description": "The chunk's id." }, "position": { "type": "integer", "minimum": 0, "description": "The chunk's place in the file, counted from 0. Chunks are listed by `position`, lowest first." }, "text": { "type": "string", "description": "The text the Avatar extracted from this part of the file. This is the text the Avatar reads when it answers the Member." }, "token_count": { "type": "integer", "minimum": 0, "description": "The number of tokens in `text`." } } }, "FileChunkList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total" ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/FileChunk" } }, "page": { "type": "integer", "minimum": 1 }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100 }, "total": { "type": "integer", "minimum": 0, "description": "The number of chunks the file holds, across all pages." } } }, "FileChunkListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/FileChunkList" } } }, "FileDeleted": { "type": "object", "additionalProperties": false, "required": [ "id", "deleted", "mode" ], "properties": { "id": { "type": "string", "description": "The id of the file that was deleted." }, "deleted": { "type": "boolean", "enum": [ true ], "description": "Always `true`." }, "mode": { "type": "string", "enum": [ "hard", "soft" ], "description": "`hard` when the file was removed. `soft` when an earlier reply cited one\nof its chunks: the text was redacted and a record of the citation stays.\n" } } }, "FileDeletedResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/FileDeleted" } } }, "FileLimits": { "type": "object", "additionalProperties": false, "required": [ "max_bytes", "allowed_extensions" ], "properties": { "max_bytes": { "type": "integer", "minimum": 0, "description": "The largest file an upload may be, in bytes." }, "allowed_extensions": { "type": "array", "items": { "type": "string" }, "description": "The extensions an upload may have, lower case and without the dot." } } }, "FileList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total", "access", "limits", "chunks_in_prompt" ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/File" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The page size used." }, "total": { "type": "integer", "minimum": 0, "description": "The number of active files the member has, across all pages." }, "access": { "type": "string", "enum": [ "content", "metadata" ], "description": "What the key may see of the files. `metadata` leaves `filename` and `content_type` null." }, "limits": { "$ref": "#/components/schemas/FileLimits" }, "chunks_in_prompt": { "type": "integer", "minimum": 0, "description": "How many file chunks the Avatar's replies to this member carry." } } }, "FileListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/FileList" } } }, "FileResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/File" } } }, "Footer": { "type": "object", "additionalProperties": false, "required": [ "id", "title_id", "footer_html", "is_default" ], "properties": { "id": { "type": "string", "nullable": true, "description": "The id of the title's own footer, or `null` when the title has none and the Avatar type's default is shown." }, "title_id": { "type": "string", "description": "The id of the title the footer belongs to." }, "footer_html": { "type": "string", "description": "The footer's HTML. A footer written through the API is stored as an HTML fragment with scripts, event handlers and script links removed." }, "is_default": { "type": "boolean", "description": "`true` when the title has no footer of its own and `footer_html` is the default of the Avatar's type. Always `false` after a write." } } }, "FooterResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Footer" } } }, "FoundationShowcase": { "type": "object", "additionalProperties": false, "required": [ "titles", "author_avatars" ], "properties": { "titles": { "type": "array", "description": "The public Foundation titles, each once, ordered by name.", "items": { "$ref": "#/components/schemas/FoundationShowcaseTitle" } }, "author_avatars": { "type": "array", "description": "The publicly listed Author Avatars, ordered by Avatar id.", "items": { "$ref": "#/components/schemas/FoundationShowcaseAuthorAvatar" } } } }, "FoundationShowcaseAuthorAvatar": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "type", "blurb", "avatar_logo_url", "avatar_info_url" ], "properties": { "id": { "type": "string", "description": "The Avatar's id." }, "name": { "type": "string", "description": "The Avatar's name." }, "type": { "type": "string", "description": "The Avatar's type, always Author Avatar." }, "blurb": { "type": "string", "description": "One paragraph composed from the Avatar's mission, vision, values, industries and expertise." }, "avatar_logo_url": { "type": "string", "description": "The address of the Avatar's logo, or the empty string." }, "avatar_info_url": { "type": "string", "description": "The Avatar's information page, an http or https address, or the empty string." } } }, "FoundationShowcaseResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/FoundationShowcase" } } }, "FoundationShowcaseTitle": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "description", "authors", "image_url", "owner_image_url" ], "properties": { "id": { "type": "string", "description": "The title's id." }, "name": { "type": "string", "description": "The title's name." }, "description": { "type": "string", "description": "The title's description, the empty string when it has none." }, "authors": { "type": "array", "description": "The author names to print; empty when neither the title nor its owner names one.", "items": { "type": "string" } }, "image_url": { "type": "string", "description": "The address of the title's approved image, or the empty string." }, "owner_image_url": { "type": "string", "description": "The address of the owning Foundation Author's approved photo, or the empty string." } } }, "Interaction": { "type": "object", "additionalProperties": false, "required": [ "id", "avatar_id", "user_id", "created_at", "access", "reference_chunk_ids" ], "properties": { "id": { "type": "string", "description": "The interaction's id." }, "avatar_id": { "type": "string", "description": "The id of the Avatar the interaction was stored under." }, "user_id": { "type": "string", "nullable": true, "description": "The id of the member. It is null on an interaction the retention rules blanked." }, "created_at": { "type": "string", "format": "date-time", "description": "When the interaction was stored, in UTC to the millisecond." }, "access": { "type": "string", "enum": [ "content", "metadata" ], "description": "`content` when the interaction carries its text, `metadata` when it does not." }, "reference_chunk_ids": { "type": "array", "items": { "type": "string" }, "description": "The ids of the Content chunks the reply cited, as MaxGood.work shows them to the Avatar's Owner and Admins." }, "user_text": { "type": "string", "description": "What the member wrote. It is present only when `access` is `content`." }, "reply": { "type": "string", "description": "What the Avatar answered. It is present only when `access` is `content`." } } }, "InteractionList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total", "access", "scope" ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Interaction" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The page size used." }, "total": { "type": "integer", "minimum": 0, "description": "The number of interactions the key may read, across all pages." }, "access": { "type": "string", "enum": [ "content" ], "description": "What the key reads of the list. It is `content`; an interaction the retention rules blanked says `metadata` in its own `access`." }, "scope": { "type": "string", "enum": [ "all", "own_and_clients", "clients" ], "description": "Whose interactions the list holds, by the key issuer's role." } } }, "InteractionListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/InteractionList" } } }, "Logistics": { "type": "object", "additionalProperties": false, "required": [ "support_email", "whatsapp", "booking_url", "website_url", "linkedin_url", "x_url", "instagram_url", "phone", "office_hours", "preferred_channel_note" ], "description": "The contact and availability details an Avatar shows. All ten keys are always present. Each has one `enabled` switch.", "properties": { "support_email": { "$ref": "#/components/schemas/LogisticsEmails" }, "whatsapp": { "$ref": "#/components/schemas/LogisticsField" }, "booking_url": { "$ref": "#/components/schemas/LogisticsField" }, "website_url": { "$ref": "#/components/schemas/LogisticsField" }, "linkedin_url": { "$ref": "#/components/schemas/LogisticsField" }, "x_url": { "$ref": "#/components/schemas/LogisticsField" }, "instagram_url": { "$ref": "#/components/schemas/LogisticsField" }, "phone": { "$ref": "#/components/schemas/LogisticsPhone" }, "office_hours": { "$ref": "#/components/schemas/LogisticsOfficeHours" }, "preferred_channel_note": { "$ref": "#/components/schemas/LogisticsField" } } }, "LogisticsEmails": { "type": "object", "additionalProperties": false, "required": [ "enabled", "value" ], "properties": { "enabled": { "type": "boolean", "description": "Whether the Avatar shows its support email addresses. It is true until the Avatar's Owner or Admin switches it off." }, "value": { "type": "array", "description": "The support email addresses, in lower case and without repeats. The array is empty when none is stored.", "items": { "type": "string" } } } }, "LogisticsField": { "type": "object", "additionalProperties": false, "required": [ "enabled", "value" ], "properties": { "enabled": { "type": "boolean", "description": "Whether the Avatar shows this detail. It is true until the Avatar's Owner or Admin switches it off." }, "value": { "type": "string", "description": "The detail, or the empty string when none is stored. A link is an http or https address of at most 500 characters. `whatsapp` is a link or a phone number. `preferred_channel_note` is text of at most 1,000 characters." } } }, "LogisticsOfficeHours": { "type": "object", "additionalProperties": false, "required": [ "enabled", "hours", "timezone" ], "properties": { "enabled": { "type": "boolean", "description": "Whether the Avatar shows its office hours. The switch covers `hours` and `timezone`. It is true until the Avatar's Owner or Admin switches it off." }, "hours": { "type": "string", "description": "The office hours as text of at most 1,000 characters, or the empty string when none is stored." }, "timezone": { "type": "string", "description": "The time zone of the office hours, a name from the IANA time zone database such as `America/Toronto`, or the empty string when none is stored." } } }, "LogisticsPhone": { "type": "object", "additionalProperties": false, "required": [ "enabled", "number", "country" ], "properties": { "enabled": { "type": "boolean", "description": "Whether the Avatar shows its phone number. The switch covers `number` and `country`. It is true until the Avatar's Owner or Admin switches it off." }, "number": { "type": "string", "description": "The phone number, or the empty string when none is stored. It holds 7 to 20 digits, with an optional leading plus sign, spaces, brackets, dots and hyphens." }, "country": { "type": "string", "description": "The country the number belongs to, as text of at most 1,000 characters, or the empty string when none is stored." } } }, "LogisticsResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Logistics" } } }, "Member": { "type": "object", "description": "One person's active membership in the Avatar. Every property is always present.", "additionalProperties": false, "required": [ "id", "email", "name", "is_admin", "is_coach", "is_owner", "license_expires_at", "joined_at", "coach_user_id", "status", "archived_at" ], "properties": { "id": { "type": "string", "description": "The member's user id." }, "email": { "type": "string", "description": "The member's email address." }, "name": { "type": "string", "nullable": true, "description": "The member's name." }, "is_admin": { "type": "boolean", "description": "The member is an Avatar Admin." }, "is_coach": { "type": "boolean", "description": "The member holds the Coach role." }, "is_owner": { "type": "boolean", "description": "The member is the Avatar's Owner." }, "license_expires_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the member's licence ends, as an RFC 3339 UTC timestamp, or `null` when it does not." }, "joined_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the member joined the Avatar, as an RFC 3339 UTC timestamp." }, "coach_user_id": { "type": "string", "nullable": true, "description": "The user id of the member's Coach, or `null` when the member has none or the Avatar's type has no Coach role." }, "status": { "type": "string", "enum": [ "active", "license_expired", "archived" ], "description": "`active`, `license_expired` (the licence date has passed) or `archived` (an Owner, Admin or MaxGood.work staff paused the membership)." }, "archived_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the membership was archived, or `null`." } } }, "MemberDeleted": { "type": "object", "additionalProperties": false, "required": [ "id", "deleted" ], "properties": { "id": { "type": "string", "description": "The id of the member whose membership ended." }, "deleted": { "type": "boolean", "enum": [ true ], "description": "Always `true`." } } }, "MemberDeletedResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberDeleted" } } }, "MemberFact": { "type": "object", "description": "One Fact the Avatar keeps about a member, as the person who issued the key sees it. It has every field of a Fact of the Avatar and the `user_id` of the member it is about.", "additionalProperties": false, "required": [ "id", "user_id", "text", "token_count", "status", "source", "created_by_user_id", "created_at", "updated_at", "version_count", "access" ], "properties": { "id": { "type": "string", "description": "The Fact's id, a string of digits." }, "user_id": { "type": "string", "description": "The id of the member the Fact is about." }, "text": { "type": "string", "description": "The Fact." }, "token_count": { "type": "integer", "minimum": 0, "description": "The tokens the text uses." }, "status": { "type": "string", "enum": [ "active", "hidden" ], "description": "An `active` Fact is woven into the Avatar's replies to the member and counts toward the total limit; a `hidden` one is kept and does neither." }, "source": { "type": "string", "nullable": true, "description": "Who the Fact came from, for example `owner`, `admin` or `coach`." }, "created_by_user_id": { "type": "string", "nullable": true, "description": "The id of the person who wrote the Fact, or `null` where the issuer of the key may not see who wrote it." }, "created_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the Fact was added." }, "updated_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the Fact last changed." }, "version_count": { "type": "integer", "minimum": 0, "nullable": true, "description": "The number of earlier versions of the text, or `null` when the Avatar's type keeps no edit history." }, "access": { "type": "string", "enum": [ "edit", "view" ], "description": "What the issuer of the key may do with this Fact in the MaxGood.work web app." } } }, "MemberFactCreateRequest": { "type": "object", "additionalProperties": false, "required": [ "text" ], "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "The Fact, a short statement about the member. Leading and trailing spaces are removed. It is at most 2,000 characters and at most the Avatar type's largest Fact in tokens." } } }, "MemberFactList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total", "limits" ], "properties": { "items": { "type": "array", "description": "The Facts of this page.", "items": { "$ref": "#/components/schemas/MemberFact" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The number of Facts a full page holds." }, "total": { "type": "integer", "minimum": 0, "description": "The number of Facts about the member that match, across all pages." }, "limits": { "$ref": "#/components/schemas/FactLimits" } } }, "MemberFactListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberFactList" } } }, "MemberFactResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberFact" } } }, "MemberInteractionList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total", "access", "summary" ], "properties": { "items": { "type": "array", "description": "The page, newest first. Empty at metadata access.", "items": { "$ref": "#/components/schemas/Interaction" } }, "page": { "type": "integer", "description": "The page returned, from 1." }, "page_size": { "type": "integer", "description": "The page size, from 1 to 100." }, "total": { "type": "integer", "description": "The interactions the query selects. 0 at metadata access." }, "access": { "type": "string", "enum": [ "content", "metadata" ], "description": "What the key reads of this member." }, "summary": { "$ref": "#/components/schemas/MemberInteractionSummary" } } }, "MemberInteractionListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberInteractionList" } } }, "MemberInteractionSummary": { "type": "object", "nullable": true, "description": "What a key whose issuer reads a member's interactions as metadata only\nreceives instead of the text: counts and sizes, with the titles the Avatar\ncited and no words from the interactions. It is `null` at content access.\n", "additionalProperties": false, "required": [ "user_id", "avatar_id", "interaction_count", "characters", "tokens", "last_interaction_at", "cited_chunks_total", "cited_titles", "unattributed_chunks", "user_file_chunks", "other_chunks", "hidden_title_chunks", "titles_hidden" ], "properties": { "user_id": { "type": "string", "description": "The member's id." }, "avatar_id": { "type": "string", "description": "The Avatar's id." }, "interaction_count": { "type": "integer", "description": "The member's interactions with the Avatar." }, "characters": { "type": "integer", "description": "The characters in those interactions." }, "tokens": { "type": "integer", "description": "The tokens in those interactions." }, "last_interaction_at": { "type": "string", "nullable": true, "description": "When the member last interacted with the Avatar, in UTC, or `null`." }, "cited_chunks_total": { "type": "integer", "description": "The chunks the Avatar cited in its replies to the member." }, "cited_titles": { "type": "array", "description": "The titles the cited chunks belong to, most cited first.", "items": { "type": "object", "additionalProperties": false, "required": [ "title_id", "title", "chunks", "retrieval_source" ], "properties": { "title_id": { "type": "string" }, "title": { "type": "string" }, "chunks": { "type": "integer" }, "retrieval_source": { "type": "string" } } } }, "unattributed_chunks": { "type": "integer", "description": "Cited chunks whose title is not named because its author asked for no attribution." }, "user_file_chunks": { "type": "integer", "description": "Cited chunks that came from User Files." }, "other_chunks": { "type": "integer", "description": "Cited chunks from sources the summary does not name." }, "hidden_title_chunks": { "type": "integer", "description": "Cited chunks whose title the Avatar hides." }, "titles_hidden": { "type": "boolean", "description": "`true` when the Avatar hides its titles, so `cited_titles` is empty." } } }, "MemberList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total" ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Member" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The page size used." }, "total": { "type": "integer", "minimum": 0, "description": "How many active members the Avatar has, whatever the page." } } }, "MemberListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberList" } } }, "MemberNotes": { "type": "object", "description": "The Avatar's notes about one member.", "additionalProperties": false, "required": [ "user_id", "notes", "withheld", "meta" ], "properties": { "user_id": { "type": "string", "description": "The member's id." }, "notes": { "type": "string", "nullable": true, "description": "The notes, or `null` when the member has none or when `withheld` is `true`." }, "withheld": { "type": "boolean", "description": "`true` when the person who issued the key may not read the notes. `notes` is then `null` and only `meta` is shown." }, "meta": { "type": "object", "description": "What is known about the notes, with or without their text.", "additionalProperties": false, "required": [ "chars", "updated_at", "updated_by_role" ], "properties": { "chars": { "type": "integer", "minimum": 0, "description": "The number of characters stored, 0 when there are no notes." }, "updated_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the notes were last written, or `null` when it is not recorded." }, "updated_by_role": { "type": "string", "nullable": true, "description": "The role that last wrote the notes (`owner`, `admin`, `coach`, `staff`, `api` or `system`), or `null` when it is not recorded." } } } } }, "MemberNotesResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberNotes" } } }, "MemberResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Member" } } }, "MemberStructuredData": { "type": "object", "additionalProperties": false, "required": [ "user_id", "structured_data", "withheld", "meta" ], "description": "The structured data your Avatar keeps about one member: a JSON object that\nonly your Avatar reads. A key that may not read it receives `withheld: true`\nand a `null` value, with the size in `meta`.\n", "properties": { "user_id": { "type": "string", "description": "The Member's id." }, "structured_data": { "type": "object", "nullable": true, "additionalProperties": true, "description": "The structured data the Avatar keeps about the Member, a JSON object, or\n`null` when there is none or when `withheld` is `true`.\n" }, "withheld": { "type": "boolean", "description": "`true` when the key's issuer may not read the value: the answer then\nholds `null` and `meta` only.\n" }, "meta": { "$ref": "#/components/schemas/MemberStructuredDataMeta" } } }, "MemberStructuredDataMeta": { "type": "object", "additionalProperties": false, "required": [ "chars" ], "properties": { "chars": { "type": "integer", "minimum": 0, "description": "The number of characters of the stored value written as compact JSON\n(no spaces), 0 when there is none. It is present even when the key\nholds the metadata only.\n" } } }, "MemberStructuredDataReplace": { "type": "object", "additionalProperties": false, "required": [ "structured_data" ], "description": "The new structured data. It replaces the stored value as a whole.", "properties": { "structured_data": { "type": "object", "nullable": true, "description": "The JSON object to store, or `null` to clear the stored value. Its\ncompact JSON may hold at most 262,144 characters.\n" } } }, "MemberStructuredDataResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberStructuredData" } } }, "MemberUpdate": { "type": "object", "additionalProperties": false, "minProperties": 1, "description": "The fields to change. Send at least one. A field that is not sent stays as\nit is. Every other field of a member answers `400` with the reason\n`not_editable` (the member's profile, `notes` and `structured_data`) or\n`unknown_field`.\n", "properties": { "is_admin": { "type": "boolean", "description": "`true` makes the member an Avatar Admin and `false` removes the role.\nOnly a key issued by the Avatar's Owner may change it. On an Avatar\ntype with the Coach role, making a member an Avatar Admin also makes\nthem an Avatar Coach.\n" }, "is_coach": { "type": "boolean", "description": "`true` makes the member an Avatar Coach, on an Avatar type that has the\nCoach role only. `false` clears the role. Only a key issued by the\nAvatar's Owner may change it.\n" }, "license_expires_at": { "type": "string", "nullable": true, "maxLength": 40, "description": "When the member's access ends, as an RFC 3339 timestamp\n(`2027-06-30T00:00:00Z`) or a date (`2027-06-30`, midnight UTC), or\n`null` to remove the end date.\n" } } }, "MemberUpdateResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Member" } } }, "PublicAvatar": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "mission", "vision", "values", "industries", "expertise", "avatar_info_url", "avatar_logo_url", "type", "category", "created_at", "has_icon", "popularity", "public_link", "public_sort_rank" ], "properties": { "id": { "type": "string", "description": "The identifier of the Avatar." }, "name": { "type": "string", "description": "The Avatar's display name." }, "mission": { "type": "string", "description": "The Avatar's mission from its Align settings, or the empty string." }, "vision": { "type": "string", "description": "The Avatar's vision from its Align settings, or the empty string." }, "values": { "type": "string", "description": "The Avatar's values from its Align settings, or the empty string." }, "industries": { "type": "string", "description": "The Avatar's industries from its Align settings, or the empty string." }, "expertise": { "type": "string", "description": "The Avatar's area of expertise from its Align settings, or the empty string." }, "avatar_info_url": { "type": "string", "description": "The Avatar's web address, or the empty string when it has none." }, "avatar_logo_url": { "type": "string", "description": "A path, not a full address. When `has_icon` is true it is the Avatar's logo, served by the API host; otherwise it is the path of the default Avatar image on the MaxGood.work web app." }, "type": { "type": "string", "description": "The Avatar type." }, "category": { "$ref": "#/components/schemas/PublicAvatarCategory" }, "created_at": { "type": "string", "format": "date-time", "nullable": true, "description": "The moment the Avatar was created, an RFC 3339 timestamp in UTC, or null when it is not known." }, "has_icon": { "type": "boolean", "description": "The Avatar has its own logo." }, "popularity": { "type": "string", "enum": [ "NEW", "POPULAR", "WAITLIST" ], "description": "The Avatar's pill. Counts are not published." }, "public_link": { "type": "string", "nullable": true, "description": "The page to send a visitor to, or null." }, "public_sort_rank": { "type": "integer", "description": "The order to show the list in, lowest first. It equals `category.rank`." } } }, "PublicAvatarCategory": { "type": "object", "additionalProperties": false, "required": [ "key", "label", "rank" ], "description": "The public listing category the Avatar belongs under.", "properties": { "key": { "type": "string", "description": "The stable identifier of the category." }, "label": { "type": "string", "description": "The heading to show for the category." }, "rank": { "type": "integer", "description": "The position of the category in the list, lowest first." } } }, "PublicAvatarsResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "type": "object", "additionalProperties": false, "required": [ "avatars" ], "properties": { "avatars": { "type": "array", "description": "The listed Avatars in ascending order of `id`.", "items": { "$ref": "#/components/schemas/PublicAvatar" } } } } } }, "PublicFoundationAuthor": { "type": "object", "additionalProperties": false, "required": [ "id", "display_name", "bio", "backlink", "photo_url" ], "properties": { "id": { "type": "string", "description": "The Foundation Author's id." }, "display_name": { "type": "string", "description": "The name the Foundation Author publishes." }, "bio": { "type": "string", "description": "The Foundation Author's bio. The empty string when there is none." }, "backlink": { "type": "string", "description": "The address of the Foundation Author's own site. The empty string when there is none." }, "photo_url": { "type": "string", "description": "The path of the Foundation Author's photo. It answers the photo once MaxGood.work has approved it and `404` until then." } } }, "PublicFoundationAuthors": { "type": "object", "additionalProperties": false, "required": [ "authors" ], "properties": { "authors": { "type": "array", "items": { "$ref": "#/components/schemas/PublicFoundationAuthor" } } } }, "PublicFoundationAuthorsResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/PublicFoundationAuthors" } } }, "PublicFoundationTitle": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "description", "authors", "owner", "usage_count", "image_url" ], "properties": { "id": { "type": "string", "description": "The title's id." }, "name": { "type": "string", "description": "The title's name." }, "description": { "type": "string", "description": "The title's description, or the empty string." }, "authors": { "type": "array", "items": { "type": "string" }, "description": "The author names the title carries." }, "owner": { "type": "string", "description": "The id of the Foundation Author who owns the title." }, "usage_count": { "type": "integer", "minimum": 0, "description": "The number of times the title's content has been cited in an Avatar reply." }, "image_url": { "type": "string", "description": "The path of the title's image. The image is shown only when it has been approved." } } }, "PublicFoundationTitles": { "type": "object", "additionalProperties": false, "required": [ "titles" ], "properties": { "titles": { "type": "array", "items": { "$ref": "#/components/schemas/PublicFoundationTitle" } } } }, "PublicFoundationTitlesResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/PublicFoundationTitles" } } }, "PublicFreeAvatar": { "type": "object", "additionalProperties": false, "required": [ "name", "free_trial_days", "key_benefit" ], "properties": { "name": { "type": "string", "description": "The Avatar's name." }, "free_trial_days": { "type": "integer", "minimum": 0, "description": "`0` is free with no end date; otherwise the free period in days." }, "key_benefit": { "type": "string", "description": "One short sentence naming the Avatar's key benefit, or the empty string." } } }, "PublicFreeAvatars": { "type": "object", "additionalProperties": false, "required": [ "avatars" ], "properties": { "avatars": { "type": "array", "description": "The free Avatars, ordered by `name` without regard to case.", "items": { "$ref": "#/components/schemas/PublicFreeAvatar" } } } }, "PublicFreeAvatarsResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/PublicFreeAvatars" } } }, "PublicStats": { "type": "object", "additionalProperties": false, "required": [ "total_avatars", "total_users", "total_interactions" ], "properties": { "total_avatars": { "type": "integer", "minimum": 0, "description": "The number of Avatars." }, "total_users": { "type": "integer", "minimum": 0, "description": "The number of user accounts, archived and removed accounts included." }, "total_interactions": { "type": "integer", "minimum": 0, "description": "The number of stored interactions, hidden and removed interactions included." } } }, "PublicStatsResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/PublicStats" } } }, "ReplaceMemberNotesRequest": { "type": "object", "additionalProperties": false, "required": [ "notes" ], "properties": { "notes": { "type": "string", "nullable": true, "description": "The Avatar's notes about the member, replacing the stored notes. `null` or an empty text clears them. The text may hold line breaks and tabs; any other control character is refused. At most 2,500 characters; a longer text is refused and nothing is truncated." } } }, "ReplaceMemberNotesResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberNotes" } } }, "Reply": { "type": "object", "additionalProperties": false, "required": [ "reply", "interaction_id", "reference_urls" ], "properties": { "reply": { "type": "string", "description": "The Avatar's text. Foundation attribution is rendered into it as Markdown; show it as it is. When the Avatar displays its references, a final `[References]: , ` line carries them." }, "interaction_id": { "type": "string", "description": "The id of the interaction the exchange was stored as. It is for reference only; no request takes it as input." }, "reference_urls": { "type": "array", "items": { "type": "string" }, "description": "The links to the Content the reply cites, when the Avatar does not display its references. It is empty when the references are in `reply`." } } }, "RespondRefusal": { "type": "object", "description": "The refusal of a turn the Avatar stored. `response` is the refusal text the member would have read, and `interaction_id` the stored turn.", "additionalProperties": false, "required": [ "result", "response", "error_code", "request_id", "interaction_id" ], "properties": { "result": { "type": "string", "enum": [ "failure" ] }, "response": { "type": "string", "description": "The Avatar's own refusal text (or the platform's, in the member's language). It is not the catalogue message." }, "error_code": { "type": "string", "enum": [ "member_archived", "member_license_expired", "member_suspended" ], "description": "The stable identifier to branch on." }, "request_id": { "type": "string", "pattern": "^req_[0-9a-f]{32}$", "description": "The value of the `X-Request-Id` response header." }, "interaction_id": { "type": "string", "description": "The id of the stored turn." } } }, "RespondRequest": { "type": "object", "additionalProperties": false, "required": [ "user_id", "prompt" ], "properties": { "user_id": { "type": "string", "minLength": 1, "maxLength": 128, "description": "The `id` of the member the reply is for. The member must belong to the key's Avatar." }, "prompt": { "type": "string", "minLength": 1, "description": "The member's message. It is not empty once spaces at its ends are removed, holds at most 10,000 characters and at most 4,096 tokens, and holds no NUL character. New lines are allowed." } } }, "RespondResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Reply" } } }, "SetFooterRequest": { "type": "object", "additionalProperties": false, "required": [ "footer_html" ], "properties": { "footer_html": { "type": "string", "maxLength": 500, "description": "The footer, an HTML fragment of at most 500 characters. Scripts, event handlers and script links are removed before it is stored. An empty string stores an empty footer." } } }, "Tag": { "type": "object", "description": "One tag a member holds in the Avatar. A tag is identified by its `name` within the member, so it has no `id`.", "additionalProperties": false, "required": [ "name", "description", "source", "applied_at" ], "properties": { "name": { "type": "string", "description": "The tag's name. A tag is identified by its name within one member, so it has no `id`." }, "description": { "type": "string", "description": "What the tag means, in the words of the integration that applied it." }, "source": { "type": "string", "description": "The integration or process that applied the tag." }, "applied_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When the tag was applied, in UTC to the millisecond. It is null when no time was recorded." } } }, "TagInput": { "type": "object", "description": "A tag to add. All three fields are required text. The name is not blank and holds no control character. The name and description hold none of `{`, `}`, `[`, `]`, `<`, `>`, `\"` or `'`, and together they hold at most 2,000 characters. The description and the source may be empty.", "additionalProperties": false, "required": [ "name", "description", "source" ], "properties": { "name": { "type": "string", "description": "The tag name. Sending a name the member already holds updates that tag's description and source." }, "description": { "type": "string", "description": "What the tag means." }, "source": { "type": "string", "description": "Where the tag came from, for example the name of your system." } } }, "TagList": { "type": "object", "description": "A page of tags.", "additionalProperties": false, "required": [ "items", "page", "page_size", "total" ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Tag" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned. An add answers one page, page 1." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The page size used. An add answers every tag it applied, so this is the number applied." }, "total": { "type": "integer", "minimum": 0, "description": "The number of tags the member holds, across all pages. An add reports the number of tags it applied." } } }, "TagListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/TagList" } } }, "Title": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "is_enabled", "chunk_count", "created_at", "is_linked_from_other_avatar", "priority" ], "properties": { "id": { "type": "string", "description": "The title's id." }, "name": { "type": "string", "description": "The title's name." }, "is_enabled": { "type": "boolean", "description": "Whether the Avatar uses the title when it answers. A new title is switched off." }, "chunk_count": { "type": "integer", "minimum": 0, "description": "The number of active sections the title holds. A new title holds none." }, "created_at": { "type": "string", "nullable": true, "description": "When the title was created, as an RFC 3339 UTC timestamp, or `null` when it is not known." }, "is_linked_from_other_avatar": { "type": "boolean", "description": "`true` for a title another Avatar shares into this Avatar, `false` for the Avatar's own titles." }, "priority": { "type": "string", "enum": [ "high", "normal", "low" ], "description": "The Avatar's own preference for the title. It is `normal` until it is set." } } }, "TitleList": { "type": "object", "additionalProperties": false, "required": [ "items", "page", "page_size", "total" ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Title" } }, "page": { "type": "integer", "minimum": 1, "description": "The page returned." }, "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "The page size used." }, "total": { "type": "integer", "minimum": 0, "description": "The number of titles the Avatar has, own and shared in together, across all pages." } } }, "TitleListResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/TitleList" } } }, "TitleResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Title" } } }, "UpdateContentFactRequest": { "type": "object", "additionalProperties": false, "minProperties": 1, "description": "The change to an Avatar-wide Fact. Send `status`, `text` or both. A field\nthat is not listed answers `400` `invalid_request`.\n", "properties": { "status": { "type": "string", "enum": [ "active", "hidden" ], "description": "`hidden` stops the Avatar using the Fact; `active` lets it use the Fact\nagain and counts the Fact in the Avatar's total Fact limit. Letter case\nis ignored.\n" }, "text": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "The new text of the Fact, at most 2000 characters and within the\nAvatar's limit of tokens for one Fact. Leading and trailing white space\nis removed. It must not be empty.\n" } } }, "UpdateContentFactResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Fact" } } }, "UpdateContentTitleRequest": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string", "maxLength": 255, "description": "The new name of the title. Leading and trailing white space is removed. A shared-in title cannot be renamed." }, "is_enabled": { "type": "boolean", "description": "`true` lets the Avatar use the title and `false` stops it. A title with no active chunks cannot be switched on. A shared-in title cannot be switched." }, "priority": { "type": "string", "enum": [ "high", "normal", "low" ], "description": "The Avatar's own priority for the title, own or shared in. Only a key issued by the Avatar's Owner may send it." } } }, "UpdateMemberFactRequest": { "type": "object", "additionalProperties": false, "minProperties": 1, "description": "The change to a Fact about a member. Send `status`, `text` or both. A field\nthat is not listed answers `400` `invalid_request`.\n", "properties": { "status": { "type": "string", "enum": [ "active", "hidden" ], "description": "`hidden` stops the Avatar using the Fact; `active` lets it use the Fact\nagain and counts the Fact in the Avatar's total Fact limit. Letter case\nis ignored.\n" }, "text": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "The new text of the Fact, at most 2000 characters and within the\nAvatar's limit of tokens for one Fact. Leading and trailing white space\nis removed. It must not be empty.\n" } } }, "UpdateMemberFactResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/MemberFact" } } }, "Upload": { "type": "object", "additionalProperties": false, "required": [ "title_id", "document_id", "chunk_ids", "chunk_count" ], "properties": { "title_id": { "type": "string", "description": "The Content title the upload was added to." }, "document_id": { "type": "string", "nullable": true, "description": "The id of the stored document when a file was uploaded; `null` when text was uploaded, because text is stored as sections only." }, "chunk_ids": { "type": "array", "items": { "type": "string" }, "description": "The ids of the sections created, in order." }, "chunk_count": { "type": "integer", "minimum": 0, "description": "How many sections were created." } } }, "UploadResponse": { "type": "object", "additionalProperties": false, "required": [ "result", "response" ], "properties": { "result": { "type": "string", "enum": [ "success" ] }, "response": { "$ref": "#/components/schemas/Upload" } } } }, "securitySchemes": { "AvatarApiKey": { "type": "http", "scheme": "bearer", "bearerFormat": "mgak_.", "description": "An Avatar API key, created on the *Account* tab of *Avatar Admin* in the\nMaxGood.work web app by the Avatar's Owner or an Avatar Admin, for an\nEssential Avatar or an Enterprise Avatar. Send it as\n`Authorization: Bearer mgak_.`. A key is shown once,\nwhen it is created, is bound to one Avatar and acts on that Avatar only.\n\nA key carries one or more scopes, chosen when it is created: `read` allows\nevery `GET` operation, `write` every other change to Members and Content, and\n`chat` the Avatar's replies. A key created before `/v1` carries all three.\n\nA key acts with the authority its issuer, the person who created it, holds in\nthe Avatar when the request arrives. A key whose issuer has left the Avatar\nreaches nothing.\n\nEvery key operation passes these checks in order, and the first that fails\nanswers: the key is present, well formed, known and not revoked (`401`); the\nkey is not paused (`403` `key_frozen`); the Avatar's type offers the API\n(`403` `api_not_available`); the key holds the scope the operation needs\n(`403` `insufficient_scope`, with `required_scope`); the issuer may act\n(`403` `issuer_not_authorized`); and the Avatar's Owner has accepted the\ncurrent Owner agreement (`403` `agreement_required`, with `agreement_party`\nand `agreement_url`); for an operation on members, the key is attached to\na confirmed, answering member-event endpoint (`403`\n`member_events_endpoint_required` or `member_events_unreachable`). The\noperation's own input checks follow, and then its\nrate limit is counted.\n" } } } }