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 profile object
Unique user identifier (CUID)
User role: USER, ADMIN, or SUPERADMIN
Base64-encoded avatar image or URL
ISO 8601 timestamp of account creation
Custom embed/view configuration for uploaded files
Whether custom view is enabled
Custom content for file pages
Custom site name for embeds
Content alignment: left, center, or right
Display file mimetype on file pages
Display tags on file pages
Display folder information on file pages
User quota information (if configured)
Quota type: BY_BYTES or BY_FILES
Maximum storage in bytes (e.g., “10gb”)
Maximum number of files allowed
Maximum number of shortened URLs allowed
Current session token cookie value
{
"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
New username (must be unique)
New password (will be hashed before storage)
Base64-encoded image data or URL. Set to null to remove avatar.
Custom view/embed configuration
Enable custom view settings
Custom content for file pages
Embed theme color (hex format)
Content alignment: left, center, or right
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)
{
"statusCode": 400,
"error": "Bad Request",
"message": "Username already exists"
}