On this page

    1. Home
    2. API
    3. API Reference
    4. Auth Code Login

    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"
    }
    FieldTypeDescription
    auth_codestringRequired. 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

    FieldTypeDescription
    by_jwtstringThe network-level JSON Web Token for the authenticated session.
    errorobjectReturned if the code was invalid, expired, or reached its usage limit.
    error.messagestringHuman-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
    }


    Powered by Sudoc v2.5.0
    Hide table of contents