Auth Code Login
This endpoint allows a user to exchange a temporary, ephemeral authentication code for a persistent network session token (JWT). This is typically used for secondary device onboarding or quick-access scenarios.
POST /auth/code-login
Authenticate and receive a network JWT using an alphanumeric access code.
Request
POST /auth/code-login
Headers:
{
"Host": "api.bringyour.com",
"Content-Type": "application/json"
}Body:
{
"auth_code": "string"
}| Field | Type | Description |
|---|---|---|
auth_code | string | Required. The temporary alphanumeric code obtained from an existing session or device invitation. |
Response
200 Success
Status: 200 OK
Content-Type: application/json
A successful response returns the primary network JWT used for subsequent authorized requests.
{
"by_jwt": "string",
"error": {
"message": "string"
}
}Fields
| Field | Type | Description |
|---|---|---|
by_jwt | string | The network-level JSON Web Token for the authenticated session. |
error | object | Returned if the code was invalid, expired, or reached its usage limit. |
error.message | string | Human-readable explanation of the login failure. |
Example
HTTP Request
POST /auth/code-login HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
{
"auth_code": "UR-ABC-123-XYZ"
}Successful HTTP Response
{
"by_jwt": "eyJhbGciOiJIUzI1NiI...",
"error": null
}