Skip to content

Update Profile

Update the authenticated dashboard user's profile.

Endpoint

INFO

PUT /api/v1/dashboard/profile

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes

Request Body

ParameterTypeRequiredDescription
namestringNoFull name
emailstringNoEmail address
phonestringNoPhone number
avatarfileNoProfile picture
preferencesobjectNoUser preferences

Example Request

bash
curl -X PUT https://api.daakey.com/api/v1/dashboard/profile \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -d '{
    "name": "John Admin",
    "phone": "+1987654321",
    "preferences": {
      "language": "en",
      "timezone": "America/Los_Angeles"
    }
  }'

Response

Success (200)

json
{
  "success": true,
  "message": "Profile updated",
  "data": {
    "id": 1,
    "name": "John Admin",
    "email": "admin@agency.com",
    "phone": "+1987654321",
    "avatar_url": "https://api.daakey.com/storage/avatars/1.jpg",
    "preferences": {
      "language": "en",
      "timezone": "America/Los_Angeles",
      "notifications": {
        "email": true,
        "push": true
      }
    },
    "updated_at": "2024-01-15T00:00:00Z"
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Error (422)

json
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "email": ["The email has already been taken."]
  },
  "data": null,
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Daakey Car Sharing Platform