garden.lexicon.service

lexicon.garden

Documentation

Declares XRPC methods and URL templates available on a DID document service. Use this to document what services your identity provides.

main record
4 examples

The primary record type for declaring a service. The rkey should be the service fragment ID without the # prefix (e.g., 'atproto_pds' for '#atproto_pds').

Record Key any Any valid record key

Properties

description string Optional

A human-readable description of what this service provides and its purpose.

maxLength: 1000 bytes
methods array of ref #method Optional

An array of XRPC methods that this service supports. Each method references a lexicon schema defining the method's interface.

serviceType string Required

The type identifier for this service (e.g., 'AtprotoPersonalDataServer', 'AtprotoLabeler'). This should match the type used in the DID document.

maxLength: 100 bytes
urlTemplates array of ref #urlTemplate Optional

URL templates for constructing web URLs from AT-URIs or record data. Useful for linking to web views of records stored in this service.

View raw schema
{
  "key": "any",
  "type": "record",
  "record": {
    "type": "object",
    "required": [
      "serviceType"
    ],
    "properties": {
      "methods": {
        "type": "array",
        "items": {
          "ref": "#method",
          "type": "ref"
        },
        "description": "Methods available on this service."
      },
      "description": {
        "type": "string",
        "maxLength": 1000,
        "description": "Description of what this service provides."
      },
      "serviceType": {
        "type": "string",
        "maxLength": 100,
        "description": "The type of service being declared."
      },
      "urlTemplates": {
        "type": "array",
        "items": {
          "ref": "#urlTemplate",
          "type": "ref"
        },
        "description": "URL templates for constructing web URLs from AT-URIs or record data. Useful for linking to web views of records."
      }
    }
  },
  "description": "Declares XRPC methods available on a DID document service. The rkey is the service fragment ID without the # prefix (e.g., 'atproto_pds' for '#atproto_pds')."
}
method object

A declaration of an XRPC method available on this service.

Properties

authMethods array of string Optional

Authentication methods supported by this method. Known values include 'none', 'atproto.admin', 'atproto.bearer', 'atproto.oauth', and 'atproto.inter-service'.

deprecated boolean Optional

Whether this method is deprecated and should no longer be used. Clients should avoid calling deprecated methods.

lexicon string at-uri Required

An AT-URI pointing to the lexicon schema that defines this method's interface (input, output, and errors).

View raw schema
{
  "type": "object",
  "required": [
    "lexicon"
  ],
  "properties": {
    "lexicon": {
      "type": "string",
      "format": "at-uri",
      "description": "AT-URI pointing to a lexicon schema that defines this method."
    },
    "deprecated": {
      "type": "boolean",
      "description": "Whether this method is deprecated and should no longer be used."
    },
    "authMethods": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 50,
        "knownValues": [
          "none",
          "atproto.admin",
          "atproto.bearer",
          "atproto.oauth",
          "atproto.inter-service"
        ]
      },
      "description": "Authentication methods supported by this method."
    }
  }
}
urlTemplate object

A URL template for constructing web links to records or resources served by this service.

Properties

collections array of stringnsid Optional

NSIDs of record collections that this URL template applies to. When a record from one of these collections is viewed, this template can be used to construct a web link.

description string Optional

A human-readable description of what this URL template is for and when it should be used.

maxLength: 1000 bytes
url string Required

A URI template with placeholders for record data. Placeholders follow RFC 6570 syntax (e.g., '{did}', '{rkey}').

maxLength: 2000 bytes
View raw schema
{
  "type": "object",
  "required": [
    "url"
  ],
  "properties": {
    "url": {
      "type": "string",
      "maxLength": 2000,
      "description": "URI template with placeholders for record data"
    },
    "collections": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "nsid"
      },
      "description": "NSIDs of collections this URL template applies to."
    },
    "description": {
      "type": "string",
      "maxLength": 1000,
      "description": "Description of what this URL template is for."
    }
  }
}

Lexicon Garden

@