### Run Anytype CLI Server Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/cli.mdx Starts the Anytype server interactively. For background operation, use 'anytype service install' and 'anytype service start'. ```bash anytype serve ``` -------------------------------- ### Manage Anytype Service Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/cli.mdx Installs and starts the Anytype CLI as a background service. Use 'anytype service stop' and 'anytype service uninstall' to manage it. ```bash anytype service install anytype service start ``` -------------------------------- ### Start Local Development Server Source: https://github.com/anyproto/anytype-api/blob/main/README.md Run this command to start a local development server. Changes are reflected live without a server restart. ```bash npm run start ``` -------------------------------- ### Install Anytype CLI Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/cli.mdx Installs the Anytype CLI using a bash script. Ensure you have curl installed. ```bash /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/anyproto/anytype-cli/HEAD/install.sh)" ``` -------------------------------- ### Configure MCP Client with Global Installation Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/mcp.mdx Update your MCP client configuration to use the globally installed Anytype MCP server. Replace `` with your actual API key. ```json { "mcpServers": { "anytype": { "command": "anytype-mcp", "env": { "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer \", \"Anytype-Version\":\"2025-11-08\"}" } } } } ``` -------------------------------- ### Install Anytype MCP Server Globally Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/mcp.mdx Install the Anytype MCP server package globally using npm. This allows you to use the `anytype-mcp` command directly. ```bash npm install -g @anyproto/anytype-mcp ``` -------------------------------- ### Example Project Entry JSON Source: https://github.com/anyproto/anytype-api/blob/main/data/README.md This JSON object represents a single project entry in the community showcase. Ensure all required fields are present and correctly formatted. ```json { "id": "myusername/my-awesome-integration", "name": "My Awesome Integration", "description": "Integrates Anytype with another service", "author": "myusername", "repository": "https://github.com/myusername/my-awesome-integration", "tags": ["integration", "automation"], "category": "Integration", "language": "TypeScript", "status": "active", "dateAdded": "2025-08-19" } ``` -------------------------------- ### Access Anytype HTTP API Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/cli.mdx Example of how to make a request to the Anytype HTTP API to retrieve a list of spaces. Replace '' with your actual API key. ```bash curl "http://127.0.0.1:31012/spaces" \ -H "Authorization: Bearer " \ -H "Anytype-Version: 2025-11-08" ``` -------------------------------- ### Get Anytype API Key via CLI Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/mcp.mdx Use this command to retrieve your Anytype API key from the command line. ```bash npx -y @anyproto/anytype-mcp get-key ``` -------------------------------- ### Get All Spaces Source: https://github.com/anyproto/anytype-api/blob/main/docs/guides/get-started/02-spaces.md Send a GET request to the /spaces endpoint to retrieve a list of all available spaces. Ensure your API key is included in the Authorization header. ```bash curl -X GET "http://localhost:31009/v1/spaces" \ -H "Authorization: Bearer " ``` -------------------------------- ### Bearer Token Authentication - Bash Source: https://github.com/anyproto/anytype-api/blob/main/docs/guides/get-started/01-authentication.md Example of how to include the generated API key as a Bearer token in the Authorization header for subsequent API requests. ```bash Authorization: Bearer zhSG/zQRmgAD... ``` -------------------------------- ### List Spaces with Pagination Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/list-spaces.api.mdx Retrieves a list of spaces with support for pagination. Use `limit` to control the number of items per page and `offset` to specify the starting point. ```bash curl -X GET "https://api.example.com/v1/spaces?limit=10&offset=20" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Get Template Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-template.api.mdx Fetches a template by its ID. This is a common operation for retrieving configuration or content templates. ```APIDOC ## GET /templates/{templateId} ### Description Retrieves a specific template using its unique identifier. ### Method GET ### Endpoint /templates/{templateId} ### Parameters #### Path Parameters - **templateId** (string) - Required - The unique identifier of the template to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the template. - **name** (string) - The name of the template. - **content** (string) - The content of the template. #### Response Example ```json { "id": "tpl_12345", "name": "Welcome Email", "content": "

