# ai.newnal.pdn.server.createAttestedAccount

> Create an account on behalf of a client attested by a trusted issuer. Authenticated with a service-auth JWT (iss = trusted issuer DID, aud = this PDN, lxm = this method, exp - iat <= 60 s, unique jti). No invite code, no captcha. Without handle the server generates a memorable one; without email the server stores the placeholder <label>@newnal.id. Returns a full session, like createAccount; clients that need a scoped session create a scoped app password with it.

- 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.createAttestedAccount)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAttestedAccount/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAttestedAccount/analytics)

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

Type: procedure · POST

### Input (application/json)

- `email` (string)
- `handle` (string · handle)
- `password` (string, required)
- `recoveryKey` (string): DID PLC rotation key to include in the creation operation.

### Output (application/json)

- `accessJwt` (string, required)
- `did` (string · did, required)
- `didDoc` (unknown)
- `email` (string, required)
- `emailPlaceholder` (boolean, required)
- `handle` (string · handle, required)
- `refreshJwt` (string, required)

### Errors

- `InvalidAttestation`: No description in schema.
- `UntrustedIssuer`: No description in schema.
- `AttestationReplayed`: No description in schema.
- `InvalidHandle`: No description in schema.
- `HandleNotAvailable`: No description in schema.
- `InvalidEmail`: No description in schema.
- `EmailNotAvailable`: No description in schema.
- `InvalidPassword`: No description in schema.
- `HandleGenerationFailed`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Create an account on behalf of a client attested by a trusted issuer. Authenticated with a service-auth JWT (iss = trusted issuer DID, aud = this PDN, lxm = this method, exp - iat <= 60 s, unique jti). No invite code, no captcha. Without handle the server generates a memorable one; without email the server stores the placeholder <label>@newnal.id. Returns a full session, like createAccount; clients that need a scoped session create a scoped app password with it.",
      "errors": [
        {
          "name": "InvalidAttestation"
        },
        {
          "name": "UntrustedIssuer"
        },
        {
          "name": "AttestationReplayed"
        },
        {
          "name": "InvalidHandle"
        },
        {
          "name": "HandleNotAvailable"
        },
        {
          "name": "InvalidEmail"
        },
        {
          "name": "EmailNotAvailable"
        },
        {
          "name": "InvalidPassword"
        },
        {
          "name": "HandleGenerationFailed"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "email": {
              "type": "string"
            },
            "handle": {
              "format": "handle",
              "type": "string"
            },
            "password": {
              "type": "string"
            },
            "recoveryKey": {
              "description": "DID PLC rotation key to include in the creation operation.",
              "type": "string"
            }
          },
          "required": [
            "password"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "accessJwt": {
              "type": "string"
            },
            "did": {
              "format": "did",
              "type": "string"
            },
            "didDoc": {
              "type": "unknown"
            },
            "email": {
              "type": "string"
            },
            "emailPlaceholder": {
              "type": "boolean"
            },
            "handle": {
              "format": "handle",
              "type": "string"
            },
            "refreshJwt": {
              "type": "string"
            }
          },
          "required": [
            "accessJwt",
            "refreshJwt",
            "handle",
            "did",
            "email",
            "emailPlaceholder"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.pdn.server.createAttestedAccount",
  "lexicon": 1
}
```
