# ai.newnal.illi.home.setCustodyKey

> Publish the root admin's X25519 custody public key on their member record; the private key stays in the root admin's Private Sphere.

- Kind: procedure
- Authority: home.illi.newnal.ai
- Lexicon: 1
- Published by [illi-service.newnal.id](https://lexicon.garden/identity/did:plc:uztm7bi2ce42dez3uu3qafro), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.home.setCustodyKey)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.home.setCustodyKey/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.home.setCustodyKey/analytics)

## Procedure (`ai.newnal.illi.home.setCustodyKey`)

Type: procedure · POST

### Input (application/json)

- `homeId` (string · tid, required)
- `keyId` (string, required)
  - Constraints: maxLength: 64
- `publicKey` (string, required): base64url X25519 public key

### Output (application/json)

- `keyId` (string, required)
- `uri` (string · at-uri, required)

### Errors

- `NotRootAdmin`: No description in schema.
- `HomeNotFound`: No description in schema.
- `PdsUnavailable`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Publish the root admin's X25519 custody public key on their member record; the private key stays in the root admin's Private Sphere.",
      "errors": [
        {
          "name": "NotRootAdmin"
        },
        {
          "name": "HomeNotFound"
        },
        {
          "name": "PdsUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "homeId": {
              "format": "tid",
              "type": "string"
            },
            "keyId": {
              "maxLength": 64,
              "type": "string"
            },
            "publicKey": {
              "description": "base64url X25519 public key",
              "type": "string"
            }
          },
          "required": [
            "homeId",
            "keyId",
            "publicKey"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "keyId": {
              "type": "string"
            },
            "uri": {
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri",
            "keyId"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.home.setCustodyKey",
  "lexicon": 1
}
```