Welcome!

" } ``` ``` -------------------------------- ### Create Chat Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/create-chat.api.mdx Initiates the creation of a new chat session. This endpoint allows users to start a conversation by providing necessary details. ```APIDOC ## POST /chats ### Description Creates a new chat. ### Method POST ### Endpoint /chats ### Request Body - **name** (string) - Required - The name of the chat. - **description** (string) - Optional - A description for the chat. ### Request Example ```json { "name": "My New Chat", "description": "This is a chat about project updates." } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the newly created chat. - **name** (string) - The name of the chat. - **description** (string) - The description of the chat. - **createdAt** (string) - The timestamp when the chat was created. #### Response Example ```json { "id": "chat_abc123", "name": "My New Chat", "description": "This is a chat about project updates.", "createdAt": "2023-10-27T10:00:00Z" } ``` #### Error Handling - **400 Bad Request**: If the request body is invalid or missing required fields. - **500 Internal Server Error**: If there was an issue on the server while creating the chat. ``` -------------------------------- ### Get property Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-property.api.mdx Fetches detailed information about one specific property by its ID. This includes the property’s unique identifier, name and format. This detailed view assists clients in showing property options to users and in guiding the user interface (such as displaying appropriate input fields or selection options). ```APIDOC ## Get property ### Description Fetches detailed information about one specific property by its ID. This includes the property’s unique identifier, name and format. This detailed view assists clients in showing property options to users and in guiding the user interface (such as displaying appropriate input fields or selection options). ### Method GET ### Endpoint /v1/spaces/{space_id}/properties/{property_id} ### Parameters #### Path Parameters - **space_id** (string) - Required - The unique identifier of the space. - **property_id** (string) - Required - The unique identifier of the property. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the property. - **name** (string) - The name of the property. - **format** (string) - The format of the property. ``` -------------------------------- ### Get Type Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-type.api.mdx Fetches detailed information about one specific type by its ID. This includes the type’s unique key, name, icon, and layout. This detailed view assists clients in understanding the expected structure and style for objects of that type and in guiding the user interface (such as displaying appropriate icons or layout hints). ```APIDOC ## GET /v1/spaces/{space_id}/types/{type_id} ### Description Fetches detailed information about one specific type by its ID. This includes the type’s unique key, name, icon, and layout. ### Method GET ### Endpoint /v1/spaces/{space_id}/types/{type_id} ### Parameters #### Path Parameters - **space_id** (string) - Required - The unique identifier for the space. - **type_id** (string) - Required - The unique identifier for the type. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the type. - **name** (string) - The name of the type. - **icon** (string) - The icon associated with the type. - **layout** (string) - The layout information for the type. ``` -------------------------------- ### Get Type Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-type.api.mdx Fetches detailed information about one specific type by its ID. This includes the type’s unique key, name, icon, and layout. This detailed view assists clients in understanding the expected structure and style for objects of that type and in guiding the user interface (such as displaying appropriate icons or layout hints). ```APIDOC ## Get Type ### Description Fetches detailed information about one specific type by its ID. This includes the type’s unique key, name, icon, and layout. This detailed view assists clients in understanding the expected structure and style for objects of that type and in guiding the user interface (such as displaying appropriate icons or layout hints). ### Method GET ### Endpoint /api/v1/types/{typeId} ### Parameters #### Path Parameters - **typeId** (string) - Required - The unique identifier of the type to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the type. - **name** (string) - The name of the type. - **icon** (string) - The icon associated with the type. - **layout** (object) - Information about the layout of the type. - **type** (string) - The layout type. - **config** (object) - Configuration details for the layout. #### Response Example ```json { "id": "user-type-123", "name": "User", "icon": "user-icon.png", "layout": { "type": "form", "config": { "fields": [ {"key": "name", "label": "Name"}, {"key": "email", "label": "Email"} ] } } } ``` ``` -------------------------------- ### Get Member Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-member.api.mdx Fetches detailed information about a single member within a space. The endpoint returns the member’s identifier, name, icon, identity, global name, status and role. The member_id path parameter can be provided as either the member's ID (starting with `_participant`) or the member's identity. This is useful for user profile pages, permission management, and displaying member-specific information in collaborative environments. ```APIDOC ## Get member ### Description Fetches detailed information about a single member within a space. The endpoint returns the member’s identifier, name, icon, identity, global name, status and role. The member_id path parameter can be provided as either the member's ID (starting with `_participant`) or the member's identity. This is useful for user profile pages, permission management, and displaying member-specific information in collaborative environments. ### Method GET ### Endpoint /v1/spaces/{space_id}/members/{member_id} ### Parameters #### Path Parameters - **space_id** (string) - Required - The unique identifier for the space. - **member_id** (string) - Required - The unique identifier for the member, which can be the member's ID (starting with `_participant`) or the member's identity. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **id** (string) - The unique identifier of the member. - **name** (string) - The name of the member. - **icon** (string) - The URL or identifier for the member's icon. - **identity** (string) - The identity of the member. - **global_name** (string) - The global name of the member. - **status** (string) - The current status of the member (e.g., 'online', 'offline'). - **role** (string) - The role of the member within the space (e.g., 'admin', 'member'). #### Response Example { "id": "_participant_abc123", "name": "John Doe", "icon": "https://example.com/icons/john.png", "identity": "john.doe@example.com", "global_name": "JohnDoe", "status": "online", "role": "member" } ``` -------------------------------- ### Serve Built Site Locally Source: https://github.com/anyproto/anytype-api/blob/main/CLAUDE.md Serves the production build of the Docusaurus site locally for final verification. ```bash npm run serve ``` -------------------------------- ### Get member Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-member.api.mdx Fetches detailed information about a single member within a space. The endpoint returns the member’s identifier, name, icon, identity, global name, status and role. The member_id path parameter can be provided as either the member's ID (starting with `_participant`) or the member's identity. This is useful for user profile pages, permission management, and displaying member-specific information in collaborative environments. ```APIDOC ## Get member ### Description Fetches detailed information about a single member within a space. The endpoint returns the member’s identifier, name, icon, identity, global name, status and role. ### Method GET ### Endpoint /members/{member_id} ### Parameters #### Path Parameters - **member_id** (string) - Required - The ID or identity of the member to retrieve. Can be a member ID (starting with `_participant`) or the member's identity. ``` -------------------------------- ### Configure MCP Client for Anytype (CLI) Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/mcp.mdx Use this command to add the Anytype MCP server to your Claude client configuration. Ensure you replace `` with your actual API key. ```bash claude mcp add anytype -e OPENAPI_MCP_HEADERS='{"Authorization":"Bearer ", "Anytype-Version":"2025-11-08"}' -s user -- npx -y @anyproto/anytype-mcp ``` -------------------------------- ### Get objects in list Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-list-objects.api.mdx Returns a paginated list of objects associated with a specific list (query or collection) within a space. When a view ID is provided, the objects are filtered and sorted according to the view's configuration. If no view ID is specified, all list objects are returned without filtering and sorting. This endpoint helps clients to manage grouped objects (for example, tasks within a list) by returning information for each item of the list. ```APIDOC ## GET /lists/{listId}/objects ### Description Returns a paginated list of objects associated with a specific list (query or collection) within a space. When a view ID is provided, the objects are filtered and sorted according to the view's configuration. If no view ID is specified, all list objects are returned without filtering and sorting. This endpoint helps clients to manage grouped objects (for example, tasks within a list) by returning information for each item of the list. ### Method GET ### Endpoint /lists/{listId}/objects ### Parameters #### Query Parameters - **viewId** (string) - Optional - The ID of the view to filter and sort objects by. - **limit** (integer) - Optional - The maximum number of objects to return. - **offset** (integer) - Optional - The number of objects to skip before returning results. ### Response #### Success Response (200) - **objects** (array) - An array of objects. - **id** (string) - The ID of the object. - **type** (string) - The type of the object. - **createdAt** (string) - The creation timestamp of the object. - **updatedAt** (string) - The update timestamp of the object. - **nextOffset** (integer) - The offset for the next page of results. #### Response Example { "objects": [ { "id": "obj_123", "type": "Task", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:00:00Z" } ], "nextOffset": 10 } ``` -------------------------------- ### Enable Local Search Functionality Source: https://github.com/anyproto/anytype-api/blob/main/README.md For local search to work, you must run these commands. The search index is generated during the build process. ```bash npm run build npm run serve ``` -------------------------------- ### Configure MCP Client for Anytype (JSON) Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/mcp.mdx Add this JSON configuration to your MCP client settings to connect to the Anytype MCP server. Replace `` with your actual API key. ```json { "mcpServers": { "anytype": { "command": "npx", "args": ["-y", "@anyproto/anytype-mcp"], "env": { "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer \", \"Anytype-Version\":\"2025-11-08\"}" } } } } ``` -------------------------------- ### Create API Key - Bash Source: https://github.com/anyproto/anytype-api/blob/main/docs/guides/get-started/01-authentication.md Exchanges a challenge ID and a 4-digit code (provided by the user in the Anytype desktop app) for an API key. This is the second step in the programmatic authentication flow. ```bash curl -X POST "http://localhost:31009/v1/auth/api_keys" \ -H "Content-Type: application/json" \ -H "Anytype-Version: 2025-11-08" \ -d '{ "challenge_id": "67647f5ecda913e9a2e11b26", "code": "1234" }' ``` -------------------------------- ### Create Anytype Bot Account Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/cli.mdx Creates a new bot account with a specified name for automations and integrations. ```bash anytype auth create my-bot ``` -------------------------------- ### Get chat message Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-chat-message.api.mdx Retrieves a single message from a chat by its id. ```APIDOC ## GET /v1/spaces/{space_id}/chats/{chat_id}/messages/{message_id} ### Description Retrieves a single message from a chat by its id. ### Method GET ### Endpoint /v1/spaces/{space_id}/chats/{chat_id}/messages/{message_id} ### Parameters #### Path Parameters - **space_id** (string) - Required - The ID of the space. - **chat_id** (string) - Required - The ID of the chat. - **message_id** (string) - Required - The ID of the message. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the message. - **chat_id** (string) - The ID of the chat the message belongs to. - **sender_id** (string) - The ID of the user who sent the message. - **content** (string) - The content of the message. - **timestamp** (string) - The timestamp when the message was sent (ISO 8601 format). - **read** (boolean) - Indicates if the message has been read by the recipient. #### Response Example ```json { "id": "msg_abc123", "chat_id": "chat_xyz789", "sender_id": "user_pqr456", "content": "Hello, how are you?", "timestamp": "2023-10-27T10:00:00Z", "read": true } ``` ``` -------------------------------- ### Create an Object using POST Source: https://github.com/anyproto/anytype-api/blob/main/docs/guides/get-started/03-objects.md Send a POST request to create a new object in a specified space. Include the object's name, icon, body content, type, and properties in the request payload. ```bash curl -X POST 'http://localhost:31009/v1/spaces//objects' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -H "Anytype-Version: 2025-11-08" \ -d '{ "name": "Project Plan", "icon": { "emoji": "📄", "format": "emoji" }, "body": "## Introduction\nThis project will...", "type_key": "page", "properties": [ { "key": "description", "text": "Outline for the new project" }, { "key": "done", "checkbox": true } ] }' ``` -------------------------------- ### Get Space by ID Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-space.api.mdx Retrieves the details of a specific space using its unique identifier. ```APIDOC ## GET /spaces/{spaceId} ### Description Retrieves the details of a specific space using its unique identifier. ### Method GET ### Endpoint /spaces/{spaceId} ### Parameters #### Path Parameters - **spaceId** (string) - Required - The unique identifier of the space to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the space. - **name** (string) - The name of the space. - **data** (object) - Additional data associated with the space. ``` -------------------------------- ### Create a Challenge Source: https://github.com/anyproto/anytype-api/blob/main/docs/guides/get-started/01-authentication.md Initiates an authentication challenge by supplying an app name. The server returns a `challenge_id` which will be displayed as a 4-digit code in the Anytype desktop application. ```APIDOC ## POST /v1/auth/challenges ### Description Initiates an authentication challenge. ### Method POST ### Endpoint /v1/auth/challenges ### Parameters #### Request Body - **app_name** (string) - Required - The name of your application. ### Request Example ```json { "app_name": "my_awesome_app" } ``` ### Response #### Success Response (200) - **challenge_id** (string) - The ID for the authentication challenge. ### Response Example ```json { "challenge_id": "67647f5ecda913e9a2e11b26" } ``` ``` -------------------------------- ### Get List Views Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-list-views.api.mdx Retrieves a list of views. Supports filtering by name and pagination. ```APIDOC ## GET /views ### Description Retrieves a list of views. Supports filtering by name and pagination. ### Method GET ### Endpoint /views ### Parameters #### Query Parameters - **name** (string) - Optional - Filters views by name. - **limit** (integer) - Optional - The maximum number of views to return. - **offset** (integer) - Optional - The number of views to skip before starting to collect the result set. ### Response #### Success Response (200) - **views** (array) - A list of view objects. - **id** (string) - The unique identifier of the view. - **name** (string) - The name of the view. - **createdAt** (string) - The timestamp when the view was created. - **updatedAt** (string) - The timestamp when the view was last updated. #### Response Example { "views": [ { "id": "view-123", "name": "My First View", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:00:00Z" } ] } ``` -------------------------------- ### Create a New Space Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/list-spaces.api.mdx Creates a new space with the provided configuration. Ensure all required fields in the request body are populated. ```bash curl -X POST "https://api.example.com/v1/spaces" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "New Project Space", "description": "A space for the new project" }' ``` -------------------------------- ### Get objects in list Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-list-objects.api.mdx Returns a paginated list of objects associated with a specific list (query or collection) within a space. When a view ID is provided, the objects are filtered and sorted according to the view's configuration. If no view ID is specified, all list objects are returned without filtering and sorting. This endpoint helps clients to manage grouped objects (for example, tasks within a list) by returning information for each item of the list. Supports dynamic filtering via query parameters (e.g., ?done=false, ?created_date[gte]=2024-01-01, ?tags[in]=urgent,important). For select/tag properties use tag keys, for object properties use object IDs. See FilterCondition enum for available conditions. ```APIDOC ## GET /v1/spaces/{space_id}/lists/{list_id}/views/{view_id}/objects ### Description Returns a paginated list of objects associated with a specific list (query or collection) within a space. When a view ID is provided, the objects are filtered and sorted according to the view's configuration. If no view ID is specified, all list objects are returned without filtering and sorting. This endpoint helps clients to manage grouped objects (for example, tasks within a list) by returning information for each item of the list. Supports dynamic filtering via query parameters (e.g., ?done=false, ?created_date[gte]=2024-01-01, ?tags[in]=urgent,important). For select/tag properties use tag keys, for object properties use object IDs. See FilterCondition enum for available conditions. ### Method GET ### Endpoint /v1/spaces/{space_id}/lists/{list_id}/views/{view_id}/objects ### Parameters #### Path Parameters - **space_id** (string) - Required - The unique identifier for the space. - **list_id** (string) - Required - The unique identifier for the list. - **view_id** (string) - Optional - The unique identifier for the view. If provided, objects are filtered and sorted according to the view's configuration. #### Query Parameters - **limit** (integer) - Optional - The maximum number of objects to return per page. - **offset** (integer) - Optional - The number of objects to skip before returning results. - **done** (boolean) - Optional - Filter by completion status. - **created_date[gte]** (string) - Optional - Filter objects created on or after a specific date (ISO 8601 format). - **tags[in]** (string) - Optional - Filter objects by tags (comma-separated). ### Response #### Success Response (200) - **objects** (array) - An array of objects associated with the list. - **id** (string) - The unique identifier for the object. - **name** (string) - The name of the object. - **done** (boolean) - The completion status of the object. - **created_at** (string) - The timestamp when the object was created. - **updated_at** (string) - The timestamp when the object was last updated. - **tags** (array) - An array of tags associated with the object. #### Response Example ```json { "objects": [ { "id": "obj_123", "name": "Example Task", "done": false, "created_at": "2024-01-15T10:00:00Z", "updated_at": "2024-01-15T10:00:00Z", "tags": ["urgent"] } ] } ``` ``` -------------------------------- ### Generate Anytype API Key Source: https://github.com/anyproto/anytype-api/blob/main/docs/examples/featured/cli.mdx Generates an API key for programmatic access to the Anytype API. Replace 'my-integration' with a descriptive name. ```bash anytype auth apikey create my-integration ``` -------------------------------- ### Get List Objects Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-list-objects.api.mdx Fetches a list of objects. Supports filtering by name and pagination using limit and offset. ```APIDOC ## GET /api/v1/objects ### Description Retrieves a list of objects. Supports filtering by name and pagination using limit and offset. ### Method GET ### Endpoint /api/v1/objects ### Parameters #### Query Parameters - **name** (string) - Optional - Filters objects by name. - **limit** (integer) - Optional - Specifies the maximum number of objects to return. Defaults to 20. - **offset** (integer) - Optional - Specifies the number of objects to skip. Defaults to 0. ### Response #### Success Response (200) - **objects** (array) - A list of object resources. - **id** (string) - The unique identifier of the object. - **name** (string) - The name of the object. - **createdAt** (string) - The timestamp when the object was created. - **totalCount** (integer) - The total number of objects available matching the query. #### Response Example ```json { "objects": [ { "id": "obj_123", "name": "Example Object", "createdAt": "2023-10-27T10:00:00Z" } ], "totalCount": 100 } ``` ``` -------------------------------- ### Build Production Site Source: https://github.com/anyproto/anytype-api/blob/main/CLAUDE.md Generates a production-ready build of the Docusaurus site for deployment. ```bash npm run build ``` -------------------------------- ### Create Object with Direct Path Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/create-object.api.mdx Use this method to create an object directly. Ensure you have the necessary permissions and the correct path. ```javascript const object = await client.object.create( "my-bucket", "my-object", "Hello World" ); ``` -------------------------------- ### Get List Objects Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-list-objects.api.mdx Fetches a list of objects. This endpoint is useful for retrieving multiple object records that match certain criteria. ```APIDOC ## GET /list/objects ### Description Retrieves a list of objects. This endpoint is useful for retrieving multiple object records that match certain criteria. ### Method GET ### Endpoint /list/objects ### Query Parameters - **filter** (string) - Optional - Specifies filtering criteria for the objects. - **sort** (string) - Optional - Defines the sorting order for the returned objects. ### Response #### Success Response (200) - **objects** (array) - A list of object records. - **id** (string) - The unique identifier for an object. - **name** (string) - The name of the object. - **createdAt** (string) - The timestamp when the object was created. #### Response Example ```json { "objects": [ { "id": "obj_123", "name": "Example Object 1", "createdAt": "2023-10-27T10:00:00Z" }, { "id": "obj_456", "name": "Example Object 2", "createdAt": "2023-10-27T10:05:00Z" } ] } ``` ``` -------------------------------- ### Get chat messages Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-chat-messages.api.mdx Retrieves a list of messages from a chat. Supports cursor-based pagination via before_order_id and after_order_id query parameters. ```APIDOC ## GET /v1/spaces/{space_id}/chats/{chat_id}/messages ### Description Retrieves a list of messages from a chat. Supports cursor-based pagination via before_order_id and after_order_id query parameters. ### Method GET ### Endpoint /v1/spaces/{space_id}/chats/{chat_id}/messages ### Parameters #### Path Parameters - **space_id** (string) - Required - The ID of the space. - **chat_id** (string) - Required - The ID of the chat. #### Query Parameters - **before_order_id** (string) - Optional - Cursor for fetching messages before a specific message. - **after_order_id** (string) - Optional - Cursor for fetching messages after a specific message. - **limit** (integer) - Optional - The maximum number of messages to return. ### Response #### Success Response (200) - **messages** (array) - A list of chat messages. - **id** (string) - The ID of the message. - **chat_id** (string) - The ID of the chat the message belongs to. - **order_id** (string) - The order ID of the message for pagination. - **content** (string) - The content of the message. - **created_at** (string) - The timestamp when the message was created. - **sender_id** (string) - The ID of the user who sent the message. - **next_before_order_id** (string) - The cursor for the next page of messages before the current page. - **next_after_order_id** (string) - The cursor for the next page of messages after the current page. ``` -------------------------------- ### Generate API Docs from OpenAPI Source: https://github.com/anyproto/anytype-api/blob/main/CLAUDE.md Generates API documentation specifically from OpenAPI specifications. ```bash npm run gen-api-docs ``` -------------------------------- ### Create Auth Challenge - Bash Source: https://github.com/anyproto/anytype-api/blob/main/docs/guides/get-started/01-authentication.md Initiates an authentication challenge to begin the programmatic API key generation flow. Requires an app name in the request body. The response provides a challenge ID. ```bash curl -X POST "http://localhost:31009/v1/auth/challenges" \ -H "Content-Type: application/json" \ -H "Anytype-Version: 2025-11-08" \ -d '{"app_name": "my_awesome_app"}' ``` -------------------------------- ### Get your Spaces Source: https://github.com/anyproto/anytype-api/blob/main/docs/guides/get-started/02-spaces.md Retrieve a list of all spaces. The API returns an array of space objects, each containing metadata such as the space ID, name, and icon. ```APIDOC ## GET /spaces ### Description Retrieves a list of all spaces available. ### Method GET ### Endpoint /v1/spaces ### Parameters None ### Request Example ```bash curl -X GET "http://localhost:31009/v1/spaces" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) An array of space objects, each containing metadata such as the space ID, name, icon, and other properties. #### Response Example ```json [ { "id": "space-id-1", "name": "Work", "icon": " briefcase", "description": "Work-related projects" }, { "id": "space-id-2", "name": "Personal", "icon": "person", "description": "Personal notes and tasks" } ] ``` ``` -------------------------------- ### Get Specific Space Details Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/list-spaces.api.mdx Retrieves detailed information about a specific space using its unique identifier. This is useful for fetching all properties of a single space. ```bash curl -X GET "https://api.example.com/v1/spaces/space_id_123" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Create object Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/create-object.api.mdx Creates a new object in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include key details such as the object name, icon, description, body content (which may support Markdown), source URL (required for bookmark objects), template identifier, and the type_key (which is the non-unique identifier of the type of object to create). Post-creation, additional operations (like setting featured properties or fetching bookmark metadata) may occur. The endpoint then returns the full object data, ready for further interactions. ```APIDOC ## POST /v1/objects ### Description Creates a new object in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include key details such as the object name, icon, description, body content (which may support Markdown), source URL (required for bookmark objects), template identifier, and the type_key (which is the non-unique identifier of the type of object to create). Post-creation, additional operations (like setting featured properties or fetching bookmark metadata) may occur. The endpoint then returns the full object data, ready for further interactions. ### Method POST ### Endpoint /v1/objects ### Parameters #### Request Body - **name** (string) - Required - The name of the object. - **icon** (string) - Optional - The icon for the object. - **description** (string) - Optional - The description of the object. - **content** (object) - Optional - The body content of the object, may support Markdown. - **source_url** (string) - Required for bookmark objects - The source URL for bookmark objects. - **template_id** (string) - Optional - The identifier of the template to use. - **type_key** (string) - Required - The non-unique identifier of the type of object to create. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created object. - **name** (string) - The name of the created object. - **icon** (string) - The icon of the created object. - **description** (string) - The description of the created object. - **content** (object) - The body content of the created object. - **created_at** (string) - The timestamp when the object was created. - **updated_at** (string) - The timestamp when the object was last updated. - **type** (object) - Information about the type of the object. - **space** (object) - Information about the space the object belongs to. ``` -------------------------------- ### Create Object Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/create-object.api.mdx Creates a new object in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include key details such as the object name, icon, description, body content (which may support Markdown), source URL (required for bookmark objects), template identifier, and the type_key (which is the non-unique identifier of the type of object to create). Post-creation, additional operations (like setting featured properties or fetching bookmark metadata) may occur. The endpoint then returns the full object data, ready for further interactions. ```APIDOC ## POST /v1/spaces/{space_id}/objects ### Description Creates a new object in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include key details such as the object name, icon, description, body content (which may support Markdown), source URL (required for bookmark objects), template identifier, and the type_key (which is the non-unique identifier of the type of object to create). Post-creation, additional operations (like setting featured properties or fetching bookmark metadata) may occur. The endpoint then returns the full object data, ready for further interactions. ### Method POST ### Endpoint /v1/spaces/{space_id}/objects ### Parameters #### Path Parameters - **space_id** (string) - Required - The unique identifier of the space where the object will be created. #### Request Body - **name** (string) - Required - The name of the object. - **icon** (string) - Optional - The icon for the object. - **description** (string) - Optional - A description of the object. Supports Markdown. - **body** (object) - Optional - The content of the object. May support Markdown. - **source_url** (string) - Required for bookmark objects - The URL of the source for a bookmark object. - **template_id** (string) - Optional - The identifier of the template to use for the object. - **type_key** (string) - Required - The non-unique identifier of the type of object to create. ### Request Example ```json { "name": "My New Object", "icon": "🌟", "description": "This is a **new** object.", "body": { "content": "The main content of the object." }, "source_url": "https://example.com", "template_id": "template-123", "type_key": "bookmark" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created object. - **name** (string) - The name of the object. - **icon** (string) - The icon of the object. - **description** (string) - The description of the object. - **body** (object) - The content of the object. - **created_at** (string) - The timestamp when the object was created. - **updated_at** (string) - The timestamp when the object was last updated. - **space_id** (string) - The identifier of the space the object belongs to. - **type_key** (string) - The type of the object. #### Response Example ```json { "id": "obj-abc123xyz", "name": "My New Object", "icon": "🌟", "description": "This is a **new** object.", "body": { "content": "The main content of the object." }, "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z", "space_id": "space-xyz789", "type_key": "bookmark" } ``` ``` -------------------------------- ### Get Tag Source: https://github.com/anyproto/anytype-api/blob/main/docs/reference/2025-11-08/get-tag.api.mdx Retrieves a tag for a given property ID within a specified space. The response includes the tag's ID, name, and color. ```APIDOC ## GET /v1/spaces/{space_id}/properties/{property_id}/tags/{tag_id} ### Description This endpoint retrieves a tag for a given property id. The tag is identified by its unique identifier within the specified space. The response includes the tag's details such as its ID, name, and color. This is useful for clients to display or when editing a specific tag option. ### Method GET ### Endpoint /v1/spaces/{space_id}/properties/{property_id}/tags/{tag_id} ### Parameters #### Path Parameters - **space_id** (string) - Required - The unique identifier of the space. - **property_id** (string) - Required - The unique identifier of the property. - **tag_id** (string) - Required - The unique identifier of the tag. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the tag. - **name** (string) - The name of the tag. - **color** (string) - The color associated with the tag. ```