> From *AT Protocol Spaces: A Field Guide* on atproto.how, revised 2026-11-23.
> Web page: https://atproto.how/atproto-spaces-field-guide/3-addressing
> Index for agents: https://atproto.how/llms.txt · Text CC BY-SA 4.0, code samples MIT.

# Chapter 3 · Spaces and addressing

Spaces introduce a new way to reference both spaces and the records they contain. Spaces only exist in the context of a space owner, referred to as the space authority, a modality, referred to as the space type, and an instance of that modality in the context of the authority, referred to as the space key. These three pieces of information are how you can refer to the data boundary that is a space.

Public atproto records also contain three pieces of information including the record authority, collection, and record key. Combined, a fully qualified AT-URI for a space record includes these six pieces of information that can tell you what you need to access record data. One small but important piece of information is that an AT-URI for a space or a space record begins with "at:space/", where a public AT-URI begins with "at://", to assist with disambiguation.

> **If you’re building an app**
>
> Your app will build and parse AT-URIs constantly, for public records and for space records, so get used to both forms. A space record’s URI starts with the space authority rather than the author, so code that pulls "the DID" out of an AT-URI has to know which kind it holds. The short function in this chapter handles that.
>
> Where a URI came from decides how much work it deserves. One that arrives from outside, in a record your app has just ingested, is worth checking more thoroughly: validate its syntax, resolve the space authority and the author, and look up the lexicons for the space type and the collection, caching what you find. One that your app reads back from its own database has usually been through those checks already and needs less.
>
> You’ll also choose a space type and a space key. The type is a public lexicon that names your kind of space, lists the collections it expects, and gives the title users see when they sign in. The key tells one space apart from another of the same type.

<a id="the-uri"></a>

## 3.1 The URI

> *In the family space.* Nora answers the reunion invitation in the family app, and her PDS keeps the RSVP in her space repo. The record is hers, and the space it belongs to is Marcus’s. Its address has to name both.

Space references and space record references take the form of an AT-URI that contains the space literal, authority, type, and key, followed, in a record reference, by the record authority, collection, and key. These values have an "at:space/" prefix and use "/" characters for separators.

<a id="code-3-1"></a>

```text
at:space/[space-authority]/[space-type]/[space-key]/[record-authority]/[record-collection]/[record-key]
```

**Reference: The URI of Nora’s RSVP in the family space**

```text
at:space/did:plc:ejjl2znzqp3ci25dqaslpkk2/com.example.familyUpdates/our-family/did:plc:ashwgt3d5ntfxmlcfyizpu2g/community.lexicon.calendar.rsvp/3n2gtdo55s22p
```

