v1

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

Create type

Creates a new type in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include type details such as the name, icon, and layout. The endpoint then returns the full type data, ready to be used for creating objects.

post/v1/spaces/{space_id}/types

Path parameters

space_idstring required

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

Headers

Anytype-Versionstring required

The version of the API to use

Request body

keystring

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

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

The layout of the type

namestring required

The name of the type

plural_namestring required

The plural name of 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 created 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"
      }
    ]
  }
}