Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ericcobasdev/careertrack-api/llms.txt

Use this file to discover all available pages before exploring further.

The register endpoint creates a brand-new user account and immediately returns a Sanctum plain-text bearer token, so callers are authenticated in a single round trip without needing a separate login step.

Endpoint

POST /api/auth/register
No authentication is required to call this endpoint.

Request Body

name
string
required
Full name of the user. Maximum 255 characters.
email
string
required
Email address for the account. Must be unique across all registered users. Maximum 255 characters.
password
string
required
Password for the account. Minimum 8 characters.
password_confirmation
string
required
Confirmation of the chosen password. Must exactly match the password field.

Example Request

curl -X POST https://your-domain.com/api/auth/register \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "jane@example.com",
    "password": "secret123",
    "password_confirmation": "secret123"
  }'

Response (201 Created)

A successful request returns HTTP 201 Created with a JSON body containing the newly created user object and a bearer token.
user
object
The created user resource.
token
string
Sanctum plain-text bearer token. Include this value in the Authorization header of all subsequent requests to protected endpoints.
{
  "user": {
    "id": 1,
    "name": "Jane Doe",
    "email": "jane@example.com",
    "created_at": "2024-05-01T10:00:00.000000Z",
    "updated_at": "2024-05-01T10:00:00.000000Z"
  },
  "token": "1|abcdefghijklmnopqrstuvwxyz1234567890"
}

Error Responses

422 Unprocessable Content — Returned when validation fails, such as a duplicate email address, missing required fields, or a password confirmation mismatch.
{
  "message": "The email has already been taken.",
  "errors": {
    "email": ["The email has already been taken."]
  }
}
Store the returned token securely on the client side (for example, in an HTTP-only cookie or secure storage) and attach it to every subsequent request to a protected endpoint using the Authorization: Bearer <token> header.

Build docs developers (and LLMs) love