# ai.newnal.pdn.server.createAppPassword

> Create an App Password bound to an OAuth scope. Sessions created from it through com.atproto.server.createSession carry exactly the permissions of that scope, as an OAuth session would. Requires a full-access session.

- Kind: procedure
- Authority: server.pdn.newnal.ai
- Lexicon: 1
- Published by [newnal-platform.newnal.id](https://lexicon.garden/identity/did:plc:vciktevzoffubdvdaajz2yp3), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAppPassword)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAppPassword/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAppPassword/analytics)

## Procedure (`ai.newnal.pdn.server.createAppPassword`)

Type: procedure · POST

### Input (application/json)

- `name` (string, required): A short name for the App Password, to help distinguish them.
- `privileged` (boolean): If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients.
- `scope` (string, required): OAuth scope string (space separated; must include 'atproto'; may use include:<permission-set>).

### Output (application/json)

- `schema` (ref)
  - Reference: `#appPassword`

### Errors

- `AccountTakedown`: No description in schema.
- `InvalidScope`: No description in schema.

## #appPassword (`ai.newnal.pdn.server.createAppPassword#appPassword`)

Type: object

### Properties

- `createdAt` (string · datetime, required)
- `name` (string, required)
- `password` (string, required)
- `privileged` (boolean)
- `scope` (string, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "appPassword": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "privileged": {
          "type": "boolean"
        },
        "scope": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "password",
        "createdAt",
        "scope"
      ],
      "type": "object"
    },
    "main": {
      "description": "Create an App Password bound to an OAuth scope. Sessions created from it through com.atproto.server.createSession carry exactly the permissions of that scope, as an OAuth session would. Requires a full-access session.",
      "errors": [
        {
          "name": "AccountTakedown"
        },
        {
          "name": "InvalidScope"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "name": {
              "description": "A short name for the App Password, to help distinguish them.",
              "type": "string"
            },
            "privileged": {
              "description": "If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients.",
              "type": "boolean"
            },
            "scope": {
              "description": "OAuth scope string (space separated; must include 'atproto'; may use include:<permission-set>).",
              "type": "string"
            }
          },
          "required": [
            "name",
            "scope"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "#appPassword",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.pdn.server.createAppPassword",
  "lexicon": 1
}
```
