From fa92a6cbbf08b7cb60a10db0b8b16e6b8b7f071c Mon Sep 17 00:00:00 2001 From: Jannis Metrikat <120120832+jmetrikat@users.noreply.github.com> Date: Sun, 27 Apr 2025 13:24:07 +0200 Subject: [PATCH] GO-4969: Deprecate template model, treat as object --- core/api/docs/docs.go | 4 +- core/api/docs/swagger.json | 4 +- core/api/docs/swagger.yaml | 60 +++------------------ core/api/internal/object/handler.go | 6 +-- core/api/internal/object/model.go | 20 +++---- core/api/internal/object/object.go | 50 ++++++++++-------- core/api/internal/object/service.go | 6 +-- core/api/internal/object/type.go | 81 ++++++++++++----------------- 8 files changed, 83 insertions(+), 148 deletions(-) diff --git a/core/api/docs/docs.go b/core/api/docs/docs.go index 7240e330d..cc7d5e0ab 100644 --- a/core/api/docs/docs.go +++ b/core/api/docs/docs.go @@ -6,10 +6,10 @@ import "github.com/swaggo/swag/v2" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, - "components": {"schemas":{"auth.DisplayCodeResponse":{"properties":{"challenge_id":{"description":"The challenge id associated with the displayed code and needed to solve the challenge for token","example":"67647f5ecda913e9a2e11b26","type":"string"}},"type":"object"},"auth.TokenResponse":{"properties":{"app_key":{"description":"The app key used to authenticate requests","example":"zhSG/zQRmgADyilWPtgdnfo1qD60oK02/SVgi1GaFt6=","type":"string"}},"type":"object"},"list.Filter":{"properties":{"condition":{"description":"The filter condition","enum":["equal","not_equal","greater","less","greater_or_equal","less_or_equal","like","not_like","in","not_in","empty","not_empty","all_in","not_all_in","exact_in","not_exact_in","exists"],"example":"contains","type":"string"},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the filter","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for filtering","example":"name","type":"string"},"value":{"description":"The value used for filtering","example":"Some value...","type":"string"}},"type":"object"},"list.Sort":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the sort","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for sorting","example":"name","type":"string"},"sort_type":{"description":"The sort direction","enum":["asc","desc","custom"],"example":"asc","type":"string"}},"type":"object"},"list.View":{"properties":{"filters":{"description":"The list of filters","items":{"$ref":"#/components/schemas/list.Filter"},"type":"array","uniqueItems":false},"id":{"description":"The id of the view","example":"67bf3f21cda9134102e2422c","type":"string"},"layout":{"description":"The layout of the view","enum":["grid","table"],"example":"grid","type":"string"},"name":{"description":"The name of the view","example":"All","type":"string"},"sorts":{"description":"The list of sorts","items":{"$ref":"#/components/schemas/list.Sort"},"type":"array","uniqueItems":false}},"type":"object"},"object.Block":{"properties":{"align":{"description":"The alignment of the block","enum":["AlignLeft","AlignCenter","AlignRight","AlignJustify"],"example":"AlignLeft","type":"string"},"background_color":{"description":"The background color of the block","example":"red","type":"string"},"children_ids":{"description":"The ids of the block's children","example":["['6797ce8ecda913cde14b02dc']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"file":{"$ref":"#/components/schemas/object.File"},"id":{"description":"The id of the block","example":"64394517de52ad5acb89c66c","type":"string"},"object":{"description":"The data model of the object","example":"block","type":"string"},"property":{"$ref":"#/components/schemas/object.Property"},"text":{"$ref":"#/components/schemas/object.Text"},"vertical_align":{"description":"The vertical alignment of the block","enum":["VerticalAlignTop","VerticalAlignMiddle","VerticalAlignBottom"],"example":"VerticalAlignTop","type":"string"}},"type":"object"},"object.Color":{"description":"The color of the icon","enum":["grey","yellow","orange","red","pink","purple","blue","ice","teal","lime"],"example":"yellow","type":"string","x-enum-varnames":["ColorGrey","ColorYellow","ColorOrange","ColorRed","ColorPink","ColorPurple","ColorBlue","ColorIce","ColorTeal","ColorLime"]},"object.CreateObjectRequest":{"properties":{"body":{"description":"The body of the object","example":"This is the body of the object. Markdown syntax is supported here.","type":"string"},"description":{"description":"The description of the object","example":"This is a description of the object.","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to set on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"},"source":{"description":"The source url, only applicable for bookmarks","example":"https://bookmark-source.com","type":"string"},"template_id":{"description":"The id of the template to use","example":"bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge","type":"string"},"type_key":{"description":"The key of the type of object to create","example":"ot-page","type":"string"}},"required":["name","type_key"],"type":"object"},"object.CreatePropertyRequest":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"name":{"description":"The name of the property","example":"Last modified date","type":"string"}},"required":["format","name"],"type":"object"},"object.CreateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"name":{"description":"The name of the tag","example":"In progress","type":"string"}},"required":["color","name"],"type":"object"},"object.File":{"description":"The file of the block, if applicable","properties":{"added_at":{"description":"The added at of the file","type":"integer"},"hash":{"description":"The hash of the file","type":"string"},"mime":{"description":"The mime of the file","type":"string"},"name":{"description":"The name of the file","type":"string"},"object":{"description":"The data model of the object","example":"file","type":"string"},"size":{"description":"The size of the file","type":"integer"},"state":{"description":"The state of the file","type":"string"},"style":{"description":"The style of the file","type":"string"},"target_object_id":{"description":"The target object id of the file","type":"string"},"type":{"description":"The type of the file","type":"string"}},"type":"object"},"object.Icon":{"description":"The icon of the object","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"emoji":{"description":"The emoji of the icon","example":"📄","type":"string"},"file":{"description":"The file of the icon","example":"http://127.0.0.1:31006/image/bafybeieptz5hvcy6txplcvphjbbh5yjc2zqhmihs3owkh5oab4ezauzqay","type":"string"},"format":{"$ref":"#/components/schemas/object.IconFormat"},"name":{"description":"The name of the icon","example":"document","type":"string"}},"type":"object"},"object.IconFormat":{"description":"The type of the icon","enum":["emoji","file","icon"],"example":"emoji","type":"string","x-enum-varnames":["IconFormatEmoji","IconFormatFile","IconFormatIcon"]},"object.Object":{"properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.ObjectExportResponse":{"properties":{"markdown":{"example":"# This is the title\n...","type":"string"}},"type":"object"},"object.ObjectResponse":{"properties":{"object":{"$ref":"#/components/schemas/object.ObjectWithBlocks"}},"type":"object"},"object.ObjectWithBlocks":{"description":"The object","properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"blocks":{"description":"The blocks of the object. Omitted in endpoints for searching or listing objects, only included when getting single object.","items":{"$ref":"#/components/schemas/object.Block"},"type":"array","uniqueItems":false},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.Property":{"description":"The property block, if applicable","properties":{"checkbox":{"description":"The checkbox value, if applicable","enum":[true,false],"example":true,"type":"boolean"},"date":{"description":"The date value, if applicable","example":"2025-02-14T12:34:56Z","type":"string"},"email":{"description":"The email value, if applicable","example":"example@example.com","type":"string"},"files":{"description":"The file references, if applicable","example":["['fileId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the property","example":"bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a","type":"string"},"key":{"description":"The key of the property","example":"last_modified_date","type":"string"},"multi_select":{"description":"The multi-select values, if applicable","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"name":{"description":"The name of the property","example":"Last modified date","type":"string"},"number":{"description":"The number value, if applicable","example":42,"type":"number"},"object":{"description":"The data model of the object","example":"property","type":"string"},"objects":{"description":"The object references, if applicable","example":["['objectId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"phone":{"description":"The phone number value, if applicable","example":"+1234567890","type":"string"},"select":{"$ref":"#/components/schemas/object.Tag"},"text":{"description":"The text value, if applicable","example":"Some text...","type":"string"},"url":{"description":"The url value, if applicable","example":"https://example.com","type":"string"}},"type":"object"},"object.PropertyFormat":{"description":"The format of the property used for filtering","enum":["text","number","select","multi_select","date","files","checkbox","url","email","phone","objects"],"example":"date","type":"string","x-enum-varnames":["PropertyFormatText","PropertyFormatNumber","PropertyFormatSelect","PropertyFormatMultiSelect","PropertyFormatDate","PropertyFormatFiles","PropertyFormatCheckbox","PropertyFormatUrl","PropertyFormatEmail","PropertyFormatPhone","PropertyFormatObjects"]},"object.PropertyResponse":{"properties":{"property":{"$ref":"#/components/schemas/object.Property"}},"type":"object"},"object.Tag":{"description":"The select value, if applicable","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"id":{"description":"The id of the tag","example":"bafyreiaixlnaefu3ci22zdenjhsdlyaeeoyjrsid5qhfeejzlccijbj7sq","type":"string"},"key":{"description":"The key of the tag","example":"67b0d3e3cda913b84c1299b1","type":"string"},"name":{"description":"The name of the tag","example":"in-progress","type":"string"},"object":{"description":"The data model of the object","example":"tag","type":"string"}},"type":"object"},"object.TagResponse":{"properties":{"tag":{"$ref":"#/components/schemas/object.Tag"}},"type":"object"},"object.Template":{"description":"The template","properties":{"archived":{"description":"Whether the template is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the template","example":"bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge","type":"string"},"name":{"description":"The name of the template","example":"My template","type":"string"},"object":{"description":"The data model of the object","example":"template","type":"string"}},"type":"object"},"object.TemplateResponse":{"properties":{"template":{"$ref":"#/components/schemas/object.Template"}},"type":"object"},"object.Text":{"description":"The text of the block, if applicable","properties":{"checked":{"description":"Whether the text is checked","example":true,"type":"boolean"},"color":{"description":"The color of the text","example":"red","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"object":{"description":"The data model of the object","example":"text","type":"string"},"style":{"description":"The style of the text","enum":["Paragraph","Header1","Header2","Header3","Header4","Quote","Code","Title","Checkbox","Marked","Numbered","Toggle","Description","Callout"],"example":"Paragraph","type":"string"},"text":{"description":"The text","example":"Some text...","type":"string"}},"type":"object"},"object.Type":{"description":"The type of the object","properties":{"archived":{"description":"Whether the type is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the type (which is unique across spaces)","example":"bafyreigyb6l5szohs32ts26ku2j42yd65e6hqy2u3gtzgdwqv6hzftsetu","type":"string"},"key":{"description":"The key of the type (can be the same across spaces for known types)","example":"ot-page","type":"string"},"layout":{"description":"The recommended layout of the type","example":"todo","type":"string"},"name":{"description":"The name of the type","example":"Page","type":"string"},"object":{"description":"The data model of the object","example":"type","type":"string"},"properties":{"description":"The properties linked to the type","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false}},"type":"object"},"object.TypeResponse":{"properties":{"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.UpdateObjectRequest":{"properties":{"description":{"description":"The description of the object","example":"This is a description of the object.","type":"string"},"id":{"description":"The id of the object to update","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to update on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"}},"required":["id"],"type":"object"},"object.UpdatePropertyRequest":{"properties":{"id":{"description":"The id of the property to update","example":"bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a","type":"string"},"name":{"description":"the name to set for the property","example":"Last modified date","type":"string"}},"required":["id","name"],"type":"object"},"object.UpdateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"id":{"description":"The id of the tag to update","example":"bafyreiaixlnaefu3ci22zdenjhsdlyaeeoyjrsid5qhfeejzlccijbj7sq","type":"string"},"name":{"description":"The name to set for the tag","example":"In progress","type":"string"}},"required":["id"],"type":"object"},"pagination.PaginatedResponse-list_View":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/list.View"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Object":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Object"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Property":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Tag":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Template":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Template"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Type":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Type"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Member":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Member"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Space":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Space"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginationMeta":{"description":"The pagination metadata for the response","properties":{"has_more":{"description":"Indicates if there are more items available beyond the current result set","example":true,"type":"boolean"},"limit":{"description":"The maximum number of items returned in the result set","example":100,"type":"integer"},"offset":{"description":"The number of items skipped before starting to collect the result set","example":0,"type":"integer"},"total":{"description":"The total number of items available for the endpoint","example":1024,"type":"integer"}},"type":"object"},"search.SearchRequest":{"properties":{"query":{"description":"The search term to look for in object names and snippets","example":"test","type":"string"},"sort":{"$ref":"#/components/schemas/search.SortOptions"},"types":{"description":"The types of objects to search for, specified by key or ID","example":["ot-page","ot-678043f0cda9133be777049f","bafyreightzrdts2ymxyaeyzspwdfo2juspyam76ewq6qq7ixnw3523gs7q"],"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"search.SortDirection":{"default":"desc","description":"The direction to sort the search results","enum":["asc","desc"],"type":"string","x-enum-varnames":["Asc","Desc"]},"search.SortOptions":{"description":"The sorting criteria and direction for the search results","properties":{"direction":{"$ref":"#/components/schemas/search.SortDirection"},"property":{"$ref":"#/components/schemas/search.SortProperty"}},"type":"object"},"search.SortProperty":{"default":"last_modified_date","description":"The property to sort the search results by","enum":["created_date","last_modified_date","last_opened_date","name"],"type":"string","x-enum-varnames":["CreatedDate","LastModifiedDate","LastOpenedDate","Name"]},"space.CreateSpaceRequest":{"properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"name":{"description":"The name of the space","example":"New Space","type":"string"}},"type":"object"},"space.Member":{"description":"The member","properties":{"global_name":{"description":"The global name of the member in the network","example":"john.any","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The profile object id of the member","example":"_participant_bafyreigyfkt6rbv24sbv5aq2hko1bhmv5xxlf22b4bypdu6j7hnphm3psq_23me69r569oi1_AAjEaEwPF4nkEh9AWkqEnzcQ8HziBB4ETjiTpvRCQvWnSMDZ","type":"string"},"identity":{"description":"The identity of the member in the network","example":"AAjEaEwPF4nkEh7AWkqEnzcQ8HziGB4ETjiTpvRCQvWnSMDZ","type":"string"},"name":{"description":"The name of the member","example":"John Doe","type":"string"},"object":{"description":"The data model of the object","example":"member","type":"string"},"role":{"description":"The role of the member","enum":["viewer","editor","owner","no_permission"],"example":"owner","type":"string"},"status":{"description":"The status of the member","enum":["joining","active","removed","declined","removing","canceled"],"example":"active","type":"string"}},"type":"object"},"space.MemberResponse":{"properties":{"member":{"$ref":"#/components/schemas/space.Member"}},"type":"object"},"space.Space":{"description":"The space","properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"gateway_url":{"description":"The gateway url to serve files and media","example":"http://127.0.0.1:31006","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the space","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"name":{"description":"The name of the space","example":"My Space","type":"string"},"network_id":{"description":"The network id of the space","example":"N83gJpVd9MuNRZAuJLZ7LiMntTThhPc6DtzWWVjb1M3PouVU","type":"string"},"object":{"description":"The data model of the object","example":"space","type":"string"}},"type":"object"},"space.SpaceResponse":{"properties":{"space":{"$ref":"#/components/schemas/space.Space"}},"type":"object"},"util.ForbiddenError":{"properties":{"code":{"example":"forbidden","type":"string"},"message":{"example":"Forbidden","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":403,"type":"integer"}},"type":"object"},"util.GoneError":{"properties":{"code":{"example":"resource_gone","type":"string"},"message":{"example":"Resource is gone","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":410,"type":"integer"}},"type":"object"},"util.NotFoundError":{"properties":{"code":{"example":"object_not_found","type":"string"},"message":{"example":"Resource not found","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":404,"type":"integer"}},"type":"object"},"util.RateLimitError":{"properties":{"code":{"example":"rate_limit_exceeded","type":"string"},"message":{"example":"Rate limit exceeded","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":429,"type":"integer"}},"type":"object"},"util.ServerError":{"properties":{"code":{"example":"internal_server_error","type":"string"},"message":{"example":"Internal server error","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":500,"type":"integer"}},"type":"object"},"util.UnauthorizedError":{"properties":{"code":{"example":"unauthorized","type":"string"},"message":{"example":"Unauthorized","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":401,"type":"integer"}},"type":"object"},"util.ValidationError":{"properties":{"code":{"example":"bad_request","type":"string"},"message":{"example":"Bad request","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":400,"type":"integer"}},"type":"object"}},"securitySchemes":{"bearerauth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}}, + "components": {"schemas":{"auth.DisplayCodeResponse":{"properties":{"challenge_id":{"description":"The challenge id associated with the displayed code and needed to solve the challenge for token","example":"67647f5ecda913e9a2e11b26","type":"string"}},"type":"object"},"auth.TokenResponse":{"properties":{"app_key":{"description":"The app key used to authenticate requests","example":"zhSG/zQRmgADyilWPtgdnfo1qD60oK02/SVgi1GaFt6=","type":"string"}},"type":"object"},"list.Filter":{"properties":{"condition":{"description":"The filter condition","enum":["equal","not_equal","greater","less","greater_or_equal","less_or_equal","like","not_like","in","not_in","empty","not_empty","all_in","not_all_in","exact_in","not_exact_in","exists"],"example":"contains","type":"string"},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the filter","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for filtering","example":"name","type":"string"},"value":{"description":"The value used for filtering","example":"Some value...","type":"string"}},"type":"object"},"list.Sort":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the sort","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for sorting","example":"name","type":"string"},"sort_type":{"description":"The sort direction","enum":["asc","desc","custom"],"example":"asc","type":"string"}},"type":"object"},"list.View":{"properties":{"filters":{"description":"The list of filters","items":{"$ref":"#/components/schemas/list.Filter"},"type":"array","uniqueItems":false},"id":{"description":"The id of the view","example":"67bf3f21cda9134102e2422c","type":"string"},"layout":{"description":"The layout of the view","enum":["grid","table"],"example":"grid","type":"string"},"name":{"description":"The name of the view","example":"All","type":"string"},"sorts":{"description":"The list of sorts","items":{"$ref":"#/components/schemas/list.Sort"},"type":"array","uniqueItems":false}},"type":"object"},"object.Block":{"properties":{"align":{"description":"The alignment of the block","enum":["AlignLeft","AlignCenter","AlignRight","AlignJustify"],"example":"AlignLeft","type":"string"},"background_color":{"description":"The background color of the block","example":"red","type":"string"},"children_ids":{"description":"The ids of the block's children","example":["['6797ce8ecda913cde14b02dc']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"file":{"$ref":"#/components/schemas/object.File"},"id":{"description":"The id of the block","example":"64394517de52ad5acb89c66c","type":"string"},"object":{"description":"The data model of the object","example":"block","type":"string"},"property":{"$ref":"#/components/schemas/object.Property"},"text":{"$ref":"#/components/schemas/object.Text"},"vertical_align":{"description":"The vertical alignment of the block","enum":["VerticalAlignTop","VerticalAlignMiddle","VerticalAlignBottom"],"example":"VerticalAlignTop","type":"string"}},"type":"object"},"object.Color":{"description":"The color of the icon","enum":["grey","yellow","orange","red","pink","purple","blue","ice","teal","lime"],"example":"yellow","type":"string","x-enum-varnames":["ColorGrey","ColorYellow","ColorOrange","ColorRed","ColorPink","ColorPurple","ColorBlue","ColorIce","ColorTeal","ColorLime"]},"object.CreateObjectRequest":{"properties":{"body":{"description":"The body of the object","example":"This is the body of the object. Markdown syntax is supported here.","type":"string"},"description":{"description":"The description of the object","example":"This is a description of the object.","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to set on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"},"source":{"description":"The source url, only applicable for bookmarks","example":"https://bookmark-source.com","type":"string"},"template_id":{"description":"The id of the template to use","example":"bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge","type":"string"},"type_key":{"description":"The key of the type of object to create","example":"ot-page","type":"string"}},"required":["name","type_key"],"type":"object"},"object.CreatePropertyRequest":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"name":{"description":"The name of the property","example":"Last modified date","type":"string"}},"required":["format","name"],"type":"object"},"object.CreateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"name":{"description":"The name of the tag","example":"In progress","type":"string"}},"required":["color","name"],"type":"object"},"object.File":{"description":"The file of the block, if applicable","properties":{"added_at":{"description":"The added at of the file","type":"integer"},"hash":{"description":"The hash of the file","type":"string"},"mime":{"description":"The mime of the file","type":"string"},"name":{"description":"The name of the file","type":"string"},"object":{"description":"The data model of the object","example":"file","type":"string"},"size":{"description":"The size of the file","type":"integer"},"state":{"description":"The state of the file","type":"string"},"style":{"description":"The style of the file","type":"string"},"target_object_id":{"description":"The target object id of the file","type":"string"},"type":{"description":"The type of the file","type":"string"}},"type":"object"},"object.Icon":{"description":"The icon of the object","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"emoji":{"description":"The emoji of the icon","example":"📄","type":"string"},"file":{"description":"The file of the icon","example":"http://127.0.0.1:31006/image/bafybeieptz5hvcy6txplcvphjbbh5yjc2zqhmihs3owkh5oab4ezauzqay","type":"string"},"format":{"$ref":"#/components/schemas/object.IconFormat"},"name":{"description":"The name of the icon","example":"document","type":"string"}},"type":"object"},"object.IconFormat":{"description":"The type of the icon","enum":["emoji","file","icon"],"example":"emoji","type":"string","x-enum-varnames":["IconFormatEmoji","IconFormatFile","IconFormatIcon"]},"object.Object":{"properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.ObjectExportResponse":{"properties":{"markdown":{"example":"# This is the title\n...","type":"string"}},"type":"object"},"object.ObjectResponse":{"properties":{"object":{"$ref":"#/components/schemas/object.ObjectWithBlocks"}},"type":"object"},"object.ObjectWithBlocks":{"description":"The object","properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"blocks":{"description":"The blocks of the object. Omitted in endpoints for searching or listing objects, only included when getting single object.","items":{"$ref":"#/components/schemas/object.Block"},"type":"array","uniqueItems":false},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.Property":{"description":"The property block, if applicable","properties":{"checkbox":{"description":"The checkbox value, if applicable","enum":[true,false],"example":true,"type":"boolean"},"date":{"description":"The date value, if applicable","example":"2025-02-14T12:34:56Z","type":"string"},"email":{"description":"The email value, if applicable","example":"example@example.com","type":"string"},"files":{"description":"The file references, if applicable","example":["['fileId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the property","example":"bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a","type":"string"},"key":{"description":"The key of the property","example":"last_modified_date","type":"string"},"multi_select":{"description":"The multi-select values, if applicable","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"name":{"description":"The name of the property","example":"Last modified date","type":"string"},"number":{"description":"The number value, if applicable","example":42,"type":"number"},"object":{"description":"The data model of the object","example":"property","type":"string"},"objects":{"description":"The object references, if applicable","example":["['objectId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"phone":{"description":"The phone number value, if applicable","example":"+1234567890","type":"string"},"select":{"$ref":"#/components/schemas/object.Tag"},"text":{"description":"The text value, if applicable","example":"Some text...","type":"string"},"url":{"description":"The url value, if applicable","example":"https://example.com","type":"string"}},"type":"object"},"object.PropertyFormat":{"description":"The format of the property used for filtering","enum":["text","number","select","multi_select","date","files","checkbox","url","email","phone","objects"],"example":"date","type":"string","x-enum-varnames":["PropertyFormatText","PropertyFormatNumber","PropertyFormatSelect","PropertyFormatMultiSelect","PropertyFormatDate","PropertyFormatFiles","PropertyFormatCheckbox","PropertyFormatUrl","PropertyFormatEmail","PropertyFormatPhone","PropertyFormatObjects"]},"object.PropertyResponse":{"properties":{"property":{"$ref":"#/components/schemas/object.Property"}},"type":"object"},"object.Tag":{"description":"The select value, if applicable","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"id":{"description":"The id of the tag","example":"bafyreiaixlnaefu3ci22zdenjhsdlyaeeoyjrsid5qhfeejzlccijbj7sq","type":"string"},"key":{"description":"The key of the tag","example":"67b0d3e3cda913b84c1299b1","type":"string"},"name":{"description":"The name of the tag","example":"in-progress","type":"string"},"object":{"description":"The data model of the object","example":"tag","type":"string"}},"type":"object"},"object.TagResponse":{"properties":{"tag":{"$ref":"#/components/schemas/object.Tag"}},"type":"object"},"object.TemplateResponse":{"properties":{"template":{"$ref":"#/components/schemas/object.ObjectWithBlocks"}},"type":"object"},"object.Text":{"description":"The text of the block, if applicable","properties":{"checked":{"description":"Whether the text is checked","example":true,"type":"boolean"},"color":{"description":"The color of the text","example":"red","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"object":{"description":"The data model of the object","example":"text","type":"string"},"style":{"description":"The style of the text","enum":["Paragraph","Header1","Header2","Header3","Header4","Quote","Code","Title","Checkbox","Marked","Numbered","Toggle","Description","Callout"],"example":"Paragraph","type":"string"},"text":{"description":"The text","example":"Some text...","type":"string"}},"type":"object"},"object.Type":{"description":"The type of the object","properties":{"archived":{"description":"Whether the type is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the type (which is unique across spaces)","example":"bafyreigyb6l5szohs32ts26ku2j42yd65e6hqy2u3gtzgdwqv6hzftsetu","type":"string"},"key":{"description":"The key of the type (can be the same across spaces for known types)","example":"ot-page","type":"string"},"layout":{"description":"The recommended layout of the type","example":"todo","type":"string"},"name":{"description":"The name of the type","example":"Page","type":"string"},"object":{"description":"The data model of the object","example":"type","type":"string"},"properties":{"description":"The properties linked to the type","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false}},"type":"object"},"object.TypeResponse":{"properties":{"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.UpdateObjectRequest":{"properties":{"description":{"description":"The description to set for the object","example":"This is a description of the object.","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to update on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"}},"type":"object"},"object.UpdatePropertyRequest":{"properties":{"name":{"description":"The name to set for the property","example":"Last modified date","type":"string"}},"required":["name"],"type":"object"},"object.UpdateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"name":{"description":"The name to set for the tag","example":"In progress","type":"string"}},"type":"object"},"pagination.PaginatedResponse-list_View":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/list.View"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Object":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Object"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Property":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Tag":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Type":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Type"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Member":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Member"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Space":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Space"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginationMeta":{"description":"The pagination metadata for the response","properties":{"has_more":{"description":"Indicates if there are more items available beyond the current result set","example":true,"type":"boolean"},"limit":{"description":"The maximum number of items returned in the result set","example":100,"type":"integer"},"offset":{"description":"The number of items skipped before starting to collect the result set","example":0,"type":"integer"},"total":{"description":"The total number of items available for the endpoint","example":1024,"type":"integer"}},"type":"object"},"search.SearchRequest":{"properties":{"query":{"description":"The search term to look for in object names and snippets","example":"test","type":"string"},"sort":{"$ref":"#/components/schemas/search.SortOptions"},"types":{"description":"The types of objects to search for, specified by key or ID","example":["ot-page","ot-678043f0cda9133be777049f","bafyreightzrdts2ymxyaeyzspwdfo2juspyam76ewq6qq7ixnw3523gs7q"],"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"search.SortDirection":{"default":"desc","description":"The direction to sort the search results","enum":["asc","desc"],"type":"string","x-enum-varnames":["Asc","Desc"]},"search.SortOptions":{"description":"The sorting criteria and direction for the search results","properties":{"direction":{"$ref":"#/components/schemas/search.SortDirection"},"property":{"$ref":"#/components/schemas/search.SortProperty"}},"type":"object"},"search.SortProperty":{"default":"last_modified_date","description":"The property to sort the search results by","enum":["created_date","last_modified_date","last_opened_date","name"],"type":"string","x-enum-varnames":["CreatedDate","LastModifiedDate","LastOpenedDate","Name"]},"space.CreateSpaceRequest":{"properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"name":{"description":"The name of the space","example":"New Space","type":"string"}},"type":"object"},"space.Member":{"description":"The member","properties":{"global_name":{"description":"The global name of the member in the network","example":"john.any","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The profile object id of the member","example":"_participant_bafyreigyfkt6rbv24sbv5aq2hko1bhmv5xxlf22b4bypdu6j7hnphm3psq_23me69r569oi1_AAjEaEwPF4nkEh9AWkqEnzcQ8HziBB4ETjiTpvRCQvWnSMDZ","type":"string"},"identity":{"description":"The identity of the member in the network","example":"AAjEaEwPF4nkEh7AWkqEnzcQ8HziGB4ETjiTpvRCQvWnSMDZ","type":"string"},"name":{"description":"The name of the member","example":"John Doe","type":"string"},"object":{"description":"The data model of the object","example":"member","type":"string"},"role":{"description":"The role of the member","enum":["viewer","editor","owner","no_permission"],"example":"owner","type":"string"},"status":{"description":"The status of the member","enum":["joining","active","removed","declined","removing","canceled"],"example":"active","type":"string"}},"type":"object"},"space.MemberResponse":{"properties":{"member":{"$ref":"#/components/schemas/space.Member"}},"type":"object"},"space.Space":{"description":"The space","properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"gateway_url":{"description":"The gateway url to serve files and media","example":"http://127.0.0.1:31006","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the space","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"name":{"description":"The name of the space","example":"My Space","type":"string"},"network_id":{"description":"The network id of the space","example":"N83gJpVd9MuNRZAuJLZ7LiMntTThhPc6DtzWWVjb1M3PouVU","type":"string"},"object":{"description":"The data model of the object","example":"space","type":"string"}},"type":"object"},"space.SpaceResponse":{"properties":{"space":{"$ref":"#/components/schemas/space.Space"}},"type":"object"},"util.ForbiddenError":{"properties":{"code":{"example":"forbidden","type":"string"},"message":{"example":"Forbidden","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":403,"type":"integer"}},"type":"object"},"util.GoneError":{"properties":{"code":{"example":"resource_gone","type":"string"},"message":{"example":"Resource is gone","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":410,"type":"integer"}},"type":"object"},"util.NotFoundError":{"properties":{"code":{"example":"object_not_found","type":"string"},"message":{"example":"Resource not found","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":404,"type":"integer"}},"type":"object"},"util.RateLimitError":{"properties":{"code":{"example":"rate_limit_exceeded","type":"string"},"message":{"example":"Rate limit exceeded","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":429,"type":"integer"}},"type":"object"},"util.ServerError":{"properties":{"code":{"example":"internal_server_error","type":"string"},"message":{"example":"Internal server error","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":500,"type":"integer"}},"type":"object"},"util.UnauthorizedError":{"properties":{"code":{"example":"unauthorized","type":"string"},"message":{"example":"Unauthorized","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":401,"type":"integer"}},"type":"object"},"util.ValidationError":{"properties":{"code":{"example":"bad_request","type":"string"},"message":{"example":"Bad request","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":400,"type":"integer"}},"type":"object"}},"securitySchemes":{"bearerauth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}}, "info": {"contact":{"email":"support@anytype.io","name":"Anytype Support","url":"https://anytype.io/contact"},"description":"{{escape .Description}}","license":{"name":"Any Source Available License 1.0","url":"https://github.com/anyproto/anytype-api/blob/main/LICENSE.md"},"termsOfService":"https://anytype.io/terms_of_use","title":"{{.Title}}","version":"{{.Version}}"}, "externalDocs": {"description":"OpenAPI","url":"https://swagger.io/resources/open-api/"}, - "paths": {"/auth/display_code":{"post":{"description":"This endpoint initiates a secure authentication flow by generating a new challenge. Clients must supply the name of the application (via a query parameter) that is requesting authentication. On success, the service returns a unique challenge ID. This challenge ID must then be used with the token endpoint (see below) to solve the challenge and retrieve an authentication token. In essence, this endpoint “boots up” the login process and is the first step in a multi-phase authentication sequence.","operationId":"createAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"App name requesting the challenge","in":"query","name":"app_name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.DisplayCodeResponse"}}},"description":"Challenge ID"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Start new challenge","tags":["Auth"]}},"/auth/token":{"post":{"description":"After receiving a challenge ID from the display_code endpoint, the client calls this endpoint to provide the corresponding 4-digit code (also via a query parameter) along with the challenge ID. The endpoint verifies that the challenge solution is correct and, if it is, returns an ephemeral session token together with a permanent app key. These tokens are then used in subsequent API requests to authorize access. This endpoint is central to ensuring that only properly authenticated sessions can access further resources.","operationId":"solveAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Challenge ID","in":"query","name":"challenge_id","required":true,"schema":{"type":"string"}},{"description":"4-digit code retrieved from Anytype Desktop app","in":"query","name":"code","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.TokenResponse"}}},"description":"Authentication token"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Solve challenge","tags":["Auth"]}},"/search":{"post":{"description":"This endpoint executes a global search over every space the user has access to. It accepts pagination parameters (offset and limit) and a JSON body containing search criteria. The criteria include a search query string, an optional list of object types, and sort options (e.g. ascending/descending by creation, modification, or last opened dates). Internally, the endpoint aggregates results from each space, merges and sorts them (after last modified date by default), and returns a unified, paginated list of objects that match the search parameters.","operationId":"searchGlobal","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects across all spaces","tags":["Search"]}},"/spaces":{"get":{"description":"Retrieves a paginated list of all spaces that are accessible by the authenticated user. Each space record contains detailed information such as the space ID, name, icon (derived either from an emoji or image URL), and additional metadata. This endpoint is key to displaying a user’s workspaces.","operationId":"listSpaces","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Space"}}},"description":"List of spaces"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List spaces","tags":["Spaces"]},"post":{"description":"Creates a new workspace (or space) based on a supplied name in the JSON request body. The endpoint is subject to rate limiting and automatically applies default configurations such as generating a random icon and initializing the workspace with default settings (for example, a default dashboard or home page). On success, the new space’s full metadata is returned, enabling the client to immediately switch context to the new space.","operationId":"createSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.CreateSpaceRequest"}}},"description":"Space to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space created successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create space","tags":["Spaces"]}},"/spaces/{space_id}":{"get":{"description":"Fetches full details about a single space identified by its space ID. The response includes metadata such as the space name, icon, and various workspace IDs (home, archive, profile, etc.). This detailed view supports use cases such as displaying space-specific settings.","operationId":"getSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Space not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get space","tags":["Spaces"]}},"/spaces/{space_id}/lists/{list_id}/objects":{"post":{"description":"Enables clients to add one or more objects to a specific list (collection only) by submitting a JSON array of object IDs. Upon success, the endpoint returns a confirmation message. This endpoint is vital for building user interfaces that allow drag‑and‑drop or multi‑select additions to collections.","operationId":"addListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array"}}},"description":"List of object IDs","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects added successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Add objects to list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/objects/{object_id}":{"delete":{"description":"Removes a given object from the specified list (collection only) in a space. The endpoint takes the space, list, and object identifiers as path parameters. It's subject to rate limiting and returns a success message on completion. It is used for dynamically managing collections without affecting the underlying object data.","operationId":"removeListObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects removed successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Remove object from list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/views":{"get":{"description":"Returns a paginated list of views defined for a specific list (query or collection) within a space. Each view includes configuration details such as layout, applied filters, and sorting options, enabling clients to render the list according to user preferences and context. This endpoint supports pagination parameters to control the number of views returned and the starting point of the result set.","operationId":"getListViews","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-list_View"}}},"description":"List of views"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get list views","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/{view_id}/objects":{"get":{"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.","operationId":"getListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"View ID","in":"path","name":"view_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get objects in list","tags":["Lists"]}},"/spaces/{space_id}/members":{"get":{"description":"Returns a paginated list of members belonging to the specified space. Each member record includes the member’s profile ID, name, icon (which may be derived from an emoji or image), network identity, global name, status (e.g. joining, active) and role (e.g. Viewer, Editor, Owner). This endpoint supports collaborative features by allowing clients to show who is in a space and manage access rights.","operationId":"listMembers","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Member"}}},"description":"List of members"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List members","tags":["Members"]}},"/spaces/{space_id}/members/{member_id}":{"get":{"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.","operationId":"getMember","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Member ID or Identity","in":"path","name":"member_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.MemberResponse"}}},"description":"Member"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Member not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get member","tags":["Members"]}},"/spaces/{space_id}/objects":{"get":{"description":"Retrieves a paginated list of objects in the given space. The endpoint takes query parameters for pagination (offset and limit) and returns detailed data about each object including its ID, name, icon, type information, a snippet of the content (if applicable), layout, space ID, blocks and details. It is intended for building views where users can see all objects in a space at a glance.","operationId":"listObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List objects","tags":["Objects"]},"post":{"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.","operationId":"createObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateObjectRequest"}}},"description":"Object to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The created object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}":{"delete":{"description":"This endpoint “deletes” an object by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the object’s details after it has been archived. Proper error handling is in place for situations such as when the object isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The deleted object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete object","tags":["Objects"]},"get":{"description":"Fetches the full details of a single object identified by the object ID within the specified space. The response includes not only basic metadata (ID, name, icon, type) but also the complete set of blocks (which may include text, files, properties and dataviews) and extra details (such as timestamps and linked member information). This endpoint is essential when a client needs to render or edit the full object view.","operationId":"getObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The requested object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get object","tags":["Objects"]},"patch":{"description":"This endpoint updates an existing object in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the object ID and the details to be updated. The endpoint then returns the full object data, ready for further interactions.","operationId":"updateObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateObjectRequest"}}},"description":"Object to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The updated object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}/{format}":{"get":{"description":"This endpoint exports a single object from the specified space into a desired format. The export format is provided as a path parameter (currently supporting “markdown” only). The endpoint calls the export service which converts the object’s content into the requested format. It is useful for sharing, or displaying the markdown representation of the objecte externally.","operationId":"exportObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}},{"description":"Export format","in":"path","name":"format","required":true,"schema":{"enum":["markdown"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectExportResponse"}}},"description":"Object exported successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Export object","tags":["Objects"]}},"/spaces/{space_id}/properties":{"get":{"description":"This endpoint retrieves a paginated list of properties available within a specific space. Each property record includes its unique identifier, name and format. This information is essential for clients to understand the available properties for filtering or creating objects.","operationId":"listProperties","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Property"}}},"description":"List of properties"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List properties","tags":["Properties"]},"post":{"description":"Creates a new property in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include property details such as the name and format. The endpoint then returns the full property data, ready for further interactions.","operationId":"createProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreatePropertyRequest"}}},"description":"Property to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The created property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}":{"delete":{"description":"This endpoint “deletes” a property by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the property’s details after it has been archived. Proper error handling is in place for situations such as when the property isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The deleted property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete property","tags":["Properties"]},"get":{"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).","operationId":"getProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The requested property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get property","tags":["Properties"]},"patch":{"description":"This endpoint updates an existing property in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the property ID and the name to be updated. The endpoint then returns the full property data, ready for further interactions.","operationId":"updateProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdatePropertyRequest"}}},"description":"Property to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The updated property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}/tags":{"get":{"description":"This endpoint retrieves a paginated list of tags available for a specific property within a space. Each tag record includes its unique identifier, name, and color. This information is essential for clients to display select or multi-select options to users when they are creating or editing objects. The endpoint also supports pagination through offset and limit parameters.","operationId":"listTags","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Tag"}}},"description":"List of tags"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Property not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List tags","tags":["Tags"]},"post":{"description":"This endpoint creates a new tag for a given property id in a space. The creation process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to add new tag options to a property.","operationId":"createTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateTagRequest"}}},"description":"Tag to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The created tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create tag","tags":["Tags"]}},"/spaces/{space_id}/properties/{property_id}/tags/{tag_id}":{"delete":{"description":"This endpoint “deletes” a tag by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the tag’s details after it has been archived. Proper error handling is in place for situations such as when the tag isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The deleted tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete tag","tags":["Tags"]},"get":{"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.","operationId":"getTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The requested tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get tag","tags":["Tags"]},"patch":{"description":"This endpoint updates a tag for a given property id in a space. The update process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to edit existing tags for a property.","operationId":"updateTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateTagRequest"}}},"description":"Tag to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The updated tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update tag","tags":["Tags"]}},"/spaces/{space_id}/search":{"post":{"description":"This endpoint performs a focused search within a single space (specified by the space_id path parameter). Like the global search, it accepts pagination parameters and a JSON payload containing the search query, object types, and sorting preferences. The search is limited to the provided space and returns a list of objects that match the query. This allows clients to implement space‑specific filtering without having to process extraneous results.","operationId":"searchSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects within a space","tags":["Search"]}},"/spaces/{space_id}/types":{"get":{"description":"This endpoint retrieves a paginated list of object types (e.g. 'Page', 'Note', 'Task') available within the specified space. Each type’s record includes its unique identifier, type key, display name, icon, and a recommended layout. While a type's id is truly unique, a type's key can be the same across spaces for known types, e.g. 'ot-page' for 'Page'. Clients use this information when offering choices for object creation or for filtering objects by type through search.","operationId":"listTypes","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Type"}}},"description":"List of types"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List types","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}":{"get":{"description":"Fetches detailed information about one specific object type by its ID. This includes the type’s unique key, name, icon, and recommended 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).","operationId":"getType","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TypeResponse"}}},"description":"The requested type"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get type","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}/templates":{"get":{"description":"This endpoint returns a paginated list of templates that are associated with a specific object type within a space. Templates provide pre‑configured structures for creating new objects. Each template record contains its identifier, name, and icon, so that clients can offer users a selection of templates when creating objects.","operationId":"listTemplates","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Template"}}},"description":"List of templates"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List templates","tags":["Templates"]}},"/spaces/{space_id}/types/{type_id}/templates/{template_id}":{"get":{"description":"Fetches full details for one template associated with a particular object type in a space. The response provides the template’s identifier, name, icon, and any other relevant metadata. This endpoint is useful when a client needs to preview or apply a template to prefill object creation fields.","operationId":"getTemplate","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"Template ID","in":"path","name":"template_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TemplateResponse"}}},"description":"The requested template"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get template","tags":["Templates"]}}}, + "paths": {"/auth/display_code":{"post":{"description":"This endpoint initiates a secure authentication flow by generating a new challenge. Clients must supply the name of the application (via a query parameter) that is requesting authentication. On success, the service returns a unique challenge ID. This challenge ID must then be used with the token endpoint (see below) to solve the challenge and retrieve an authentication token. In essence, this endpoint “boots up” the login process and is the first step in a multi-phase authentication sequence.","operationId":"createAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"App name requesting the challenge","in":"query","name":"app_name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.DisplayCodeResponse"}}},"description":"Challenge ID"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Start new challenge","tags":["Auth"]}},"/auth/token":{"post":{"description":"After receiving a challenge ID from the display_code endpoint, the client calls this endpoint to provide the corresponding 4-digit code (also via a query parameter) along with the challenge ID. The endpoint verifies that the challenge solution is correct and, if it is, returns an ephemeral session token together with a permanent app key. These tokens are then used in subsequent API requests to authorize access. This endpoint is central to ensuring that only properly authenticated sessions can access further resources.","operationId":"solveAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Challenge ID","in":"query","name":"challenge_id","required":true,"schema":{"type":"string"}},{"description":"4-digit code retrieved from Anytype Desktop app","in":"query","name":"code","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.TokenResponse"}}},"description":"Authentication token"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Solve challenge","tags":["Auth"]}},"/search":{"post":{"description":"This endpoint executes a global search over every space the user has access to. It accepts pagination parameters (offset and limit) and a JSON body containing search criteria. The criteria include a search query string, an optional list of object types, and sort options (e.g. ascending/descending by creation, modification, or last opened dates). Internally, the endpoint aggregates results from each space, merges and sorts them (after last modified date by default), and returns a unified, paginated list of objects that match the search parameters.","operationId":"searchGlobal","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects across all spaces","tags":["Search"]}},"/spaces":{"get":{"description":"Retrieves a paginated list of all spaces that are accessible by the authenticated user. Each space record contains detailed information such as the space ID, name, icon (derived either from an emoji or image URL), and additional metadata. This endpoint is key to displaying a user’s workspaces.","operationId":"listSpaces","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Space"}}},"description":"List of spaces"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List spaces","tags":["Spaces"]},"post":{"description":"Creates a new workspace (or space) based on a supplied name in the JSON request body. The endpoint is subject to rate limiting and automatically applies default configurations such as generating a random icon and initializing the workspace with default settings (for example, a default dashboard or home page). On success, the new space’s full metadata is returned, enabling the client to immediately switch context to the new space.","operationId":"createSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.CreateSpaceRequest"}}},"description":"Space to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space created successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create space","tags":["Spaces"]}},"/spaces/{space_id}":{"get":{"description":"Fetches full details about a single space identified by its space ID. The response includes metadata such as the space name, icon, and various workspace IDs (home, archive, profile, etc.). This detailed view supports use cases such as displaying space-specific settings.","operationId":"getSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Space not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get space","tags":["Spaces"]}},"/spaces/{space_id}/lists/{list_id}/objects":{"post":{"description":"Enables clients to add one or more objects to a specific list (collection only) by submitting a JSON array of object IDs. Upon success, the endpoint returns a confirmation message. This endpoint is vital for building user interfaces that allow drag‑and‑drop or multi‑select additions to collections.","operationId":"addListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array"}}},"description":"List of object IDs","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects added successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Add objects to list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/objects/{object_id}":{"delete":{"description":"Removes a given object from the specified list (collection only) in a space. The endpoint takes the space, list, and object identifiers as path parameters. It's subject to rate limiting and returns a success message on completion. It is used for dynamically managing collections without affecting the underlying object data.","operationId":"removeListObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects removed successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Remove object from list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/views":{"get":{"description":"Returns a paginated list of views defined for a specific list (query or collection) within a space. Each view includes configuration details such as layout, applied filters, and sorting options, enabling clients to render the list according to user preferences and context. This endpoint supports pagination parameters to control the number of views returned and the starting point of the result set.","operationId":"getListViews","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-list_View"}}},"description":"List of views"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get list views","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/{view_id}/objects":{"get":{"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.","operationId":"getListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"View ID","in":"path","name":"view_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get objects in list","tags":["Lists"]}},"/spaces/{space_id}/members":{"get":{"description":"Returns a paginated list of members belonging to the specified space. Each member record includes the member’s profile ID, name, icon (which may be derived from an emoji or image), network identity, global name, status (e.g. joining, active) and role (e.g. Viewer, Editor, Owner). This endpoint supports collaborative features by allowing clients to show who is in a space and manage access rights.","operationId":"listMembers","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Member"}}},"description":"List of members"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List members","tags":["Members"]}},"/spaces/{space_id}/members/{member_id}":{"get":{"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.","operationId":"getMember","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Member ID or Identity","in":"path","name":"member_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.MemberResponse"}}},"description":"Member"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Member not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get member","tags":["Members"]}},"/spaces/{space_id}/objects":{"get":{"description":"Retrieves a paginated list of objects in the given space. The endpoint takes query parameters for pagination (offset and limit) and returns detailed data about each object including its ID, name, icon, type information, a snippet of the content (if applicable), layout, space ID, blocks and details. It is intended for building views where users can see all objects in a space at a glance.","operationId":"listObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List objects","tags":["Objects"]},"post":{"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.","operationId":"createObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateObjectRequest"}}},"description":"Object to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The created object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}":{"delete":{"description":"This endpoint “deletes” an object by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the object’s details after it has been archived. Proper error handling is in place for situations such as when the object isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The deleted object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete object","tags":["Objects"]},"get":{"description":"Fetches the full details of a single object identified by the object ID within the specified space. The response includes not only basic metadata (ID, name, icon, type) but also the complete set of blocks (which may include text, files, properties and dataviews) and extra details (such as timestamps and linked member information). This endpoint is essential when a client needs to render or edit the full object view.","operationId":"getObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The requested object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get object","tags":["Objects"]},"patch":{"description":"This endpoint updates an existing object in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the object ID and the details to be updated. The endpoint then returns the full object data, ready for further interactions.","operationId":"updateObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateObjectRequest"}}},"description":"Object to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The updated object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}/{format}":{"get":{"description":"This endpoint exports a single object from the specified space into a desired format. The export format is provided as a path parameter (currently supporting “markdown” only). The endpoint calls the export service which converts the object’s content into the requested format. It is useful for sharing, or displaying the markdown representation of the objecte externally.","operationId":"exportObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}},{"description":"Export format","in":"path","name":"format","required":true,"schema":{"enum":["markdown"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectExportResponse"}}},"description":"Object exported successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Export object","tags":["Objects"]}},"/spaces/{space_id}/properties":{"get":{"description":"This endpoint retrieves a paginated list of properties available within a specific space. Each property record includes its unique identifier, name and format. This information is essential for clients to understand the available properties for filtering or creating objects.","operationId":"listProperties","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Property"}}},"description":"List of properties"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List properties","tags":["Properties"]},"post":{"description":"Creates a new property in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include property details such as the name and format. The endpoint then returns the full property data, ready for further interactions.","operationId":"createProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreatePropertyRequest"}}},"description":"Property to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The created property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}":{"delete":{"description":"This endpoint “deletes” a property by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the property’s details after it has been archived. Proper error handling is in place for situations such as when the property isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The deleted property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete property","tags":["Properties"]},"get":{"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).","operationId":"getProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The requested property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get property","tags":["Properties"]},"patch":{"description":"This endpoint updates an existing property in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the property ID and the name to be updated. The endpoint then returns the full property data, ready for further interactions.","operationId":"updateProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdatePropertyRequest"}}},"description":"Property to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The updated property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}/tags":{"get":{"description":"This endpoint retrieves a paginated list of tags available for a specific property within a space. Each tag record includes its unique identifier, name, and color. This information is essential for clients to display select or multi-select options to users when they are creating or editing objects. The endpoint also supports pagination through offset and limit parameters.","operationId":"listTags","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Tag"}}},"description":"List of tags"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Property not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List tags","tags":["Tags"]},"post":{"description":"This endpoint creates a new tag for a given property id in a space. The creation process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to add new tag options to a property.","operationId":"createTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateTagRequest"}}},"description":"Tag to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The created tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create tag","tags":["Tags"]}},"/spaces/{space_id}/properties/{property_id}/tags/{tag_id}":{"delete":{"description":"This endpoint “deletes” a tag by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the tag’s details after it has been archived. Proper error handling is in place for situations such as when the tag isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The deleted tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete tag","tags":["Tags"]},"get":{"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.","operationId":"getTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The requested tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get tag","tags":["Tags"]},"patch":{"description":"This endpoint updates a tag for a given property id in a space. The update process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to edit existing tags for a property.","operationId":"updateTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateTagRequest"}}},"description":"Tag to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The updated tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update tag","tags":["Tags"]}},"/spaces/{space_id}/search":{"post":{"description":"This endpoint performs a focused search within a single space (specified by the space_id path parameter). Like the global search, it accepts pagination parameters and a JSON payload containing the search query, object types, and sorting preferences. The search is limited to the provided space and returns a list of objects that match the query. This allows clients to implement space‑specific filtering without having to process extraneous results.","operationId":"searchSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects within a space","tags":["Search"]}},"/spaces/{space_id}/types":{"get":{"description":"This endpoint retrieves a paginated list of object types (e.g. 'Page', 'Note', 'Task') available within the specified space. Each type’s record includes its unique identifier, type key, display name, icon, and a recommended layout. While a type's id is truly unique, a type's key can be the same across spaces for known types, e.g. 'ot-page' for 'Page'. Clients use this information when offering choices for object creation or for filtering objects by type through search.","operationId":"listTypes","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Type"}}},"description":"List of types"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List types","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}":{"get":{"description":"Fetches detailed information about one specific object type by its ID. This includes the type’s unique key, name, icon, and recommended 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).","operationId":"getType","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TypeResponse"}}},"description":"The requested type"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get type","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}/templates":{"get":{"description":"This endpoint returns a paginated list of templates that are associated with a specific object type within a space. Templates provide pre‑configured structures for creating new objects. Each template record contains its identifier, name, and icon, so that clients can offer users a selection of templates when creating objects.","operationId":"listTemplates","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of templates"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List templates","tags":["Templates"]}},"/spaces/{space_id}/types/{type_id}/templates/{template_id}":{"get":{"description":"Fetches full details for one template associated with a particular object type in a space. The response provides the template’s identifier, name, icon, and any other relevant metadata. This endpoint is useful when a client needs to preview or apply a template to prefill object creation fields.","operationId":"getTemplate","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"Template ID","in":"path","name":"template_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TemplateResponse"}}},"description":"The requested template"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get template","tags":["Templates"]}}}, "openapi": "3.1.0", "servers": [ {"url":"http://localhost:31009/v1"} diff --git a/core/api/docs/swagger.json b/core/api/docs/swagger.json index 22e426d5d..eeddc4bc7 100644 --- a/core/api/docs/swagger.json +++ b/core/api/docs/swagger.json @@ -1,8 +1,8 @@ { - "components": {"schemas":{"auth.DisplayCodeResponse":{"properties":{"challenge_id":{"description":"The challenge id associated with the displayed code and needed to solve the challenge for token","example":"67647f5ecda913e9a2e11b26","type":"string"}},"type":"object"},"auth.TokenResponse":{"properties":{"app_key":{"description":"The app key used to authenticate requests","example":"zhSG/zQRmgADyilWPtgdnfo1qD60oK02/SVgi1GaFt6=","type":"string"}},"type":"object"},"list.Filter":{"properties":{"condition":{"description":"The filter condition","enum":["equal","not_equal","greater","less","greater_or_equal","less_or_equal","like","not_like","in","not_in","empty","not_empty","all_in","not_all_in","exact_in","not_exact_in","exists"],"example":"contains","type":"string"},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the filter","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for filtering","example":"name","type":"string"},"value":{"description":"The value used for filtering","example":"Some value...","type":"string"}},"type":"object"},"list.Sort":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the sort","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for sorting","example":"name","type":"string"},"sort_type":{"description":"The sort direction","enum":["asc","desc","custom"],"example":"asc","type":"string"}},"type":"object"},"list.View":{"properties":{"filters":{"description":"The list of filters","items":{"$ref":"#/components/schemas/list.Filter"},"type":"array","uniqueItems":false},"id":{"description":"The id of the view","example":"67bf3f21cda9134102e2422c","type":"string"},"layout":{"description":"The layout of the view","enum":["grid","table"],"example":"grid","type":"string"},"name":{"description":"The name of the view","example":"All","type":"string"},"sorts":{"description":"The list of sorts","items":{"$ref":"#/components/schemas/list.Sort"},"type":"array","uniqueItems":false}},"type":"object"},"object.Block":{"properties":{"align":{"description":"The alignment of the block","enum":["AlignLeft","AlignCenter","AlignRight","AlignJustify"],"example":"AlignLeft","type":"string"},"background_color":{"description":"The background color of the block","example":"red","type":"string"},"children_ids":{"description":"The ids of the block's children","example":["['6797ce8ecda913cde14b02dc']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"file":{"$ref":"#/components/schemas/object.File"},"id":{"description":"The id of the block","example":"64394517de52ad5acb89c66c","type":"string"},"object":{"description":"The data model of the object","example":"block","type":"string"},"property":{"$ref":"#/components/schemas/object.Property"},"text":{"$ref":"#/components/schemas/object.Text"},"vertical_align":{"description":"The vertical alignment of the block","enum":["VerticalAlignTop","VerticalAlignMiddle","VerticalAlignBottom"],"example":"VerticalAlignTop","type":"string"}},"type":"object"},"object.Color":{"description":"The color of the icon","enum":["grey","yellow","orange","red","pink","purple","blue","ice","teal","lime"],"example":"yellow","type":"string","x-enum-varnames":["ColorGrey","ColorYellow","ColorOrange","ColorRed","ColorPink","ColorPurple","ColorBlue","ColorIce","ColorTeal","ColorLime"]},"object.CreateObjectRequest":{"properties":{"body":{"description":"The body of the object","example":"This is the body of the object. Markdown syntax is supported here.","type":"string"},"description":{"description":"The description of the object","example":"This is a description of the object.","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to set on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"},"source":{"description":"The source url, only applicable for bookmarks","example":"https://bookmark-source.com","type":"string"},"template_id":{"description":"The id of the template to use","example":"bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge","type":"string"},"type_key":{"description":"The key of the type of object to create","example":"ot-page","type":"string"}},"required":["name","type_key"],"type":"object"},"object.CreatePropertyRequest":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"name":{"description":"The name of the property","example":"Last modified date","type":"string"}},"required":["format","name"],"type":"object"},"object.CreateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"name":{"description":"The name of the tag","example":"In progress","type":"string"}},"required":["color","name"],"type":"object"},"object.File":{"description":"The file of the block, if applicable","properties":{"added_at":{"description":"The added at of the file","type":"integer"},"hash":{"description":"The hash of the file","type":"string"},"mime":{"description":"The mime of the file","type":"string"},"name":{"description":"The name of the file","type":"string"},"object":{"description":"The data model of the object","example":"file","type":"string"},"size":{"description":"The size of the file","type":"integer"},"state":{"description":"The state of the file","type":"string"},"style":{"description":"The style of the file","type":"string"},"target_object_id":{"description":"The target object id of the file","type":"string"},"type":{"description":"The type of the file","type":"string"}},"type":"object"},"object.Icon":{"description":"The icon of the object","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"emoji":{"description":"The emoji of the icon","example":"📄","type":"string"},"file":{"description":"The file of the icon","example":"http://127.0.0.1:31006/image/bafybeieptz5hvcy6txplcvphjbbh5yjc2zqhmihs3owkh5oab4ezauzqay","type":"string"},"format":{"$ref":"#/components/schemas/object.IconFormat"},"name":{"description":"The name of the icon","example":"document","type":"string"}},"type":"object"},"object.IconFormat":{"description":"The type of the icon","enum":["emoji","file","icon"],"example":"emoji","type":"string","x-enum-varnames":["IconFormatEmoji","IconFormatFile","IconFormatIcon"]},"object.Object":{"properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.ObjectExportResponse":{"properties":{"markdown":{"example":"# This is the title\n...","type":"string"}},"type":"object"},"object.ObjectResponse":{"properties":{"object":{"$ref":"#/components/schemas/object.ObjectWithBlocks"}},"type":"object"},"object.ObjectWithBlocks":{"description":"The object","properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"blocks":{"description":"The blocks of the object. Omitted in endpoints for searching or listing objects, only included when getting single object.","items":{"$ref":"#/components/schemas/object.Block"},"type":"array","uniqueItems":false},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.Property":{"description":"The property block, if applicable","properties":{"checkbox":{"description":"The checkbox value, if applicable","enum":[true,false],"example":true,"type":"boolean"},"date":{"description":"The date value, if applicable","example":"2025-02-14T12:34:56Z","type":"string"},"email":{"description":"The email value, if applicable","example":"example@example.com","type":"string"},"files":{"description":"The file references, if applicable","example":["['fileId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the property","example":"bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a","type":"string"},"key":{"description":"The key of the property","example":"last_modified_date","type":"string"},"multi_select":{"description":"The multi-select values, if applicable","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"name":{"description":"The name of the property","example":"Last modified date","type":"string"},"number":{"description":"The number value, if applicable","example":42,"type":"number"},"object":{"description":"The data model of the object","example":"property","type":"string"},"objects":{"description":"The object references, if applicable","example":["['objectId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"phone":{"description":"The phone number value, if applicable","example":"+1234567890","type":"string"},"select":{"$ref":"#/components/schemas/object.Tag"},"text":{"description":"The text value, if applicable","example":"Some text...","type":"string"},"url":{"description":"The url value, if applicable","example":"https://example.com","type":"string"}},"type":"object"},"object.PropertyFormat":{"description":"The format of the property used for filtering","enum":["text","number","select","multi_select","date","files","checkbox","url","email","phone","objects"],"example":"date","type":"string","x-enum-varnames":["PropertyFormatText","PropertyFormatNumber","PropertyFormatSelect","PropertyFormatMultiSelect","PropertyFormatDate","PropertyFormatFiles","PropertyFormatCheckbox","PropertyFormatUrl","PropertyFormatEmail","PropertyFormatPhone","PropertyFormatObjects"]},"object.PropertyResponse":{"properties":{"property":{"$ref":"#/components/schemas/object.Property"}},"type":"object"},"object.Tag":{"description":"The select value, if applicable","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"id":{"description":"The id of the tag","example":"bafyreiaixlnaefu3ci22zdenjhsdlyaeeoyjrsid5qhfeejzlccijbj7sq","type":"string"},"key":{"description":"The key of the tag","example":"67b0d3e3cda913b84c1299b1","type":"string"},"name":{"description":"The name of the tag","example":"in-progress","type":"string"},"object":{"description":"The data model of the object","example":"tag","type":"string"}},"type":"object"},"object.TagResponse":{"properties":{"tag":{"$ref":"#/components/schemas/object.Tag"}},"type":"object"},"object.Template":{"description":"The template","properties":{"archived":{"description":"Whether the template is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the template","example":"bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge","type":"string"},"name":{"description":"The name of the template","example":"My template","type":"string"},"object":{"description":"The data model of the object","example":"template","type":"string"}},"type":"object"},"object.TemplateResponse":{"properties":{"template":{"$ref":"#/components/schemas/object.Template"}},"type":"object"},"object.Text":{"description":"The text of the block, if applicable","properties":{"checked":{"description":"Whether the text is checked","example":true,"type":"boolean"},"color":{"description":"The color of the text","example":"red","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"object":{"description":"The data model of the object","example":"text","type":"string"},"style":{"description":"The style of the text","enum":["Paragraph","Header1","Header2","Header3","Header4","Quote","Code","Title","Checkbox","Marked","Numbered","Toggle","Description","Callout"],"example":"Paragraph","type":"string"},"text":{"description":"The text","example":"Some text...","type":"string"}},"type":"object"},"object.Type":{"description":"The type of the object","properties":{"archived":{"description":"Whether the type is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the type (which is unique across spaces)","example":"bafyreigyb6l5szohs32ts26ku2j42yd65e6hqy2u3gtzgdwqv6hzftsetu","type":"string"},"key":{"description":"The key of the type (can be the same across spaces for known types)","example":"ot-page","type":"string"},"layout":{"description":"The recommended layout of the type","example":"todo","type":"string"},"name":{"description":"The name of the type","example":"Page","type":"string"},"object":{"description":"The data model of the object","example":"type","type":"string"},"properties":{"description":"The properties linked to the type","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false}},"type":"object"},"object.TypeResponse":{"properties":{"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.UpdateObjectRequest":{"properties":{"description":{"description":"The description of the object","example":"This is a description of the object.","type":"string"},"id":{"description":"The id of the object to update","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to update on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"}},"required":["id"],"type":"object"},"object.UpdatePropertyRequest":{"properties":{"id":{"description":"The id of the property to update","example":"bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a","type":"string"},"name":{"description":"the name to set for the property","example":"Last modified date","type":"string"}},"required":["id","name"],"type":"object"},"object.UpdateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"id":{"description":"The id of the tag to update","example":"bafyreiaixlnaefu3ci22zdenjhsdlyaeeoyjrsid5qhfeejzlccijbj7sq","type":"string"},"name":{"description":"The name to set for the tag","example":"In progress","type":"string"}},"required":["id"],"type":"object"},"pagination.PaginatedResponse-list_View":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/list.View"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Object":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Object"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Property":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Tag":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Template":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Template"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Type":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Type"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Member":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Member"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Space":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Space"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginationMeta":{"description":"The pagination metadata for the response","properties":{"has_more":{"description":"Indicates if there are more items available beyond the current result set","example":true,"type":"boolean"},"limit":{"description":"The maximum number of items returned in the result set","example":100,"type":"integer"},"offset":{"description":"The number of items skipped before starting to collect the result set","example":0,"type":"integer"},"total":{"description":"The total number of items available for the endpoint","example":1024,"type":"integer"}},"type":"object"},"search.SearchRequest":{"properties":{"query":{"description":"The search term to look for in object names and snippets","example":"test","type":"string"},"sort":{"$ref":"#/components/schemas/search.SortOptions"},"types":{"description":"The types of objects to search for, specified by key or ID","example":["ot-page","ot-678043f0cda9133be777049f","bafyreightzrdts2ymxyaeyzspwdfo2juspyam76ewq6qq7ixnw3523gs7q"],"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"search.SortDirection":{"default":"desc","description":"The direction to sort the search results","enum":["asc","desc"],"type":"string","x-enum-varnames":["Asc","Desc"]},"search.SortOptions":{"description":"The sorting criteria and direction for the search results","properties":{"direction":{"$ref":"#/components/schemas/search.SortDirection"},"property":{"$ref":"#/components/schemas/search.SortProperty"}},"type":"object"},"search.SortProperty":{"default":"last_modified_date","description":"The property to sort the search results by","enum":["created_date","last_modified_date","last_opened_date","name"],"type":"string","x-enum-varnames":["CreatedDate","LastModifiedDate","LastOpenedDate","Name"]},"space.CreateSpaceRequest":{"properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"name":{"description":"The name of the space","example":"New Space","type":"string"}},"type":"object"},"space.Member":{"description":"The member","properties":{"global_name":{"description":"The global name of the member in the network","example":"john.any","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The profile object id of the member","example":"_participant_bafyreigyfkt6rbv24sbv5aq2hko1bhmv5xxlf22b4bypdu6j7hnphm3psq_23me69r569oi1_AAjEaEwPF4nkEh9AWkqEnzcQ8HziBB4ETjiTpvRCQvWnSMDZ","type":"string"},"identity":{"description":"The identity of the member in the network","example":"AAjEaEwPF4nkEh7AWkqEnzcQ8HziGB4ETjiTpvRCQvWnSMDZ","type":"string"},"name":{"description":"The name of the member","example":"John Doe","type":"string"},"object":{"description":"The data model of the object","example":"member","type":"string"},"role":{"description":"The role of the member","enum":["viewer","editor","owner","no_permission"],"example":"owner","type":"string"},"status":{"description":"The status of the member","enum":["joining","active","removed","declined","removing","canceled"],"example":"active","type":"string"}},"type":"object"},"space.MemberResponse":{"properties":{"member":{"$ref":"#/components/schemas/space.Member"}},"type":"object"},"space.Space":{"description":"The space","properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"gateway_url":{"description":"The gateway url to serve files and media","example":"http://127.0.0.1:31006","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the space","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"name":{"description":"The name of the space","example":"My Space","type":"string"},"network_id":{"description":"The network id of the space","example":"N83gJpVd9MuNRZAuJLZ7LiMntTThhPc6DtzWWVjb1M3PouVU","type":"string"},"object":{"description":"The data model of the object","example":"space","type":"string"}},"type":"object"},"space.SpaceResponse":{"properties":{"space":{"$ref":"#/components/schemas/space.Space"}},"type":"object"},"util.ForbiddenError":{"properties":{"code":{"example":"forbidden","type":"string"},"message":{"example":"Forbidden","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":403,"type":"integer"}},"type":"object"},"util.GoneError":{"properties":{"code":{"example":"resource_gone","type":"string"},"message":{"example":"Resource is gone","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":410,"type":"integer"}},"type":"object"},"util.NotFoundError":{"properties":{"code":{"example":"object_not_found","type":"string"},"message":{"example":"Resource not found","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":404,"type":"integer"}},"type":"object"},"util.RateLimitError":{"properties":{"code":{"example":"rate_limit_exceeded","type":"string"},"message":{"example":"Rate limit exceeded","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":429,"type":"integer"}},"type":"object"},"util.ServerError":{"properties":{"code":{"example":"internal_server_error","type":"string"},"message":{"example":"Internal server error","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":500,"type":"integer"}},"type":"object"},"util.UnauthorizedError":{"properties":{"code":{"example":"unauthorized","type":"string"},"message":{"example":"Unauthorized","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":401,"type":"integer"}},"type":"object"},"util.ValidationError":{"properties":{"code":{"example":"bad_request","type":"string"},"message":{"example":"Bad request","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":400,"type":"integer"}},"type":"object"}},"securitySchemes":{"bearerauth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}}, + "components": {"schemas":{"auth.DisplayCodeResponse":{"properties":{"challenge_id":{"description":"The challenge id associated with the displayed code and needed to solve the challenge for token","example":"67647f5ecda913e9a2e11b26","type":"string"}},"type":"object"},"auth.TokenResponse":{"properties":{"app_key":{"description":"The app key used to authenticate requests","example":"zhSG/zQRmgADyilWPtgdnfo1qD60oK02/SVgi1GaFt6=","type":"string"}},"type":"object"},"list.Filter":{"properties":{"condition":{"description":"The filter condition","enum":["equal","not_equal","greater","less","greater_or_equal","less_or_equal","like","not_like","in","not_in","empty","not_empty","all_in","not_all_in","exact_in","not_exact_in","exists"],"example":"contains","type":"string"},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the filter","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for filtering","example":"name","type":"string"},"value":{"description":"The value used for filtering","example":"Some value...","type":"string"}},"type":"object"},"list.Sort":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the sort","example":"67bf3f21cda9134102e2422c","type":"string"},"property_key":{"description":"The property key used for sorting","example":"name","type":"string"},"sort_type":{"description":"The sort direction","enum":["asc","desc","custom"],"example":"asc","type":"string"}},"type":"object"},"list.View":{"properties":{"filters":{"description":"The list of filters","items":{"$ref":"#/components/schemas/list.Filter"},"type":"array","uniqueItems":false},"id":{"description":"The id of the view","example":"67bf3f21cda9134102e2422c","type":"string"},"layout":{"description":"The layout of the view","enum":["grid","table"],"example":"grid","type":"string"},"name":{"description":"The name of the view","example":"All","type":"string"},"sorts":{"description":"The list of sorts","items":{"$ref":"#/components/schemas/list.Sort"},"type":"array","uniqueItems":false}},"type":"object"},"object.Block":{"properties":{"align":{"description":"The alignment of the block","enum":["AlignLeft","AlignCenter","AlignRight","AlignJustify"],"example":"AlignLeft","type":"string"},"background_color":{"description":"The background color of the block","example":"red","type":"string"},"children_ids":{"description":"The ids of the block's children","example":["['6797ce8ecda913cde14b02dc']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"file":{"$ref":"#/components/schemas/object.File"},"id":{"description":"The id of the block","example":"64394517de52ad5acb89c66c","type":"string"},"object":{"description":"The data model of the object","example":"block","type":"string"},"property":{"$ref":"#/components/schemas/object.Property"},"text":{"$ref":"#/components/schemas/object.Text"},"vertical_align":{"description":"The vertical alignment of the block","enum":["VerticalAlignTop","VerticalAlignMiddle","VerticalAlignBottom"],"example":"VerticalAlignTop","type":"string"}},"type":"object"},"object.Color":{"description":"The color of the icon","enum":["grey","yellow","orange","red","pink","purple","blue","ice","teal","lime"],"example":"yellow","type":"string","x-enum-varnames":["ColorGrey","ColorYellow","ColorOrange","ColorRed","ColorPink","ColorPurple","ColorBlue","ColorIce","ColorTeal","ColorLime"]},"object.CreateObjectRequest":{"properties":{"body":{"description":"The body of the object","example":"This is the body of the object. Markdown syntax is supported here.","type":"string"},"description":{"description":"The description of the object","example":"This is a description of the object.","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to set on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"},"source":{"description":"The source url, only applicable for bookmarks","example":"https://bookmark-source.com","type":"string"},"template_id":{"description":"The id of the template to use","example":"bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge","type":"string"},"type_key":{"description":"The key of the type of object to create","example":"ot-page","type":"string"}},"required":["name","type_key"],"type":"object"},"object.CreatePropertyRequest":{"properties":{"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"name":{"description":"The name of the property","example":"Last modified date","type":"string"}},"required":["format","name"],"type":"object"},"object.CreateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"name":{"description":"The name of the tag","example":"In progress","type":"string"}},"required":["color","name"],"type":"object"},"object.File":{"description":"The file of the block, if applicable","properties":{"added_at":{"description":"The added at of the file","type":"integer"},"hash":{"description":"The hash of the file","type":"string"},"mime":{"description":"The mime of the file","type":"string"},"name":{"description":"The name of the file","type":"string"},"object":{"description":"The data model of the object","example":"file","type":"string"},"size":{"description":"The size of the file","type":"integer"},"state":{"description":"The state of the file","type":"string"},"style":{"description":"The style of the file","type":"string"},"target_object_id":{"description":"The target object id of the file","type":"string"},"type":{"description":"The type of the file","type":"string"}},"type":"object"},"object.Icon":{"description":"The icon of the object","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"emoji":{"description":"The emoji of the icon","example":"📄","type":"string"},"file":{"description":"The file of the icon","example":"http://127.0.0.1:31006/image/bafybeieptz5hvcy6txplcvphjbbh5yjc2zqhmihs3owkh5oab4ezauzqay","type":"string"},"format":{"$ref":"#/components/schemas/object.IconFormat"},"name":{"description":"The name of the icon","example":"document","type":"string"}},"type":"object"},"object.IconFormat":{"description":"The type of the icon","enum":["emoji","file","icon"],"example":"emoji","type":"string","x-enum-varnames":["IconFormatEmoji","IconFormatFile","IconFormatIcon"]},"object.Object":{"properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.ObjectExportResponse":{"properties":{"markdown":{"example":"# This is the title\n...","type":"string"}},"type":"object"},"object.ObjectResponse":{"properties":{"object":{"$ref":"#/components/schemas/object.ObjectWithBlocks"}},"type":"object"},"object.ObjectWithBlocks":{"description":"The object","properties":{"archived":{"description":"Whether the object is archived","example":false,"type":"boolean"},"blocks":{"description":"The blocks of the object. Omitted in endpoints for searching or listing objects, only included when getting single object.","items":{"$ref":"#/components/schemas/object.Block"},"type":"array","uniqueItems":false},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the object","example":"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ","type":"string"},"layout":{"description":"The layout of the object","example":"basic","type":"string"},"name":{"description":"The name of the object","example":"My object","type":"string"},"object":{"description":"The data model of the object","example":"object","type":"string"},"properties":{"description":"The properties of the object","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"snippet":{"description":"The snippet of the object, especially important for notes as they don't have a name","example":"The beginning of the object body...","type":"string"},"space_id":{"description":"The id of the space the object is in","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.Property":{"description":"The property block, if applicable","properties":{"checkbox":{"description":"The checkbox value, if applicable","enum":[true,false],"example":true,"type":"boolean"},"date":{"description":"The date value, if applicable","example":"2025-02-14T12:34:56Z","type":"string"},"email":{"description":"The email value, if applicable","example":"example@example.com","type":"string"},"files":{"description":"The file references, if applicable","example":["['fileId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"format":{"$ref":"#/components/schemas/object.PropertyFormat"},"id":{"description":"The id of the property","example":"bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a","type":"string"},"key":{"description":"The key of the property","example":"last_modified_date","type":"string"},"multi_select":{"description":"The multi-select values, if applicable","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"name":{"description":"The name of the property","example":"Last modified date","type":"string"},"number":{"description":"The number value, if applicable","example":42,"type":"number"},"object":{"description":"The data model of the object","example":"property","type":"string"},"objects":{"description":"The object references, if applicable","example":["['objectId']"],"items":{"type":"string"},"type":"array","uniqueItems":false},"phone":{"description":"The phone number value, if applicable","example":"+1234567890","type":"string"},"select":{"$ref":"#/components/schemas/object.Tag"},"text":{"description":"The text value, if applicable","example":"Some text...","type":"string"},"url":{"description":"The url value, if applicable","example":"https://example.com","type":"string"}},"type":"object"},"object.PropertyFormat":{"description":"The format of the property used for filtering","enum":["text","number","select","multi_select","date","files","checkbox","url","email","phone","objects"],"example":"date","type":"string","x-enum-varnames":["PropertyFormatText","PropertyFormatNumber","PropertyFormatSelect","PropertyFormatMultiSelect","PropertyFormatDate","PropertyFormatFiles","PropertyFormatCheckbox","PropertyFormatUrl","PropertyFormatEmail","PropertyFormatPhone","PropertyFormatObjects"]},"object.PropertyResponse":{"properties":{"property":{"$ref":"#/components/schemas/object.Property"}},"type":"object"},"object.Tag":{"description":"The select value, if applicable","properties":{"color":{"$ref":"#/components/schemas/object.Color"},"id":{"description":"The id of the tag","example":"bafyreiaixlnaefu3ci22zdenjhsdlyaeeoyjrsid5qhfeejzlccijbj7sq","type":"string"},"key":{"description":"The key of the tag","example":"67b0d3e3cda913b84c1299b1","type":"string"},"name":{"description":"The name of the tag","example":"in-progress","type":"string"},"object":{"description":"The data model of the object","example":"tag","type":"string"}},"type":"object"},"object.TagResponse":{"properties":{"tag":{"$ref":"#/components/schemas/object.Tag"}},"type":"object"},"object.TemplateResponse":{"properties":{"template":{"$ref":"#/components/schemas/object.ObjectWithBlocks"}},"type":"object"},"object.Text":{"description":"The text of the block, if applicable","properties":{"checked":{"description":"Whether the text is checked","example":true,"type":"boolean"},"color":{"description":"The color of the text","example":"red","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"object":{"description":"The data model of the object","example":"text","type":"string"},"style":{"description":"The style of the text","enum":["Paragraph","Header1","Header2","Header3","Header4","Quote","Code","Title","Checkbox","Marked","Numbered","Toggle","Description","Callout"],"example":"Paragraph","type":"string"},"text":{"description":"The text","example":"Some text...","type":"string"}},"type":"object"},"object.Type":{"description":"The type of the object","properties":{"archived":{"description":"Whether the type is archived","example":false,"type":"boolean"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the type (which is unique across spaces)","example":"bafyreigyb6l5szohs32ts26ku2j42yd65e6hqy2u3gtzgdwqv6hzftsetu","type":"string"},"key":{"description":"The key of the type (can be the same across spaces for known types)","example":"ot-page","type":"string"},"layout":{"description":"The recommended layout of the type","example":"todo","type":"string"},"name":{"description":"The name of the type","example":"Page","type":"string"},"object":{"description":"The data model of the object","example":"type","type":"string"},"properties":{"description":"The properties linked to the type","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false}},"type":"object"},"object.TypeResponse":{"properties":{"type":{"$ref":"#/components/schemas/object.Type"}},"type":"object"},"object.UpdateObjectRequest":{"properties":{"description":{"description":"The description to set for the object","example":"This is a description of the object.","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"name":{"description":"The name of the object","example":"My object","type":"string"},"properties":{"additionalProperties":{},"description":"The properties to update on the object","example":{"{\"property_key\"":" \"value\"}"},"type":"object"}},"type":"object"},"object.UpdatePropertyRequest":{"properties":{"name":{"description":"The name to set for the property","example":"Last modified date","type":"string"}},"required":["name"],"type":"object"},"object.UpdateTagRequest":{"properties":{"color":{"$ref":"#/components/schemas/object.Color"},"name":{"description":"The name to set for the tag","example":"In progress","type":"string"}},"type":"object"},"pagination.PaginatedResponse-list_View":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/list.View"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Object":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Object"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Property":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Property"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Tag":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Tag"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-object_Type":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/object.Type"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Member":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Member"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginatedResponse-space_Space":{"properties":{"data":{"description":"The list of items in the current result set","items":{"$ref":"#/components/schemas/space.Space"},"type":"array","uniqueItems":false},"pagination":{"$ref":"#/components/schemas/pagination.PaginationMeta"}},"type":"object"},"pagination.PaginationMeta":{"description":"The pagination metadata for the response","properties":{"has_more":{"description":"Indicates if there are more items available beyond the current result set","example":true,"type":"boolean"},"limit":{"description":"The maximum number of items returned in the result set","example":100,"type":"integer"},"offset":{"description":"The number of items skipped before starting to collect the result set","example":0,"type":"integer"},"total":{"description":"The total number of items available for the endpoint","example":1024,"type":"integer"}},"type":"object"},"search.SearchRequest":{"properties":{"query":{"description":"The search term to look for in object names and snippets","example":"test","type":"string"},"sort":{"$ref":"#/components/schemas/search.SortOptions"},"types":{"description":"The types of objects to search for, specified by key or ID","example":["ot-page","ot-678043f0cda9133be777049f","bafyreightzrdts2ymxyaeyzspwdfo2juspyam76ewq6qq7ixnw3523gs7q"],"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"search.SortDirection":{"default":"desc","description":"The direction to sort the search results","enum":["asc","desc"],"type":"string","x-enum-varnames":["Asc","Desc"]},"search.SortOptions":{"description":"The sorting criteria and direction for the search results","properties":{"direction":{"$ref":"#/components/schemas/search.SortDirection"},"property":{"$ref":"#/components/schemas/search.SortProperty"}},"type":"object"},"search.SortProperty":{"default":"last_modified_date","description":"The property to sort the search results by","enum":["created_date","last_modified_date","last_opened_date","name"],"type":"string","x-enum-varnames":["CreatedDate","LastModifiedDate","LastOpenedDate","Name"]},"space.CreateSpaceRequest":{"properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"name":{"description":"The name of the space","example":"New Space","type":"string"}},"type":"object"},"space.Member":{"description":"The member","properties":{"global_name":{"description":"The global name of the member in the network","example":"john.any","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The profile object id of the member","example":"_participant_bafyreigyfkt6rbv24sbv5aq2hko1bhmv5xxlf22b4bypdu6j7hnphm3psq_23me69r569oi1_AAjEaEwPF4nkEh9AWkqEnzcQ8HziBB4ETjiTpvRCQvWnSMDZ","type":"string"},"identity":{"description":"The identity of the member in the network","example":"AAjEaEwPF4nkEh7AWkqEnzcQ8HziGB4ETjiTpvRCQvWnSMDZ","type":"string"},"name":{"description":"The name of the member","example":"John Doe","type":"string"},"object":{"description":"The data model of the object","example":"member","type":"string"},"role":{"description":"The role of the member","enum":["viewer","editor","owner","no_permission"],"example":"owner","type":"string"},"status":{"description":"The status of the member","enum":["joining","active","removed","declined","removing","canceled"],"example":"active","type":"string"}},"type":"object"},"space.MemberResponse":{"properties":{"member":{"$ref":"#/components/schemas/space.Member"}},"type":"object"},"space.Space":{"description":"The space","properties":{"description":{"description":"The description of the space","example":"The local-first wiki","type":"string"},"gateway_url":{"description":"The gateway url to serve files and media","example":"http://127.0.0.1:31006","type":"string"},"icon":{"$ref":"#/components/schemas/object.Icon"},"id":{"description":"The id of the space","example":"bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1","type":"string"},"name":{"description":"The name of the space","example":"My Space","type":"string"},"network_id":{"description":"The network id of the space","example":"N83gJpVd9MuNRZAuJLZ7LiMntTThhPc6DtzWWVjb1M3PouVU","type":"string"},"object":{"description":"The data model of the object","example":"space","type":"string"}},"type":"object"},"space.SpaceResponse":{"properties":{"space":{"$ref":"#/components/schemas/space.Space"}},"type":"object"},"util.ForbiddenError":{"properties":{"code":{"example":"forbidden","type":"string"},"message":{"example":"Forbidden","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":403,"type":"integer"}},"type":"object"},"util.GoneError":{"properties":{"code":{"example":"resource_gone","type":"string"},"message":{"example":"Resource is gone","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":410,"type":"integer"}},"type":"object"},"util.NotFoundError":{"properties":{"code":{"example":"object_not_found","type":"string"},"message":{"example":"Resource not found","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":404,"type":"integer"}},"type":"object"},"util.RateLimitError":{"properties":{"code":{"example":"rate_limit_exceeded","type":"string"},"message":{"example":"Rate limit exceeded","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":429,"type":"integer"}},"type":"object"},"util.ServerError":{"properties":{"code":{"example":"internal_server_error","type":"string"},"message":{"example":"Internal server error","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":500,"type":"integer"}},"type":"object"},"util.UnauthorizedError":{"properties":{"code":{"example":"unauthorized","type":"string"},"message":{"example":"Unauthorized","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":401,"type":"integer"}},"type":"object"},"util.ValidationError":{"properties":{"code":{"example":"bad_request","type":"string"},"message":{"example":"Bad request","type":"string"},"object":{"example":"error","type":"string"},"status":{"example":400,"type":"integer"}},"type":"object"}},"securitySchemes":{"bearerauth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}}, "info": {"contact":{"email":"support@anytype.io","name":"Anytype Support","url":"https://anytype.io/contact"},"description":"This API empowers seamless interaction with Anytype's resources—spaces, objects, properties, types, templates, and beyond.","license":{"name":"Any Source Available License 1.0","url":"https://github.com/anyproto/anytype-api/blob/main/LICENSE.md"},"termsOfService":"https://anytype.io/terms_of_use","title":"Anytype API","version":"2025-04-22"}, "externalDocs": {"description":"OpenAPI","url":"https://swagger.io/resources/open-api/"}, - "paths": {"/auth/display_code":{"post":{"description":"This endpoint initiates a secure authentication flow by generating a new challenge. Clients must supply the name of the application (via a query parameter) that is requesting authentication. On success, the service returns a unique challenge ID. This challenge ID must then be used with the token endpoint (see below) to solve the challenge and retrieve an authentication token. In essence, this endpoint “boots up” the login process and is the first step in a multi-phase authentication sequence.","operationId":"createAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"App name requesting the challenge","in":"query","name":"app_name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.DisplayCodeResponse"}}},"description":"Challenge ID"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Start new challenge","tags":["Auth"]}},"/auth/token":{"post":{"description":"After receiving a challenge ID from the display_code endpoint, the client calls this endpoint to provide the corresponding 4-digit code (also via a query parameter) along with the challenge ID. The endpoint verifies that the challenge solution is correct and, if it is, returns an ephemeral session token together with a permanent app key. These tokens are then used in subsequent API requests to authorize access. This endpoint is central to ensuring that only properly authenticated sessions can access further resources.","operationId":"solveAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Challenge ID","in":"query","name":"challenge_id","required":true,"schema":{"type":"string"}},{"description":"4-digit code retrieved from Anytype Desktop app","in":"query","name":"code","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.TokenResponse"}}},"description":"Authentication token"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Solve challenge","tags":["Auth"]}},"/search":{"post":{"description":"This endpoint executes a global search over every space the user has access to. It accepts pagination parameters (offset and limit) and a JSON body containing search criteria. The criteria include a search query string, an optional list of object types, and sort options (e.g. ascending/descending by creation, modification, or last opened dates). Internally, the endpoint aggregates results from each space, merges and sorts them (after last modified date by default), and returns a unified, paginated list of objects that match the search parameters.","operationId":"searchGlobal","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects across all spaces","tags":["Search"]}},"/spaces":{"get":{"description":"Retrieves a paginated list of all spaces that are accessible by the authenticated user. Each space record contains detailed information such as the space ID, name, icon (derived either from an emoji or image URL), and additional metadata. This endpoint is key to displaying a user’s workspaces.","operationId":"listSpaces","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Space"}}},"description":"List of spaces"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List spaces","tags":["Spaces"]},"post":{"description":"Creates a new workspace (or space) based on a supplied name in the JSON request body. The endpoint is subject to rate limiting and automatically applies default configurations such as generating a random icon and initializing the workspace with default settings (for example, a default dashboard or home page). On success, the new space’s full metadata is returned, enabling the client to immediately switch context to the new space.","operationId":"createSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.CreateSpaceRequest"}}},"description":"Space to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space created successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create space","tags":["Spaces"]}},"/spaces/{space_id}":{"get":{"description":"Fetches full details about a single space identified by its space ID. The response includes metadata such as the space name, icon, and various workspace IDs (home, archive, profile, etc.). This detailed view supports use cases such as displaying space-specific settings.","operationId":"getSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Space not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get space","tags":["Spaces"]}},"/spaces/{space_id}/lists/{list_id}/objects":{"post":{"description":"Enables clients to add one or more objects to a specific list (collection only) by submitting a JSON array of object IDs. Upon success, the endpoint returns a confirmation message. This endpoint is vital for building user interfaces that allow drag‑and‑drop or multi‑select additions to collections.","operationId":"addListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array"}}},"description":"List of object IDs","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects added successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Add objects to list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/objects/{object_id}":{"delete":{"description":"Removes a given object from the specified list (collection only) in a space. The endpoint takes the space, list, and object identifiers as path parameters. It's subject to rate limiting and returns a success message on completion. It is used for dynamically managing collections without affecting the underlying object data.","operationId":"removeListObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects removed successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Remove object from list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/views":{"get":{"description":"Returns a paginated list of views defined for a specific list (query or collection) within a space. Each view includes configuration details such as layout, applied filters, and sorting options, enabling clients to render the list according to user preferences and context. This endpoint supports pagination parameters to control the number of views returned and the starting point of the result set.","operationId":"getListViews","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-list_View"}}},"description":"List of views"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get list views","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/{view_id}/objects":{"get":{"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.","operationId":"getListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"View ID","in":"path","name":"view_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get objects in list","tags":["Lists"]}},"/spaces/{space_id}/members":{"get":{"description":"Returns a paginated list of members belonging to the specified space. Each member record includes the member’s profile ID, name, icon (which may be derived from an emoji or image), network identity, global name, status (e.g. joining, active) and role (e.g. Viewer, Editor, Owner). This endpoint supports collaborative features by allowing clients to show who is in a space and manage access rights.","operationId":"listMembers","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Member"}}},"description":"List of members"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List members","tags":["Members"]}},"/spaces/{space_id}/members/{member_id}":{"get":{"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.","operationId":"getMember","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Member ID or Identity","in":"path","name":"member_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.MemberResponse"}}},"description":"Member"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Member not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get member","tags":["Members"]}},"/spaces/{space_id}/objects":{"get":{"description":"Retrieves a paginated list of objects in the given space. The endpoint takes query parameters for pagination (offset and limit) and returns detailed data about each object including its ID, name, icon, type information, a snippet of the content (if applicable), layout, space ID, blocks and details. It is intended for building views where users can see all objects in a space at a glance.","operationId":"listObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List objects","tags":["Objects"]},"post":{"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.","operationId":"createObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateObjectRequest"}}},"description":"Object to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The created object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}":{"delete":{"description":"This endpoint “deletes” an object by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the object’s details after it has been archived. Proper error handling is in place for situations such as when the object isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The deleted object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete object","tags":["Objects"]},"get":{"description":"Fetches the full details of a single object identified by the object ID within the specified space. The response includes not only basic metadata (ID, name, icon, type) but also the complete set of blocks (which may include text, files, properties and dataviews) and extra details (such as timestamps and linked member information). This endpoint is essential when a client needs to render or edit the full object view.","operationId":"getObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The requested object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get object","tags":["Objects"]},"patch":{"description":"This endpoint updates an existing object in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the object ID and the details to be updated. The endpoint then returns the full object data, ready for further interactions.","operationId":"updateObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateObjectRequest"}}},"description":"Object to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The updated object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}/{format}":{"get":{"description":"This endpoint exports a single object from the specified space into a desired format. The export format is provided as a path parameter (currently supporting “markdown” only). The endpoint calls the export service which converts the object’s content into the requested format. It is useful for sharing, or displaying the markdown representation of the objecte externally.","operationId":"exportObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}},{"description":"Export format","in":"path","name":"format","required":true,"schema":{"enum":["markdown"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectExportResponse"}}},"description":"Object exported successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Export object","tags":["Objects"]}},"/spaces/{space_id}/properties":{"get":{"description":"This endpoint retrieves a paginated list of properties available within a specific space. Each property record includes its unique identifier, name and format. This information is essential for clients to understand the available properties for filtering or creating objects.","operationId":"listProperties","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Property"}}},"description":"List of properties"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List properties","tags":["Properties"]},"post":{"description":"Creates a new property in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include property details such as the name and format. The endpoint then returns the full property data, ready for further interactions.","operationId":"createProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreatePropertyRequest"}}},"description":"Property to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The created property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}":{"delete":{"description":"This endpoint “deletes” a property by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the property’s details after it has been archived. Proper error handling is in place for situations such as when the property isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The deleted property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete property","tags":["Properties"]},"get":{"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).","operationId":"getProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The requested property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get property","tags":["Properties"]},"patch":{"description":"This endpoint updates an existing property in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the property ID and the name to be updated. The endpoint then returns the full property data, ready for further interactions.","operationId":"updateProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdatePropertyRequest"}}},"description":"Property to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The updated property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}/tags":{"get":{"description":"This endpoint retrieves a paginated list of tags available for a specific property within a space. Each tag record includes its unique identifier, name, and color. This information is essential for clients to display select or multi-select options to users when they are creating or editing objects. The endpoint also supports pagination through offset and limit parameters.","operationId":"listTags","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Tag"}}},"description":"List of tags"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Property not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List tags","tags":["Tags"]},"post":{"description":"This endpoint creates a new tag for a given property id in a space. The creation process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to add new tag options to a property.","operationId":"createTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateTagRequest"}}},"description":"Tag to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The created tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create tag","tags":["Tags"]}},"/spaces/{space_id}/properties/{property_id}/tags/{tag_id}":{"delete":{"description":"This endpoint “deletes” a tag by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the tag’s details after it has been archived. Proper error handling is in place for situations such as when the tag isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The deleted tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete tag","tags":["Tags"]},"get":{"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.","operationId":"getTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The requested tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get tag","tags":["Tags"]},"patch":{"description":"This endpoint updates a tag for a given property id in a space. The update process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to edit existing tags for a property.","operationId":"updateTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateTagRequest"}}},"description":"Tag to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The updated tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update tag","tags":["Tags"]}},"/spaces/{space_id}/search":{"post":{"description":"This endpoint performs a focused search within a single space (specified by the space_id path parameter). Like the global search, it accepts pagination parameters and a JSON payload containing the search query, object types, and sorting preferences. The search is limited to the provided space and returns a list of objects that match the query. This allows clients to implement space‑specific filtering without having to process extraneous results.","operationId":"searchSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects within a space","tags":["Search"]}},"/spaces/{space_id}/types":{"get":{"description":"This endpoint retrieves a paginated list of object types (e.g. 'Page', 'Note', 'Task') available within the specified space. Each type’s record includes its unique identifier, type key, display name, icon, and a recommended layout. While a type's id is truly unique, a type's key can be the same across spaces for known types, e.g. 'ot-page' for 'Page'. Clients use this information when offering choices for object creation or for filtering objects by type through search.","operationId":"listTypes","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Type"}}},"description":"List of types"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List types","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}":{"get":{"description":"Fetches detailed information about one specific object type by its ID. This includes the type’s unique key, name, icon, and recommended 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).","operationId":"getType","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TypeResponse"}}},"description":"The requested type"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get type","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}/templates":{"get":{"description":"This endpoint returns a paginated list of templates that are associated with a specific object type within a space. Templates provide pre‑configured structures for creating new objects. Each template record contains its identifier, name, and icon, so that clients can offer users a selection of templates when creating objects.","operationId":"listTemplates","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Template"}}},"description":"List of templates"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List templates","tags":["Templates"]}},"/spaces/{space_id}/types/{type_id}/templates/{template_id}":{"get":{"description":"Fetches full details for one template associated with a particular object type in a space. The response provides the template’s identifier, name, icon, and any other relevant metadata. This endpoint is useful when a client needs to preview or apply a template to prefill object creation fields.","operationId":"getTemplate","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"Template ID","in":"path","name":"template_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TemplateResponse"}}},"description":"The requested template"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get template","tags":["Templates"]}}}, + "paths": {"/auth/display_code":{"post":{"description":"This endpoint initiates a secure authentication flow by generating a new challenge. Clients must supply the name of the application (via a query parameter) that is requesting authentication. On success, the service returns a unique challenge ID. This challenge ID must then be used with the token endpoint (see below) to solve the challenge and retrieve an authentication token. In essence, this endpoint “boots up” the login process and is the first step in a multi-phase authentication sequence.","operationId":"createAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"App name requesting the challenge","in":"query","name":"app_name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.DisplayCodeResponse"}}},"description":"Challenge ID"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Start new challenge","tags":["Auth"]}},"/auth/token":{"post":{"description":"After receiving a challenge ID from the display_code endpoint, the client calls this endpoint to provide the corresponding 4-digit code (also via a query parameter) along with the challenge ID. The endpoint verifies that the challenge solution is correct and, if it is, returns an ephemeral session token together with a permanent app key. These tokens are then used in subsequent API requests to authorize access. This endpoint is central to ensuring that only properly authenticated sessions can access further resources.","operationId":"solveAuthChallenge","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Challenge ID","in":"query","name":"challenge_id","required":true,"schema":{"type":"string"}},{"description":"4-digit code retrieved from Anytype Desktop app","in":"query","name":"code","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.TokenResponse"}}},"description":"Authentication token"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Invalid input"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"summary":"Solve challenge","tags":["Auth"]}},"/search":{"post":{"description":"This endpoint executes a global search over every space the user has access to. It accepts pagination parameters (offset and limit) and a JSON body containing search criteria. The criteria include a search query string, an optional list of object types, and sort options (e.g. ascending/descending by creation, modification, or last opened dates). Internally, the endpoint aggregates results from each space, merges and sorts them (after last modified date by default), and returns a unified, paginated list of objects that match the search parameters.","operationId":"searchGlobal","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects across all spaces","tags":["Search"]}},"/spaces":{"get":{"description":"Retrieves a paginated list of all spaces that are accessible by the authenticated user. Each space record contains detailed information such as the space ID, name, icon (derived either from an emoji or image URL), and additional metadata. This endpoint is key to displaying a user’s workspaces.","operationId":"listSpaces","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Space"}}},"description":"List of spaces"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List spaces","tags":["Spaces"]},"post":{"description":"Creates a new workspace (or space) based on a supplied name in the JSON request body. The endpoint is subject to rate limiting and automatically applies default configurations such as generating a random icon and initializing the workspace with default settings (for example, a default dashboard or home page). On success, the new space’s full metadata is returned, enabling the client to immediately switch context to the new space.","operationId":"createSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.CreateSpaceRequest"}}},"description":"Space to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space created successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create space","tags":["Spaces"]}},"/spaces/{space_id}":{"get":{"description":"Fetches full details about a single space identified by its space ID. The response includes metadata such as the space name, icon, and various workspace IDs (home, archive, profile, etc.). This detailed view supports use cases such as displaying space-specific settings.","operationId":"getSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.SpaceResponse"}}},"description":"Space"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Space not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get space","tags":["Spaces"]}},"/spaces/{space_id}/lists/{list_id}/objects":{"post":{"description":"Enables clients to add one or more objects to a specific list (collection only) by submitting a JSON array of object IDs. Upon success, the endpoint returns a confirmation message. This endpoint is vital for building user interfaces that allow drag‑and‑drop or multi‑select additions to collections.","operationId":"addListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array"}}},"description":"List of object IDs","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects added successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Add objects to list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/objects/{object_id}":{"delete":{"description":"Removes a given object from the specified list (collection only) in a space. The endpoint takes the space, list, and object identifiers as path parameters. It's subject to rate limiting and returns a success message on completion. It is used for dynamically managing collections without affecting the underlying object data.","operationId":"removeListObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"Objects removed successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Remove object from list","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/views":{"get":{"description":"Returns a paginated list of views defined for a specific list (query or collection) within a space. Each view includes configuration details such as layout, applied filters, and sorting options, enabling clients to render the list according to user preferences and context. This endpoint supports pagination parameters to control the number of views returned and the starting point of the result set.","operationId":"getListViews","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-list_View"}}},"description":"List of views"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get list views","tags":["Lists"]}},"/spaces/{space_id}/lists/{list_id}/{view_id}/objects":{"get":{"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.","operationId":"getListObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"List ID","in":"path","name":"list_id","required":true,"schema":{"type":"string"}},{"description":"View ID","in":"path","name":"view_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get objects in list","tags":["Lists"]}},"/spaces/{space_id}/members":{"get":{"description":"Returns a paginated list of members belonging to the specified space. Each member record includes the member’s profile ID, name, icon (which may be derived from an emoji or image), network identity, global name, status (e.g. joining, active) and role (e.g. Viewer, Editor, Owner). This endpoint supports collaborative features by allowing clients to show who is in a space and manage access rights.","operationId":"listMembers","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-space_Member"}}},"description":"List of members"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List members","tags":["Members"]}},"/spaces/{space_id}/members/{member_id}":{"get":{"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.","operationId":"getMember","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Member ID or Identity","in":"path","name":"member_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/space.MemberResponse"}}},"description":"Member"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Member not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get member","tags":["Members"]}},"/spaces/{space_id}/objects":{"get":{"description":"Retrieves a paginated list of objects in the given space. The endpoint takes query parameters for pagination (offset and limit) and returns detailed data about each object including its ID, name, icon, type information, a snippet of the content (if applicable), layout, space ID, blocks and details. It is intended for building views where users can see all objects in a space at a glance.","operationId":"listObjects","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List objects","tags":["Objects"]},"post":{"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.","operationId":"createObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateObjectRequest"}}},"description":"Object to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The created object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}":{"delete":{"description":"This endpoint “deletes” an object by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the object’s details after it has been archived. Proper error handling is in place for situations such as when the object isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The deleted object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete object","tags":["Objects"]},"get":{"description":"Fetches the full details of a single object identified by the object ID within the specified space. The response includes not only basic metadata (ID, name, icon, type) but also the complete set of blocks (which may include text, files, properties and dataviews) and extra details (such as timestamps and linked member information). This endpoint is essential when a client needs to render or edit the full object view.","operationId":"getObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The requested object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get object","tags":["Objects"]},"patch":{"description":"This endpoint updates an existing object in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the object ID and the details to be updated. The endpoint then returns the full object data, ready for further interactions.","operationId":"updateObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateObjectRequest"}}},"description":"Object to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectResponse"}}},"description":"The updated object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update object","tags":["Objects"]}},"/spaces/{space_id}/objects/{object_id}/{format}":{"get":{"description":"This endpoint exports a single object from the specified space into a desired format. The export format is provided as a path parameter (currently supporting “markdown” only). The endpoint calls the export service which converts the object’s content into the requested format. It is useful for sharing, or displaying the markdown representation of the objecte externally.","operationId":"exportObject","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Object ID","in":"path","name":"object_id","required":true,"schema":{"type":"string"}},{"description":"Export format","in":"path","name":"format","required":true,"schema":{"enum":["markdown"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.ObjectExportResponse"}}},"description":"Object exported successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Export object","tags":["Objects"]}},"/spaces/{space_id}/properties":{"get":{"description":"This endpoint retrieves a paginated list of properties available within a specific space. Each property record includes its unique identifier, name and format. This information is essential for clients to understand the available properties for filtering or creating objects.","operationId":"listProperties","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Property"}}},"description":"List of properties"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List properties","tags":["Properties"]},"post":{"description":"Creates a new property in the specified space using a JSON payload. The creation process is subject to rate limiting. The payload must include property details such as the name and format. The endpoint then returns the full property data, ready for further interactions.","operationId":"createProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreatePropertyRequest"}}},"description":"Property to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The created property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}":{"delete":{"description":"This endpoint “deletes” a property by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the property’s details after it has been archived. Proper error handling is in place for situations such as when the property isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The deleted property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete property","tags":["Properties"]},"get":{"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).","operationId":"getProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The requested property"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get property","tags":["Properties"]},"patch":{"description":"This endpoint updates an existing property in the specified space using a JSON payload. The update process is subject to rate limiting. The payload must include the property ID and the name to be updated. The endpoint then returns the full property data, ready for further interactions.","operationId":"updateProperty","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdatePropertyRequest"}}},"description":"Property to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.PropertyResponse"}}},"description":"The updated property"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update property","tags":["Properties"]}},"/spaces/{space_id}/properties/{property_id}/tags":{"get":{"description":"This endpoint retrieves a paginated list of tags available for a specific property within a space. Each tag record includes its unique identifier, name, and color. This information is essential for clients to display select or multi-select options to users when they are creating or editing objects. The endpoint also supports pagination through offset and limit parameters.","operationId":"listTags","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Tag"}}},"description":"List of tags"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Property not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List tags","tags":["Tags"]},"post":{"description":"This endpoint creates a new tag for a given property id in a space. The creation process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to add new tag options to a property.","operationId":"createTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.CreateTagRequest"}}},"description":"Tag to create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The created tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Create tag","tags":["Tags"]}},"/spaces/{space_id}/properties/{property_id}/tags/{tag_id}":{"delete":{"description":"This endpoint “deletes” a tag by marking it as archived. The deletion process is performed safely and is subject to rate limiting. It returns the tag’s details after it has been archived. Proper error handling is in place for situations such as when the tag isn’t found or the deletion cannot be performed because of permission issues.","operationId":"deleteTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The deleted tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ForbiddenError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.RateLimitError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Delete tag","tags":["Tags"]},"get":{"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.","operationId":"getTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The requested tag"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get tag","tags":["Tags"]},"patch":{"description":"This endpoint updates a tag for a given property id in a space. The update process is subject to rate limiting. The tag is identified by its unique identifier within the specified space. The request must include the tag's name and color. The response includes the tag's details such as its ID, name, and color. This is useful for clients when users want to edit existing tags for a property.","operationId":"updateTag","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Property ID","in":"path","name":"property_id","required":true,"schema":{"type":"string"}},{"description":"Tag ID","in":"path","name":"tag_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.UpdateTagRequest"}}},"description":"Tag to update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TagResponse"}}},"description":"The updated tag"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ValidationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Update tag","tags":["Tags"]}},"/spaces/{space_id}/search":{"post":{"description":"This endpoint performs a focused search within a single space (specified by the space_id path parameter). Like the global search, it accepts pagination parameters and a JSON payload containing the search query, object types, and sorting preferences. The search is limited to the provided space and returns a list of objects that match the query. This allows clients to implement space‑specific filtering without having to process extraneous results.","operationId":"searchSpace","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search.SearchRequest"}}},"description":"Search parameters","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of objects"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Search objects within a space","tags":["Search"]}},"/spaces/{space_id}/types":{"get":{"description":"This endpoint retrieves a paginated list of object types (e.g. 'Page', 'Note', 'Task') available within the specified space. Each type’s record includes its unique identifier, type key, display name, icon, and a recommended layout. While a type's id is truly unique, a type's key can be the same across spaces for known types, e.g. 'ot-page' for 'Page'. Clients use this information when offering choices for object creation or for filtering objects by type through search.","operationId":"listTypes","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Type"}}},"description":"List of types"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List types","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}":{"get":{"description":"Fetches detailed information about one specific object type by its ID. This includes the type’s unique key, name, icon, and recommended 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).","operationId":"getType","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TypeResponse"}}},"description":"The requested type"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get type","tags":["Types"]}},"/spaces/{space_id}/types/{type_id}/templates":{"get":{"description":"This endpoint returns a paginated list of templates that are associated with a specific object type within a space. Templates provide pre‑configured structures for creating new objects. Each template record contains its identifier, name, and icon, so that clients can offer users a selection of templates when creating objects.","operationId":"listTemplates","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"The number of items to skip before starting to collect the result set","in":"query","name":"offset","schema":{"default":0,"type":"integer"}},{"description":"The number of items to return","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pagination.PaginatedResponse-object_Object"}}},"description":"List of templates"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"List templates","tags":["Templates"]}},"/spaces/{space_id}/types/{type_id}/templates/{template_id}":{"get":{"description":"Fetches full details for one template associated with a particular object type in a space. The response provides the template’s identifier, name, icon, and any other relevant metadata. This endpoint is useful when a client needs to preview or apply a template to prefill object creation fields.","operationId":"getTemplate","parameters":[{"description":"The version of the API to use","in":"header","name":"Anytype-Version","required":true,"schema":{"default":"2025-04-22","type":"string"}},{"description":"Space ID","in":"path","name":"space_id","required":true,"schema":{"type":"string"}},{"description":"Type ID","in":"path","name":"type_id","required":true,"schema":{"type":"string"}},{"description":"Template ID","in":"path","name":"template_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/object.TemplateResponse"}}},"description":"The requested template"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.UnauthorizedError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.NotFoundError"}}},"description":"Resource not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.GoneError"}}},"description":"Resource deleted"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/util.ServerError"}}},"description":"Internal server error"}},"security":[{"bearerauth":[]}],"summary":"Get template","tags":["Templates"]}}}, "openapi": "3.1.0", "servers": [ {"url":"http://localhost:31009/v1"} diff --git a/core/api/docs/swagger.yaml b/core/api/docs/swagger.yaml index 637ed7a72..8f2187ad1 100644 --- a/core/api/docs/swagger.yaml +++ b/core/api/docs/swagger.yaml @@ -548,32 +548,10 @@ components: tag: $ref: '#/components/schemas/object.Tag' type: object - object.Template: - description: The template - properties: - archived: - description: Whether the template is archived - example: false - type: boolean - icon: - $ref: '#/components/schemas/object.Icon' - id: - description: The id of the template - example: bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge - type: string - name: - description: The name of the template - example: My template - type: string - object: - description: The data model of the object - example: template - type: string - type: object object.TemplateResponse: properties: template: - $ref: '#/components/schemas/object.Template' + $ref: '#/components/schemas/object.ObjectWithBlocks' type: object object.Text: description: The text of the block, if applicable @@ -661,13 +639,11 @@ components: object.UpdateObjectRequest: properties: description: - description: The description of the object + description: The description to set for the object example: This is a description of the object. type: string - id: - description: The id of the object to update - example: bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ - type: string + icon: + $ref: '#/components/schemas/object.Icon' name: description: The name of the object example: My object @@ -678,37 +654,24 @@ components: example: '{"property_key"': ' "value"}' type: object - required: - - id type: object object.UpdatePropertyRequest: properties: - id: - description: The id of the property to update - example: bafyreids36kpw5ppuwm3ce2p4ezb3ab7cihhkq6yfbwzwpp4mln7rcgw7a - type: string name: - description: the name to set for the property + description: The name to set for the property example: Last modified date type: string required: - - id - name type: object object.UpdateTagRequest: properties: color: $ref: '#/components/schemas/object.Color' - id: - description: The id of the tag to update - example: bafyreiaixlnaefu3ci22zdenjhsdlyaeeoyjrsid5qhfeejzlccijbj7sq - type: string name: description: The name to set for the tag example: In progress type: string - required: - - id type: object pagination.PaginatedResponse-list_View: properties: @@ -754,17 +717,6 @@ components: pagination: $ref: '#/components/schemas/pagination.PaginationMeta' type: object - pagination.PaginatedResponse-object_Template: - properties: - data: - description: The list of items in the current result set - items: - $ref: '#/components/schemas/object.Template' - type: array - uniqueItems: false - pagination: - $ref: '#/components/schemas/pagination.PaginationMeta' - type: object pagination.PaginatedResponse-object_Type: properties: data: @@ -3176,7 +3128,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/pagination.PaginatedResponse-object_Template' + $ref: '#/components/schemas/pagination.PaginatedResponse-object_Object' description: List of templates "401": content: diff --git a/core/api/internal/object/handler.go b/core/api/internal/object/handler.go index ca824f38b..be08f2a04 100644 --- a/core/api/internal/object/handler.go +++ b/core/api/internal/object/handler.go @@ -794,7 +794,7 @@ func GetTypeHandler(s Service) gin.HandlerFunc { // @Param type_id path string true "Type ID" // @Param offset query int false "The number of items to skip before starting to collect the result set" default(0) // @Param limit query int false "The number of items to return" default(100) maximum(1000) -// @Success 200 {object} pagination.PaginatedResponse[Template] "List of templates" +// @Success 200 {object} pagination.PaginatedResponse[Object] "List of templates" // @Failure 401 {object} util.UnauthorizedError "Unauthorized" // @Failure 500 {object} util.ServerError "Internal server error" // @Security bearerauth @@ -848,7 +848,7 @@ func GetTemplateHandler(s Service) gin.HandlerFunc { typeId := c.Param("type_id") templateId := c.Param("template_id") - object, err := s.GetTemplate(c.Request.Context(), spaceId, typeId, templateId) + template, err := s.GetTemplate(c.Request.Context(), spaceId, typeId, templateId) code := util.MapErrorCode(err, util.ErrToCode(ErrTemplateNotFound, http.StatusNotFound), util.ErrToCode(ErrTemplateDeleted, http.StatusGone), @@ -861,6 +861,6 @@ func GetTemplateHandler(s Service) gin.HandlerFunc { return } - c.JSON(http.StatusOK, TemplateResponse{Template: object}) + c.JSON(http.StatusOK, TemplateResponse{Template: template}) } } diff --git a/core/api/internal/object/model.go b/core/api/internal/object/model.go index 2891308eb..ff6ab376c 100644 --- a/core/api/internal/object/model.go +++ b/core/api/internal/object/model.go @@ -49,10 +49,10 @@ type CreateObjectRequest struct { } type UpdateObjectRequest struct { - Id string `json:"id" binding:"required" example:"bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ"` // The id of the object to update - Name string `json:"name" example:"My object"` // The name of the object - Description string `json:"description" example:"This is a description of the object."` // The description of the object - Properties map[string]interface{} `json:"properties" example:"{\"property_key\": \"value\"}"` // The properties to update on the object + Name string `json:"name" example:"My object"` // The name of the object + Icon Icon `json:"icon"` // The icon to set for the object + Description string `json:"description" example:"This is a description of the object."` // The description to set for the object + Properties map[string]interface{} `json:"properties" example:"{\"property_key\": \"value\"}"` // The properties to update on the object } type ObjectResponse struct { @@ -134,7 +134,7 @@ type CreatePropertyRequest struct { } type UpdatePropertyRequest struct { - Name string `json:"name" binding:"required" example:"Last modified date"` // the name to set for the property + Name string `json:"name" binding:"required" example:"Last modified date"` // The name to set for the property } type Property struct { @@ -194,13 +194,5 @@ type Type struct { } type TemplateResponse struct { - Template Template `json:"template"` // The template -} - -type Template struct { - Object string `json:"object" example:"template"` // The data model of the object - Id string `json:"id" example:"bafyreictrp3obmnf6dwejy5o4p7bderaaia4bdg2psxbfzf44yya5uutge"` // The id of the template - Name string `json:"name" example:"My template"` // The name of the template - Icon Icon `json:"icon"` // The icon of the template - Archived bool `json:"archived" example:"false"` // Whether the template is archived + Template ObjectWithBlocks `json:"template"` // The template } diff --git a/core/api/internal/object/object.go b/core/api/internal/object/object.go index e13407fb1..fd401f1bd 100644 --- a/core/api/internal/object/object.go +++ b/core/api/internal/object/object.go @@ -119,31 +119,20 @@ func (s *service) GetObject(ctx context.Context, spaceId string, objectId string } } - // pre-fetch properties to fill the object propertyMap, err := s.GetPropertyMapFromStore(spaceId) if err != nil { return ObjectWithBlocks{}, err } + typeMap, err := s.GetTypeMapFromStore(spaceId, propertyMap) + if err != nil { + return ObjectWithBlocks{}, err + } tagMap, err := s.GetTagMapFromStore(spaceId) if err != nil { return ObjectWithBlocks{}, err } - object := ObjectWithBlocks{ - Object: "object", - Id: resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyId.String()].GetStringValue(), - Name: resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyName.String()].GetStringValue(), - Icon: GetIcon(s.gatewayUrl, resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyIconEmoji.String()].GetStringValue(), resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyIconImage.String()].GetStringValue(), resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyIconName.String()].GetStringValue(), resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyIconOption.String()].GetNumberValue()), - Archived: resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyIsArchived.String()].GetBoolValue(), - SpaceId: resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeySpaceId.String()].GetStringValue(), - Snippet: resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeySnippet.String()].GetStringValue(), - Layout: model.ObjectTypeLayout_name[int32(resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyResolvedLayout.String()].GetNumberValue())], - Type: s.GetTypeFromDetails(resp.ObjectView.Details, resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyType.String()].GetStringValue(), propertyMap), - Properties: s.getPropertiesFromStruct(resp.ObjectView.Details[0].Details, propertyMap, tagMap), - Blocks: s.getBlocksFromDetails(resp), - } - - return object, nil + return s.GetObjectWithBlocksFromStruct(resp.ObjectView.Details[0].Details, resp.ObjectView.Blocks, propertyMap, typeMap, tagMap), nil } // DeleteObject deletes an existing object in a specific space. @@ -350,10 +339,10 @@ func (s *service) buildObjectDetails(ctx context.Context, spaceId string, reques } // getBlocksFromDetails returns the list of blocks from the ObjectShowResponse. -func (s *service) getBlocksFromDetails(resp *pb.RpcObjectShowResponse) []Block { - blocks := []Block{} +func (s *service) getBlocksFromDetails(blocks []*model.Block) []Block { + b := make([]Block, 0, len(blocks)) - for _, block := range resp.ObjectView.Blocks { + for _, block := range blocks { var text *Text var file *File var property *Property @@ -390,7 +379,7 @@ func (s *service) getBlocksFromDetails(resp *pb.RpcObjectShowResponse) []Block { } // TODO: other content types? - blocks = append(blocks, Block{ + b = append(b, Block{ Object: "block", Id: block.Id, ChildrenIds: block.ChildrenIds, @@ -403,10 +392,10 @@ func (s *service) getBlocksFromDetails(resp *pb.RpcObjectShowResponse) []Block { }) } - return blocks + return b } -// GetObjectFromStruct creates an ObjectWithBlocks without blocks from the details. +// GetObjectFromStruct creates an Object without blocks from the details. func (s *service) GetObjectFromStruct(details *types.Struct, propertyMap map[string]Property, typeMap map[string]Type, tagMap map[string]Tag) Object { return Object{ Object: "object", @@ -422,6 +411,23 @@ func (s *service) GetObjectFromStruct(details *types.Struct, propertyMap map[str } } +// GetObjectWithBlocksFromStruct creates an ObjectWithBlocks from the details. +func (s *service) GetObjectWithBlocksFromStruct(details *types.Struct, blocks []*model.Block, propertyMap map[string]Property, typeMap map[string]Type, tagMap map[string]Tag) ObjectWithBlocks { + return ObjectWithBlocks{ + Object: "object", + Id: details.Fields[bundle.RelationKeyId.String()].GetStringValue(), + Name: details.Fields[bundle.RelationKeyName.String()].GetStringValue(), + Icon: GetIcon(s.gatewayUrl, details.Fields[bundle.RelationKeyIconEmoji.String()].GetStringValue(), details.Fields[bundle.RelationKeyIconImage.String()].GetStringValue(), details.Fields[bundle.RelationKeyIconName.String()].GetStringValue(), details.Fields[bundle.RelationKeyIconOption.String()].GetNumberValue()), + Archived: details.Fields[bundle.RelationKeyIsArchived.String()].GetBoolValue(), + SpaceId: details.Fields[bundle.RelationKeySpaceId.String()].GetStringValue(), + Snippet: details.Fields[bundle.RelationKeySnippet.String()].GetStringValue(), + Layout: model.ObjectTypeLayout_name[int32(details.Fields[bundle.RelationKeyResolvedLayout.String()].GetNumberValue())], + Type: s.getTypeFromStruct(details, typeMap), + Properties: s.getPropertiesFromStruct(details, propertyMap, tagMap), + Blocks: s.getBlocksFromDetails(blocks), + } +} + // isMissingObject returns true if val indicates a "_missing_object" placeholder. func (s *service) isMissingObject(val interface{}) bool { switch v := val.(type) { diff --git a/core/api/internal/object/service.go b/core/api/internal/object/service.go index a08915fd3..77e8ef952 100644 --- a/core/api/internal/object/service.go +++ b/core/api/internal/object/service.go @@ -6,7 +6,6 @@ import ( "github.com/gogo/protobuf/types" "github.com/anyproto/anytype-heart/core/api/apicore" - "github.com/anyproto/anytype-heart/pkg/lib/pb/model" ) type Service interface { @@ -31,15 +30,14 @@ type Service interface { ListTypes(ctx context.Context, spaceId string, offset int, limit int) ([]Type, int, bool, error) GetType(ctx context.Context, spaceId string, typeId string) (Type, error) - ListTemplates(ctx context.Context, spaceId string, typeId string, offset int, limit int) ([]Template, int, bool, error) - GetTemplate(ctx context.Context, spaceId string, typeId string, templateId string) (Template, error) + ListTemplates(ctx context.Context, spaceId string, typeId string, offset int, limit int) ([]Object, int, bool, error) + GetTemplate(ctx context.Context, spaceId string, typeId string, templateId string) (ObjectWithBlocks, error) GetObjectFromStruct(details *types.Struct, propertyMap map[string]Property, typeMap map[string]Type, tagMap map[string]Tag) Object GetPropertyMapFromStore(spaceId string) (map[string]Property, error) GetPropertyMapsFromStore(spaceIds []string) (map[string]map[string]Property, error) GetTypeMapFromStore(spaceId string, propertyMap map[string]Property) (map[string]Type, error) GetTypeMapsFromStore(spaceIds []string, propertyMap map[string]map[string]Property) (map[string]map[string]Type, error) - GetTypeFromDetails(details []*model.ObjectViewDetailsSet, typeId string, propertyMap map[string]Property) Type GetTagMapFromStore(spaceId string) (map[string]Tag, error) GetTagMapsFromStore(spaceIds []string) (map[string]map[string]Tag, error) } diff --git a/core/api/internal/object/type.go b/core/api/internal/object/type.go index 4c2fa0ee9..98268d170 100644 --- a/core/api/internal/object/type.go +++ b/core/api/internal/object/type.go @@ -130,7 +130,7 @@ func (s *service) GetType(ctx context.Context, spaceId string, typeId string) (T } // ListTemplates returns a paginated list of templates in a specific space. -func (s *service) ListTemplates(ctx context.Context, spaceId string, typeId string, offset int, limit int) (templates []Template, total int, hasMore bool, err error) { +func (s *service) ListTemplates(ctx context.Context, spaceId string, typeId string, offset int, limit int) (templates []Object, total int, hasMore bool, err error) { // First, determine the type ID of "ot-template" in the space templateTypeIdResp := s.mw.ObjectSearch(ctx, &pb.RpcObjectSearchRequest{ SpaceId: spaceId, @@ -168,7 +168,6 @@ func (s *service) ListTemplates(ctx context.Context, spaceId string, typeId stri Value: pbtypes.String(typeId), }, }, - Keys: []string{bundle.RelationKeyId.String(), bundle.RelationKeyTargetObjectType.String(), bundle.RelationKeyName.String(), bundle.RelationKeyIconEmoji.String(), bundle.RelationKeyIsArchived.String()}, }) if templateObjectsResp.Error.Code != pb.RpcObjectSearchResponseError_NULL { @@ -177,24 +176,30 @@ func (s *service) ListTemplates(ctx context.Context, spaceId string, typeId stri total = len(templateObjectsResp.Records) paginatedTemplates, hasMore := pagination.Paginate(templateObjectsResp.Records, offset, limit) - templates = make([]Template, 0, len(paginatedTemplates)) + templates = make([]Object, 0, len(paginatedTemplates)) + + propertyMap, err := s.GetPropertyMapFromStore(spaceId) + if err != nil { + return nil, 0, false, err + } + typeMap, err := s.GetTypeMapFromStore(spaceId, propertyMap) + if err != nil { + return nil, 0, false, err + } + tagMap, err := s.GetTagMapFromStore(spaceId) + if err != nil { + return nil, 0, false, err + } - // Finally, open each template and populate the response for _, record := range paginatedTemplates { - templates = append(templates, Template{ - Object: "template", - Id: record.Fields[bundle.RelationKeyId.String()].GetStringValue(), - Name: record.Fields[bundle.RelationKeyName.String()].GetStringValue(), - Icon: GetIcon(s.gatewayUrl, record.Fields[bundle.RelationKeyIconEmoji.String()].GetStringValue(), "", "", 0), - Archived: record.Fields[bundle.RelationKeyIsArchived.String()].GetBoolValue(), - }) + templates = append(templates, s.GetObjectFromStruct(record, propertyMap, typeMap, tagMap)) } return templates, total, hasMore, nil } // GetTemplate returns a single template by its ID in a specific space. -func (s *service) GetTemplate(ctx context.Context, spaceId string, _ string, templateId string) (Template, error) { +func (s *service) GetTemplate(ctx context.Context, spaceId string, _ string, templateId string) (ObjectWithBlocks, error) { resp := s.mw.ObjectShow(ctx, &pb.RpcObjectShowRequest{ SpaceId: spaceId, ObjectId: templateId, @@ -202,25 +207,32 @@ func (s *service) GetTemplate(ctx context.Context, spaceId string, _ string, tem if resp.Error != nil { if resp.Error.Code == pb.RpcObjectShowResponseError_NOT_FOUND { - return Template{}, ErrTemplateNotFound + return ObjectWithBlocks{}, ErrTemplateNotFound } if resp.Error.Code == pb.RpcObjectShowResponseError_OBJECT_DELETED { - return Template{}, ErrTemplateDeleted + return ObjectWithBlocks{}, ErrTemplateDeleted } if resp.Error.Code != pb.RpcObjectShowResponseError_NULL { - return Template{}, ErrFailedRetrieveTemplate + return ObjectWithBlocks{}, ErrFailedRetrieveTemplate } } - return Template{ - Object: "template", - Id: templateId, - Name: resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyName.String()].GetStringValue(), - Icon: GetIcon(s.gatewayUrl, resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyIconEmoji.String()].GetStringValue(), "", "", 0), - Archived: resp.ObjectView.Details[0].Details.Fields[bundle.RelationKeyIsArchived.String()].GetBoolValue(), - }, nil + propertyMap, err := s.GetPropertyMapFromStore(spaceId) + if err != nil { + return ObjectWithBlocks{}, err + } + typeMap, err := s.GetTypeMapFromStore(spaceId, propertyMap) + if err != nil { + return ObjectWithBlocks{}, err + } + tagMap, err := s.GetTagMapFromStore(spaceId) + if err != nil { + return ObjectWithBlocks{}, err + } + + return s.GetObjectWithBlocksFromStruct(resp.ObjectView.Details[0].Details, resp.ObjectView.Blocks, propertyMap, typeMap, tagMap), nil } // GetTypeMapsFromStore retrieves all types from all spaces. @@ -287,31 +299,6 @@ func (s *service) GetTypeMapFromStore(spaceId string, propertyMap map[string]Pro return typeMap, nil } -// GetTypeFromDetails retrieves the type from the details. -func (s *service) GetTypeFromDetails(details []*model.ObjectViewDetailsSet, typeId string, propertyMap map[string]Property) Type { - var objectTypeDetail *types.Struct - for _, detail := range details { - if detail.Id == typeId { - objectTypeDetail = detail.GetDetails() - break - } - } - - if objectTypeDetail == nil { - return Type{} - } - - return Type{ - Object: "type", - Id: typeId, - Key: objectTypeDetail.Fields[bundle.RelationKeyUniqueKey.String()].GetStringValue(), - Name: objectTypeDetail.Fields[bundle.RelationKeyName.String()].GetStringValue(), - Icon: GetIcon(s.gatewayUrl, objectTypeDetail.Fields[bundle.RelationKeyIconEmoji.String()].GetStringValue(), "", objectTypeDetail.Fields[bundle.RelationKeyIconName.String()].GetStringValue(), objectTypeDetail.Fields[bundle.RelationKeyIconOption.String()].GetNumberValue()), - Layout: model.ObjectTypeLayout_name[int32(objectTypeDetail.Fields[bundle.RelationKeyRecommendedLayout.String()].GetNumberValue())], - Properties: s.getRecommendedPropertiesFromLists(objectTypeDetail.Fields[bundle.RelationKeyRecommendedFeaturedRelations.String()].GetListValue(), objectTypeDetail.Fields[bundle.RelationKeyRecommendedRelations.String()].GetListValue(), propertyMap), - } -} - // getTypeFromStruct retrieves the type from the details. func (s *service) getTypeFromStruct(details *types.Struct, typeMap map[string]Type) Type { return typeMap[details.Fields[bundle.RelationKeyType.String()].GetStringValue()]