v1

latestOpenAPI 3.1.0Any Source Available License 1.02026-07-1736102200.0 KB
Types

Update type

This endpoint updates an existing type in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the name and properties to be updated. The endpoint then returns the full type data, ready for further interactions.

patch/v1/spaces/{space_id}/types/{type_id}

Path parameters

space_idstring required

The ID of the space in which the type exists; must be retrieved from ListSpaces endpoint

type_idstring required

The ID of the type to update; must be retrieved from ListTypes endpoint or obtained from response context

Headers

Anytype-Versionstring required

The version of the API to use

Request body

keystring

The key to set for the type; should always be snake_case, otherwise it will be converted to snake_case

layout'basic' | 'profile' | 'action' | 'note'

The layout of the type

namestring

The name to set for the type

plural_namestring

The plural name to set for the type

Example request

{
  "icon": {
    "emoji": "📄"
  },
  "key": "some_user_defined_type_key",
  "name": "Page",
  "plural_name": "Pages",
  "properties": [
    {
      "key": "last_modified_date",
      "name": "Last modified date"
    }
  ]
}

Response

The updated type

Example response

{
  "type": {
    "icon": {
      "emoji": "📄"
    },
    "id": "bafyreigyb6l5szohs32ts26ku2j42yd65e6hqy2u3gtzgdwqv6hzftsetu",
    "key": "page",
    "name": "Page",
    "object": "type",
    "plural_name": "Pages",
    "properties": [
      {
        "id": "bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a",
        "key": "last_modified_date",
        "name": "Last modified date",
        "object": "property"
      }
    ]
  }
}