# dev.knotless.putDelegation

> 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.

- Kind: procedure
- Authority: knotless.dev
- Lexicon: 1
- Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.putDelegation)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.putDelegation/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.putDelegation/analytics)

## Procedure (`dev.knotless.putDelegation`)

Type: procedure · POST

### Output (application/json)

- `state` (string, required): Names the delegation to dev.knotless.getDelegation.
  - Constraints: maxLength: 64
- `url` (string · uri, required): The authorization page for the caller to open.

## 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
}
```
