# Sign-in

address.seleya.ai's own sign-in, from its own page: emailed links and passkeys.

Calls go to https://address.seleya.ai/api. Errors are `{"error": {"code", "message"}}` with the HTTP status: https://address.seleya.ai/docs/reference/errors.md

## Email me a sign-in link

`POST /v1/auth/email`, called with 

address.seleya.ai's own sign-in, from its own origin.

Called by the console's own page, signed in; not for agents.

| Field | Type | | |
| --- | --- | --- | --- |
| `email` | string | required |  |
| `request` | string | optional | Optional pending OAuth request. The emailed link resumes its consent screen, including in another browser. |

Answers:

- 202: The link is on its way to that address; it works once, for 15 minutes.
- 400: The request is malformed
- 401: No valid key, session or token
- 403: Not allowed for this caller
- 422: A value is refused; the message says which
- 429: A limit is reached
- 502: The sign-in email could not be sent to that address

```json
{
  "sent": true
}
```

## Use a sign-in link

`POST /v1/auth/email/verify`, called with 

address.seleya.ai's own sign-in, from its own origin.

Called by the console's own page, signed in; not for agents.

Answers:

- 200: Done
- 400: The request is malformed
- 401: No valid key, session or token
- 403: Not allowed for this caller
- 422: A value is refused; the message says which
- 429: A limit is reached

```json
{
  "can_claim": [],
  "companies": [],
  "held": [],
  "passkeys": [],
  "person": {
    "email": "admin@acme.com",
    "id": "7f3c9a2e-0000-4000-8000-00000000002b"
  },
  "personal": null
}
```

## Passkey: register

`POST /v1/auth/passkeys/register`, called with 

address.seleya.ai's own sign-in, from its own origin.

Called by the console's own page, signed in; not for agents.

Answers:

- 200: Done
- 400: The request is malformed
- 401: No valid key, session or token
- 403: Not allowed for this caller
- 422: A value is refused; the message says which
- 429: A limit is reached

## Passkey: registration options

`POST /v1/auth/passkeys/register/options`, called with 

address.seleya.ai's own sign-in, from its own origin.

Called by the console's own page, signed in; not for agents.

Answers:

- 200: Done
- 400: The request is malformed
- 401: No valid key, session or token
- 403: Not allowed for this caller
- 422: A value is refused; the message says which
- 429: A limit is reached

## Passkey: sign in

`POST /v1/auth/passkeys/sign-in`, called with 

address.seleya.ai's own sign-in, from its own origin.

Called by the console's own page, signed in; not for agents.

Answers:

- 200: Done
- 400: The request is malformed
- 401: No valid key, session or token
- 403: Not allowed for this caller
- 422: A value is refused; the message says which
- 429: A limit is reached

## Passkey: sign-in options

`POST /v1/auth/passkeys/sign-in/options`, called with 

address.seleya.ai's own sign-in, from its own origin.

Called by the console's own page, signed in; not for agents.

Answers:

- 200: Done
- 400: The request is malformed
- 401: No valid key, session or token
- 403: Not allowed for this caller
- 422: A value is refused; the message says which
- 429: A limit is reached

## Sign out

`POST /v1/auth/sign-out`, called with 

address.seleya.ai's own sign-in, from its own origin.

Called by the console's own page, signed in; not for agents.

Answers:

- 200: Done
- 400: The request is malformed
- 401: No valid key, session or token
- 403: Not allowed for this caller
- 422: A value is refused; the message says which
- 429: A limit is reached

## You

`GET /v1/me`, called with a person signed in

The person signed in: companies, held addresses, own address, passkeys.

Called by the console's own page, signed in; not for agents.

Answers:

- 200: Done
- 401: No valid key, session or token

| Field (200) | Type | | |
| --- | --- | --- | --- |
| `person` | object | required |  |
| `companies` | array of objects | required |  |
| `held` | array of Address | required |  |
| `can_claim` | array of objects | optional |  |
| `personal` | object | optional |  |
| `passkeys` | array of objects | optional |  |
| `next` | string | optional | Optional relative consent path returned by email verification. |

## Remove a passkey

`DELETE /v1/me/passkeys/{id}`, called with a person signed in

Removes one of your passkeys.

Called by the console's own page, signed in; not for agents.

| Parameter | Type | | |
| --- | --- | --- | --- |
| `id` | string, in path | required | Its id. |

Answers:

- 204: Done, with no body
- 401: No valid key, session or token
- 404: Not found, or not yours to see

