# ai.newnal.illi.account.parent.startOAuth

> Published by [illi-service.newnal.id](https://lexicon.garden/identity/did:plc:uztm7bi2ce42dez3uu3qafro)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.account.parent.startOAuth)
- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.account.parent.startOAuth/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.account.parent.startOAuth/examples)

## Definitions

### `ai.newnal.illi.account.parent.startOAuth`

**Type**: `procedure`

Start a parent's OAuth sign-in on the device through the PDN's own page (BFF), for an existing Newnal ID whose credentials are typed on the PDN page. Device-created accounts, and existing ones whose credentials the device app takes itself, sign in with account.parent.signIn instead. client=native ends with a one-time code on the device app's App Link for account.exchangeCode instead of a cookie.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `client` | `string` | No | web (default): the callback sets the device-app cookie. native: the callback redirects to the device app's App Link with a 60-second one-time code for account.exchangeCode. |
| `codeChallenge` | `string` | No | Required with client native: base64url(SHA-256(codeVerifier)) without padding. The one-time code the callback returns can only be exchanged with that verifier (account.exchangeCode). |
| `deviceId` | `string` | No |  |
| `mode` | `string` | Yes |  |
| `slot` | `integer` | No |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `loginUrl` | `string` (uri) | Yes |  |

#### Errors

- **ParentLimitReached**
- **ParentAlreadyLinked**

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Start a parent's OAuth sign-in on the device through the PDN's own page (BFF), for an existing Newnal ID whose credentials are typed on the PDN page. Device-created accounts, and existing ones whose credentials the device app takes itself, sign in with account.parent.signIn instead. client=native ends with a one-time code on the device app's App Link for account.exchangeCode instead of a cookie.",
      "errors": [
        {
          "name": "ParentLimitReached"
        },
        {
          "name": "ParentAlreadyLinked"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "client": {
              "default": "web",
              "description": "web (default): the callback sets the device-app cookie. native: the callback redirects to the device app's App Link with a 60-second one-time code for account.exchangeCode.",
              "knownValues": [
                "web",
                "native"
              ],
              "type": "string"
            },
            "codeChallenge": {
              "description": "Required with client native: base64url(SHA-256(codeVerifier)) without padding. The one-time code the callback returns can only be exchanged with that verifier (account.exchangeCode).",
              "maxLength": 43,
              "minLength": 43,
              "type": "string"
            },
            "deviceId": {
              "maxLength": 64,
              "type": "string"
            },
            "mode": {
              "knownValues": [
                "create",
                "signIn"
              ],
              "type": "string"
            },
            "slot": {
              "maximum": 2,
              "minimum": 1,
              "type": "integer"
            }
          },
          "required": [
            "mode"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "loginUrl": {
              "format": "uri",
              "type": "string"
            }
          },
          "required": [
            "loginUrl"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.account.parent.startOAuth",
  "lexicon": 1
}
```