| # | Segment | In Nora’s RSVP | Meaning |
| --- | --- | --- | --- |
| 1 | Space literal | `space` | Fixed marker for a space URI |
| 2 | Space authority | `did:plc:ejjl2znzqp3ci25dqaslpkk2` | Marcus’s identity |
| 3 | Space type | `com.example.familyUpdates` | What kind of space it is |
| 4 | Space key | `our-family` | Which space of that type |
| 5 | Record authority | `did:plc:ashwgt3d5ntfxmlcfyizpu2g` | Nora, who wrote the record |
| 6 | Record collection | [`community.lexicon.calendar.rsvp`](https://lexicon.garden/nsid/community.lexicon.calendar.rsvp) | What kind of record it is |
| 7 | Record key | `3n2gtdo55s22p` | Which record of that kind |

The literal `space` comes directly after the `at:` scheme, where a public URI has `//`, so a parser tells the two forms apart from the prefix alone \[spec\]. Truncating after the space key gives a **space reference**, which lexicons type with the `space-ref` string format \[spec\].

<a id="code-3-2"></a>

```javascript
function uriKind(uri) {
  if (uri.startsWith("at:space/")) {
    const parts = uri.slice("at:space/".length).split("/")
    if (parts.length === 3) return "space reference"
    if (parts.length === 6) return "space record"
    return "other"
  }
  if (uri.startsWith("at://")) {
    const parts = uri.slice("at://".length).split("/")
    if (parts.length === 3) return "public record"
  }
  return "other"
}
```

In a public URI the first DID is the author. In a space URI the first DID is the authority, and the author is the second DID.

Take a URI apart below, then look up the space it names. The console replays a recorded response, so no real space is called.

<a id="take-a-uri-apart"></a>

**Try it 3.1** · Take a URI apart. This example is interactive on the web: https://atproto.how/atproto-spaces-field-guide/3-addressing#take-a-uri-apart

Responses name spaces by reference in a field called `space`.

**Reference: Looking up the family space**

The family app calls `getSpace` on Marcus’s PDS with his session.

<a id="try-get-space"></a>

**Try it 3.2** · Look up a space. This example is interactive on the web: https://atproto.how/atproto-spaces-field-guide/3-addressing#try-get-space

Request:

```http
GET /xrpc/com.atproto.space.getSpace
  ?space=at:space/did:plc:ejjl2znzqp3ci25dqaslpkk2/com.example.familyUpdates/our-family
Host: pds-a.example.com
Authorization: DPoP <access token>
DPoP: <proof JWT>
```

Headers:

- `Authorization`: The session’s access token, bound to a key only the client holds. [Appendix G, OAuth requests](https://atproto.how/atproto-spaces-field-guide/g-worked-values.md#oauth-requests)
- `DPoP`: A proof signed with that key for this method and URL, so a copied token can’t be replayed. [Appendix G, OAuth requests](https://atproto.how/atproto-spaces-field-guide/g-worked-values.md#oauth-requests)

Sample response:

```json
{
  "space": "at:space/did:plc:ejjl2znzqp3ci25dqaslpkk2/com.example.familyUpdates/our-family",
  "policy": {
    "$type": "com.atproto.memberspace.policy",
    "publicRead": false,
    "publicWrite": false,
    "publishPolicy": true,
    "publishMembers": true
  }
}
```

<a id="the-authority"></a>

## 3.2 The authority

> *In the family space.* Marcus created the space under his own identity, the one he already had. It was the quick choice. It also means the family’s space goes wherever his account goes, and if he deletes that account, the space is deleted with it.

The authority is the root of trust for the space. It may be a user’s own identity, as for bookmarks or drafts, or a dedicated identity for a shared space, which lets the space pass between people without depending on any one of them \[spec\]. The authority always reads and writes its own spaces, under every policy, without appearing on any member list \[spec\].

The authority comes first after the literal because it is the root, and every part after it is scoped by the parts before it. Marcus is the authority. Under his identity is a kind of space, named by the space type, and under that type the space key picks out one space. The record’s parts continue the pattern, with an author in that space, a collection of that author’s, and a record key in that collection.

<a id="the-space-type"></a>

## 3.3 The space type

> *In the family space.* When Elena signs in to the family app, her PDS asks her to approve access to "Family updates". That name comes from the space type. If the type later gains a new kind of record, the app can write it for Elena without asking her to sign in again.

The type is an NSID naming the modality. It resolves to a **space type declaration**, a lexicon whose `main` definition has `"type": "space"`:

**Reference: The family space’s type declaration**

Marcus’s identity publishes it as the record `at://did:plc:ejjl2znzqp3ci25dqaslpkk2/com.atproto.lexicon.schema/com.example.familyUpdates`, and the DNS record `_lexicon.example.com` names that identity.

```json
{
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "id": "com.example.familyUpdates",
  "defs": {
    "main": {
      "type": "space",
      "description": "A family's private space for updates, photos, and events",
      "key": "any",
      "title": "Family updates",
      "title:lang": {
        "es": "Novedades familiares"
      },
      "collections": [
        "com.example.familyUpdates.post",
        "community.lexicon.calendar.event",
        "community.lexicon.calendar.rsvp",
        "community.lexicon.bookmarks.bookmark",
        "com.atproto.label.record"
      ]
    }
  }
}
```

**Reference: Fields of a space type declaration** \[spec\]

| Field | Required | Meaning |
| --- | --- | --- |
| `type` | yes | `"space"`, on the `main` definition |
| `description` | no | For developers; not shown to users |
| `key` | yes | Recommended space key type, like a record key type |
| `title` | no | Short name shown on consent screens |
| `title:lang` | no | Localized titles by language code |
| `collections` | yes | Collections clients should expect; no wildcard |

A space type declaration is a public lexicon, published like any other: a [`com.atproto.lexicon.schema`](https://lexicon.garden/nsid/com.atproto.lexicon.schema) record in the repo of the identity that controls the NSID’s authority, found through its `_lexicon` DNS record. Anyone can resolve it. A PDS has to, because it shows the `title` on the consent screen and reads the `collections` when it checks a bare scope \[spec\].

A space’s records are permissioned, but its type is always public; there is no private space type declaration. The reason is the way lexicon resolution works today. The `_lexicon` DNS record says which repository holds the schemas, and it has no way to carry a space’s authority, type, and key as well. Resolution ends at a public repo, so the declaration has to be published there. The side effect is that the kinds of records a space of that type is expected to hold are public. Someone who also knows who is in a space can start to piece together what it contains.

A lexicon author can add a record type to a space type later, and existing sessions pick it up without the user consenting again. That works because the declaration’s `collections` are the default write set for a bare `space:` scope ([Chapter 9](https://atproto.how/atproto-spaces-field-guide/9-oauth-and-consent.md)), and the default is read from the declaration each time a grant is checked \[spec\]. An app that wants a fixed write set lists the collections in its scope. The list may name NSIDs from any namespace. A space may still hold records of any collection. The type also tells a reader what kind of data to expect before any network call, and its `title` is what users see on the OAuth consent screen, with the NSID shown when there is no title \[spec\].

<a id="the-space-key"></a>

## 3.4 The space key

The space key, written `skey` in the spec and the lexicons, distinguishes spaces of the same type under one authority. It follows record-key syntax, up to 512 bytes \[spec\]. The declaration’s `key` field recommends a key style the way a record schema does: `self` for a singleton like a user’s bookmarks, a slug like `our-family`, a TID for spaces created on demand, or a cryptographic identifier.

**Reference: Space key syntax**

A space key is 1 to 512 bytes, drawn from `A-Z`, `a-z`, `0-9`, and `. _ : ~ -`, and it is never `.` or `..` \[spec\]. `atproto-space` checks this when it builds a `SpaceKey` \[crates\].

<a id="spaces-used-together"></a>

## 3.5 Spaces used together

An application often treats several spaces under one space authority as one whole. This guide calls that set a **hyperspace**. A hyperspace has a **primary space**, which holds the main content or community and which the other spaces are organized around. A hyperspace can hold a single space, with the other positions unfilled.

Two or more spaces are in **syzygy** (pronounced "SIZ-ih-jee") when they share the same space authority and the same space key but have different space types, as `at:space/{spaceDid}/{typeA}/foo` and `at:space/{spaceDid}/{typeB}/foo` do. Each is the other’s **syzygy space**. The standard example is a community space and its moderation space.

An **inner space** sits beneath another space in the same hyperspace, such as a subgroup focused on specific content for members of the space above it. It has the same space authority and its own space key, and it can have a syzygy of its own.

That gives a hyperspace two directions. Along the **type dimension** the key stays and the type changes, which is where syzygy lives. Along the **key dimension** the key changes, which is where inner spaces live.

These are conventions an application adopts. Every space in a hyperspace is a full space with its own policy and member list, and the application arranges how they relate.

<a id="common-shapes"></a>

## 3.6 Common shapes

<a id="table-3-1"></a>

**Table 3.1.** Common space shapes

| Use | Authority | Type | Space key |
| --- | --- | --- | --- |
| Bookmarks | the user | `com.example.bookmarks` | `self` |
| A family’s updates | a family member | `com.example.familyUpdates` | `our-family` |
| A shared photo album | the creator | `com.example.album` | a TID |
| A community and its moderation space | the community’s identity | one type for each space | the same key for both |
| A subgroup inside a community | the community’s identity | the community’s type or one of its own | a key of its own |

<a id="common-questions"></a>

## 3.7 Common questions

**How can I tell a space record’s URI from a public one?**

Look at the prefix. A space URI begins with `at:space/`, and a public URI begins with `at://`. The short function earlier in this chapter does exactly that.

**Can I create my own space type?**

Yes. A space type is a lexicon, so anyone who controls an NSID’s domain can publish one. Publish it like any other lexicon, give it a `title` people will recognize on the consent screen, and list the collections your app writes.

**Can a space hold records outside its type’s collections?**

Yes. The `collections` list sets which collections a bare `space:` scope lets an app write by default. A space can still hold any record type, so an app with a broader scope can write other kinds of records into it.
