# link.jetbridge.approve

> Approve a Client, replacing any approval it has.

- Kind: procedure
- Authority: jetbridge.link
- Lexicon: 1
- Published by [jetbridge.link](https://lexicon.garden/identity/did:web:jetbridge.link), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:web:jetbridge.link/link.jetbridge.approve)
- [Schema JSON](https://lexicon.garden/lexicon/did:web:jetbridge.link/link.jetbridge.approve/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:web:jetbridge.link/link.jetbridge.approve/analytics)

## Procedure (`link.jetbridge.approve`)

Type: procedure · POST

### Input (application/json)

- `client` (string · did, required): The Client to approve.
- `expiresAt` (string · datetime): When the approval ends. Left out for no end.
- `maxHostnames` (integer): Most hostnames the Client may serve at once. Left out to keep the Provider's default.
  - Constraints: minimum: 1
- `trafficCap` (array): Caps that replace all of the Provider's default caps for the Client. Empty means no cap. Left out to keep the defaults.
  - Constraints: maxLength: 14
  - `items` (ref)
    - Reference: `link.jetbridge.provider#trafficCap`

### Output (application/json)

- `uri` (string · at-uri, required): The approval record.

### Errors

- `OperatorNotSet`: The Provider has no operator.
- `NotOperator`: The caller is not the Provider's operator.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Approve a Client, replacing any approval it has.",
      "errors": [
        {
          "description": "The Provider has no operator.",
          "name": "OperatorNotSet"
        },
        {
          "description": "The caller is not the Provider's operator.",
          "name": "NotOperator"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "client": {
              "description": "The Client to approve.",
              "format": "did",
              "type": "string"
            },
            "expiresAt": {
              "description": "When the approval ends. Left out for no end.",
              "format": "datetime",
              "type": "string"
            },
            "maxHostnames": {
              "description": "Most hostnames the Client may serve at once. Left out to keep the Provider's default.",
              "minimum": 1,
              "type": "integer"
            },
            "trafficCap": {
              "description": "Caps that replace all of the Provider's default caps for the Client. Empty means no cap. Left out to keep the defaults.",
              "items": {
                "ref": "link.jetbridge.provider#trafficCap",
                "type": "ref"
              },
              "maxLength": 14,
              "type": "array"
            }
          },
          "required": [
            "client"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "uri": {
              "description": "The approval record.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "link.jetbridge.approve",
  "lexicon": 1
}
```
