Skip to content

Users

Endpoints for managing the authenticated user's profile, account, data exports, and notifications.

All endpoints require a valid Sanctum token. See Authentication for details.


Get Profile

GET /api/v1/user

Requires ability: read

Returns the authenticated user's profile.

Request

HeaderValueRequired
AuthorizationBearer shieldci_{token}Yes
Acceptapplication/jsonRecommended
bash
curl https://shieldci.com/api/v1/user \
  -H "Authorization: Bearer shieldci_{token}" \
  -H "Accept: application/json"

Response

json
{
  "data": {
    "id": 1,
    "name": "Jane Smith",
    "email": "jane@example.com",
    "avatar_url": "https://gravatar.com/...",
    "email_verified_at": "2026-01-10T08:00:00+00:00",
    "current_team_id": 3,
    "created_at": "2026-01-05T12:00:00+00:00"
  }
}
FieldTypeDescription
idintegerUser ID
namestringDisplay name
emailstringEmail address
avatar_urlstring|nullGravatar or uploaded avatar URL
email_verified_atstring|nullISO 8601 timestamp when email was verified
current_team_idinteger|nullID of the team currently active for this user
created_atstring|nullISO 8601 account creation timestamp

Update Profile

PUT /api/v1/user

Requires ability: write

Updates the authenticated user's display name.

Request

HeaderValueRequired
AuthorizationBearer shieldci_{token}Yes
Content-Typeapplication/jsonYes
FieldTypeRequiredDescription
namestringYesDisplay name (max 255 characters)
bash
curl -X PUT https://shieldci.com/api/v1/user \
  -H "Authorization: Bearer shieldci_{token}" \
  -H "Content-Type: application/json" \
  -d '{"name": "Jane Smith"}'

Response

Returns the updated user profile in the same shape as Get Profile.

Errors

StatusCondition
422name is missing or exceeds 255 characters

Delete Account

DELETE /api/v1/user

Requires ability: admin

Permanently deletes the authenticated user's account and all associated data. This action is irreversible.

Request

HeaderValueRequired
AuthorizationBearer shieldci_{token}Yes
Content-Typeapplication/jsonYes
FieldTypeRequiredDescription
passwordstringYesCurrent account password (used to confirm the deletion)
bash
curl -X DELETE https://shieldci.com/api/v1/user \
  -H "Authorization: Bearer shieldci_{token}" \
  -H "Content-Type: application/json" \
  -d '{"password": "your-password"}'

Response

json
{
  "message": "Account deleted successfully."
}

Errors

StatusCondition
422Password is missing or incorrect

Request Data Export

POST /api/v1/user/export-data

Requires ability: write

Enqueues a full data export for the authenticated user. An email notification is sent when the export is ready to download. Only one export can be in progress at a time within a 24-hour window.

Request

HeaderValueRequired
AuthorizationBearer shieldci_{token}Yes

No request body required.

bash
curl -X POST https://shieldci.com/api/v1/user/export-data \
  -H "Authorization: Bearer shieldci_{token}"

Response

HTTP 202 Accepted

json
{
  "message": "Data export requested. You will be notified when it is ready."
}

Errors

StatusCondition
409A data export is already in progress (within the last 24 hours)

List Notifications

GET /api/v1/user/notifications

Requires ability: read

Returns a paginated list of notifications for the authenticated user, ordered by most recent first.

Request

HeaderValueRequired
AuthorizationBearer shieldci_{token}Yes
Acceptapplication/jsonRecommended
bash
curl "https://shieldci.com/api/v1/user/notifications?page=1" \
  -H "Authorization: Bearer shieldci_{token}" \
  -H "Accept: application/json"

Response

json
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "App\\Notifications\\ReportReady",
      "data": { "report_uuid": "...", "project_name": "my-app" },
      "read_at": null,
      "created_at": "2026-05-13T10:00:00+00:00"
    }
  ],
  "links": { "first": "...", "last": "...", "prev": null, "next": null },
  "meta": { "current_page": 1, "per_page": 20, "total": 1 }
}
FieldTypeDescription
idstring (UUID)Unique notification ID
typestringFully-qualified notification class name
dataobjectNotification payload (varies by type)
read_atstring|nullISO 8601 timestamp when notification was read; null if unread
created_atstring|nullISO 8601 creation timestamp

Mark Notification Read

PUT /api/v1/user/notifications/{notification}/read

Requires ability: write

Marks a specific notification as read.

Request

HeaderValueRequired
AuthorizationBearer shieldci_{token}Yes
Acceptapplication/jsonRecommended
ParameterTypeDescription
notificationUUID stringThe id of the notification to mark as read
bash
curl -X PUT "https://shieldci.com/api/v1/user/notifications/550e8400-e29b-41d4-a716-446655440000/read" \
  -H "Authorization: Bearer shieldci_{token}"

Response

json
{
  "message": "Notification marked as read."
}

Errors

StatusCondition
404Notification not found or belongs to another user