# net.nusno.gyoka.document.updateDocument

> Update the stored document body and URL for a Gyoka document type.

- Kind: procedure
- Authority: document.gyoka.nusno.net
- Lexicon: 1
- Published by [nusno.net](https://lexicon.garden/identity/did:plc:gjkxkrudpqumaiiytxodmpaj), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.document.updateDocument)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.document.updateDocument/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.document.updateDocument/analytics)

## Procedure (`net.nusno.gyoka.document.updateDocument`)

Type: procedure · POST

### Input (application/json)

- `content` (string): Optional inline content for the document.
  - Constraints: maxLength: 32768, nullable
- `docType` (string, required): Document type to update.
  - Constraints: knownValues: tos | privacy_policy
- `url` (string · uri): Optional source URL for the document.
  - Constraints: maxLength: 2048, nullable

### Output (application/json)

- `content` (string, required)
  - Constraints: maxLength: 32768, nullable
- `docType` (string, required)
  - Constraints: knownValues: tos | privacy_policy
- `url` (string · uri, required)
  - Constraints: maxLength: 2048, nullable

### Errors

- `AuthenticationRequired`: Returned when service authentication is required and the caller is not authenticated.
- `Forbidden`: Returned when the authenticated caller is not in the admin allowlist.
- `BadRequest`: Returned when the request payload is invalid.
- `InternalServerError`: Returned when the document cannot be updated.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Update the stored document body and URL for a Gyoka document type.",
      "errors": [
        {
          "description": "Returned when service authentication is required and the caller is not authenticated.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "Returned when the authenticated caller is not in the admin allowlist.",
          "name": "Forbidden"
        },
        {
          "description": "Returned when the request payload is invalid.",
          "name": "BadRequest"
        },
        {
          "description": "Returned when the document cannot be updated.",
          "name": "InternalServerError"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "nullable": [
            "url",
            "content"
          ],
          "properties": {
            "content": {
              "description": "Optional inline content for the document.",
              "maxLength": 32768,
              "type": "string"
            },
            "docType": {
              "description": "Document type to update.",
              "knownValues": [
                "tos",
                "privacy_policy"
              ],
              "type": "string"
            },
            "url": {
              "description": "Optional source URL for the document.",
              "format": "uri",
              "maxLength": 2048,
              "type": "string"
            }
          },
          "required": [
            "docType"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "nullable": [
            "url",
            "content"
          ],
          "properties": {
            "content": {
              "maxLength": 32768,
              "type": "string"
            },
            "docType": {
              "knownValues": [
                "tos",
                "privacy_policy"
              ],
              "type": "string"
            },
            "url": {
              "format": "uri",
              "maxLength": 2048,
              "type": "string"
            }
          },
          "required": [
            "docType",
            "url",
            "content"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "net.nusno.gyoka.document.updateDocument",
  "lexicon": 1
}
```
