# ai.newnal.pdn.server.createAttestedAccount

> Published by [newnal-platform.newnal.id](https://lexicon.garden/identity/did:plc:vciktevzoffubdvdaajz2yp3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAttestedAccount)
- [Documentation](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAttestedAccount/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.pdn.server.createAttestedAccount/examples)

## Definitions

### `ai.newnal.pdn.server.createAttestedAccount`

**Type**: `procedure`

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.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `email` | `string` | No |  |
| `handle` | `string` (handle) | No |  |
| `password` | `string` | Yes |  |
| `recoveryKey` | `string` | No | DID PLC rotation key to include in the creation operation. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `accessJwt` | `string` | Yes |  |
| `did` | `string` (did) | Yes |  |
| `didDoc` | `unknown` | No |  |
| `email` | `string` | Yes |  |
| `emailPlaceholder` | `boolean` | Yes |  |
| `handle` | `string` (handle) | Yes |  |
| `refreshJwt` | `string` | Yes |  |

#### Errors

- **InvalidAttestation**
- **UntrustedIssuer**
- **AttestationReplayed**
- **InvalidHandle**
- **HandleNotAvailable**
- **InvalidEmail**
- **EmailNotAvailable**
- **InvalidPassword**
- **HandleGenerationFailed**

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