Skip to main content

Get User Profile

GET /api/user

Retrieve the authenticated user’s profile information and session token.

Request

curl -X GET https://your-zipline.com/api/user \
  -H "Authorization: YOUR_TOKEN" \
  -H "Cookie: zipline_token=YOUR_SESSION_TOKEN"

Response

user
object
User profile object
token
string
Current session token cookie value
Example Response
{
  "user": {
    "id": "clxxx123456789",
    "username": "john_doe",
    "role": "USER",
    "avatar": null,
    "createdAt": "2024-01-15T10:30:00.000Z",
    "view": {
      "enabled": true,
      "content": null,
      "embed": true,
      "embedTitle": "My Files",
      "embedDescription": null,
      "embedColor": "#3b82f6",
      "embedSiteName": "John's Zipline",
      "align": "center",
      "showMimetype": true,
      "showTags": true,
      "showFolder": false
    },
    "quota": null
  },
  "token": "ey..."
}

Update User Profile

PATCH /api/user

Update user profile settings. All fields are optional - only provided fields will be updated.

Request

username
string
New username (must be unique)
password
string
New password (will be hashed before storage)
avatar
string | null
Base64-encoded image data or URL. Set to null to remove avatar.
view
object
Custom view/embed configuration
curl -X PATCH https://your-zipline.com/api/user \
  -H "Authorization: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "new_username",
    "view": {
      "embedColor": "#10b981",
      "showTags": true
    }
  }'

Response

Returns the updated user object and session token in the same format as GET /api/user.

Errors

  • 400 Bad Request: Username already exists
  • 429 Too Many Requests: Rate limit exceeded (1 request per second)
Error Response
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Username already exists"
}

Build docs developers (and LLMs) love