# lol.dids.manage.validate

> Published by [ngerakines.me](https://lexicon.garden/identity/did:plc:cbkjy5n7bk3ax2wplmtjofq2)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:cbkjy5n7bk3ax2wplmtjofq2/lol.dids.manage.validate)
- [Documentation](https://lexicon.garden/lexicon/did:plc:cbkjy5n7bk3ax2wplmtjofq2/lol.dids.manage.validate/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:cbkjy5n7bk3ax2wplmtjofq2/lol.dids.manage.validate/examples)

## Definitions

### `lol.dids.manage.validate`

**Type**: `procedure`

Validate a site or tile record before writing it, and — for an authorized caller — prepare bard for it. Returns the AT-URI the record will have, the CID it will have, and the canonical record to submit with putRecord at that key.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rkey` | `string` | No | Required for a site (the hostname). For a tile: an existing rkey for a new version, a TID the client holds, or absent to have bard mint one. |
| `space` | `string` (at-uri) | No | Validate as a record in this space; the caller must be its authority. |
| `dryRun` | `boolean` | No | Validate only; never prepare. |
| `record` | `unknown` | Yes | A lol.dids.sites.site or lol.dids.sites.tile record, with $type. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No |  |
| `uri` | `string` (at-uri) | No |  |
| `state` | `ref` → `lol.dids.defs#indexState` | No |  |
| `valid` | `boolean` | Yes |  |
| `errors` | `array` | Yes |  |
| `reason` | `string` | No |  |
| `record` | `unknown` | No | The record as bard will serialize it; submit it verbatim. |
| `prepared` | `boolean` | Yes |  |
| `expiresAt` | `string` (datetime) | No |  |
| `entryCount` | `integer` | No |  |
| `totalBytes` | `integer` | No |  |
| `missingBlobs` | `array` | Yes |  |
| `parameterErrors` | `array` | Yes |  |

#### Errors

- **InvalidRecordKey**: A site validation without rkey, or an rkey that is not a canonical hostname / valid TID.
- **TileNotReady**: The bound tile is known only as pending-publication and cannot be bound yet.
- **SpaceNotFound**: Bard is not connected to that space.
- **NotSpaceAuthority**: Only the space's authority may publish in it.
- **RateLimitExceeded**: Too many preparations this hour.

## Raw Schema

```json
{
  "id": "lol.dids.manage.validate",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "record"
          ],
          "properties": {
            "rkey": {
              "type": "string",
              "description": "Required for a site (the hostname). For a tile: an existing rkey for a new version, a TID the client holds, or absent to have bard mint one."
            },
            "space": {
              "type": "string",
              "format": "at-uri",
              "description": "Validate as a record in this space; the caller must be its authority."
            },
            "dryRun": {
              "type": "boolean",
              "description": "Validate only; never prepare."
            },
            "record": {
              "type": "unknown",
              "description": "A lol.dids.sites.site or lol.dids.sites.tile record, with $type."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "InvalidRecordKey",
          "description": "A site validation without rkey, or an rkey that is not a canonical hostname / valid TID."
        },
        {
          "name": "TileNotReady",
          "description": "The bound tile is known only as pending-publication and cannot be bound yet."
        },
        {
          "name": "SpaceNotFound",
          "description": "Bard is not connected to that space."
        },
        {
          "name": "NotSpaceAuthority",
          "description": "Only the space's authority may publish in it."
        },
        {
          "name": "RateLimitExceeded",
          "description": "Too many preparations this hour."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "valid",
            "errors",
            "parameterErrors",
            "prepared",
            "missingBlobs"
          ],
          "properties": {
            "cid": {
              "type": "string",
              "format": "cid"
            },
            "uri": {
              "type": "string",
              "format": "at-uri"
            },
            "state": {
              "ref": "lol.dids.defs#indexState",
              "type": "ref"
            },
            "valid": {
              "type": "boolean"
            },
            "errors": {
              "type": "array",
              "items": {
                "ref": "lol.dids.defs#validationError",
                "type": "ref"
              }
            },
            "reason": {
              "type": "string",
              "knownValues": [
                "DomainNotVerified",
                "TileAuthorNotPermitted",
                "PreparedQuotaExceeded",
                "SpacePreparationUnsupported",
                "DryRun"
              ]
            },
            "record": {
              "type": "unknown",
              "description": "The record as bard will serialize it; submit it verbatim."
            },
            "prepared": {
              "type": "boolean"
            },
            "expiresAt": {
              "type": "string",
              "format": "datetime"
            },
            "entryCount": {
              "type": "integer"
            },
            "totalBytes": {
              "type": "integer"
            },
            "missingBlobs": {
              "type": "array",
              "items": {
                "ref": "lol.dids.defs#missingBlob",
                "type": "ref"
              }
            },
            "parameterErrors": {
              "type": "array",
              "items": {
                "ref": "lol.dids.defs#validationError",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Validate a site or tile record before writing it, and — for an authorized caller — prepare bard for it. Returns the AT-URI the record will have, the CID it will have, and the canonical record to submit with putRecord at that key."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
