# dev.knotless.putDelegation

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.putDelegation)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.putDelegation/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.putDelegation/examples)

## Definitions

### `dev.knotless.putDelegation`

**Type**: `procedure`

Starts delegating the caller's writes to a gateway. The gateway, an OAuth client of the caller's PDS, pushes an authorization request for the caller and answers with the page where the caller approves it; once they do, the gateway keeps the session, replacing any it held, to write on the caller's behalf for collaborators and batched commits. Requires a service token from the caller's PDS, audience the gateway's DID, for this method.

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `state` | `string` | Yes | Names the delegation to dev.knotless.getDelegation. |
| `url` | `string` (uri) | Yes | The authorization page for the caller to open. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Starts delegating the caller's writes to a gateway. The gateway, an OAuth client of the caller's PDS, pushes an authorization request for the caller and answers with the page where the caller approves it; once they do, the gateway keeps the session, replacing any it held, to write on the caller's behalf for collaborators and batched commits. Requires a service token from the caller's PDS, audience the gateway's DID, for this method.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "state": {
              "description": "Names the delegation to dev.knotless.getDelegation.",
              "maxLength": 64,
              "type": "string"
            },
            "url": {
              "description": "The authorization page for the caller to open.",
              "format": "uri",
              "type": "string"
            }
          },
          "required": [
            "url",
            "state"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "dev.knotless.putDelegation",
  "lexicon": 1
}
```
