Duvet DOCS
GitHub

Users

Get Current User

GET /api/users/@me

Returns the authenticated user.

Returns: Current User object (the User object plus birthdate and phone).

Update Current User

PATCH /api/users/@me

Update the authenticated user's profile.

JSON Body

FieldTypeDescription
username ?stringNew username (must be unique)
alias ?string?New display name (null to remove)
avatar ?string?null or an empty string removes the avatar, and its current ID keeps it. A new one is uploaded (multipart body): any other value is a 400
banner ?string?Same as avatar, for the banner

Multipart Body

Supports file uploads for avatar and banner, along with username and alias as form fields:

FieldTypeDescription
avatar ?fileAvatar image file (max 10MB)
banner ?fileBanner image file (max 10MB)
remove_avatar ?stringSet to "true" to remove the avatar
remove_banner ?stringSet to "true" to remove the banner

A new image is uploaded before the profile is saved, and the one it replaces is deleted once it is: if the update fails, the profile keeps its old images.

Returns: Current User object (the User object plus birthdate and phone).

Errors: 400 when a JSON avatar or banner sets an image; 409 with that username is taken when another account has the username; 413 for an image over 10 MB or over your upload limit; 500 when the storage fails.

Storage Buckets

Your own S3-compatible buckets for personal uploads. They work like a space’s buckets: a new bucket starts inactive, and at most one is active, the one new uploads go to. All of these endpoints are human-only, since they handle third-party S3 credentials. Each one except List and Create answers 404 when the bucket doesn’t exist and 403 with not your bucket when it belongs to someone else.

List My Buckets

GET /api/users/@me/buckets

List your storage buckets.

Returns: Array of StorageBucket objects.

Create My Bucket

POST /api/users/@me/buckets

Add an S3-compatible storage bucket. The API checks that it can reach the bucket with these settings first.

JSON Body

FieldTypeDescription
name stringDisplay name for the bucket
endpoint stringS3-compatible endpoint URL
region ?stringBucket region (default auto)
bucket_name stringActual bucket name on the provider
access_key_id stringS3 access key ID
secret_access_key stringS3 secret access key
use_path_style ?booleanUse path-style addressing instead of virtual-hosted
max_bytes ?integer?Maximum total storage in bytes
upload_limit_bytes ?integer?Per-upload size limit in bytes

Returns: 201 Created with a StorageBucket object.

Errors: 400 with invalid storage configuration: ... when the bucket can't be reached with these settings, or when max_bytes or upload_limit_bytes isn't a positive number.

Update My Bucket

PATCH /api/users/@me/buckets/{bucketId}

Replace a storage bucket's configuration. Like Create, it checks the bucket can be reached first.

JSON Body

FieldTypeDescription
name stringDisplay name
endpoint stringS3-compatible endpoint URL
region ?stringBucket region (default auto)
bucket_name stringActual bucket name
access_key_id stringS3 access key ID
secret_access_key ?stringS3 secret access key (omit to keep the current one)
use_path_style ?booleanUse path-style addressing
max_bytes ?integer?Maximum total storage in bytes
upload_limit_bytes ?integer?Per-upload size limit in bytes

Returns: StorageBucket object.

Errors: 400 with invalid storage configuration: ... when the bucket can't be reached with these settings, or when max_bytes or upload_limit_bytes isn't a positive number.

Delete My Bucket

DELETE /api/users/@me/buckets/{bucketId}

Delete one of your storage buckets.

Returns: 204 No Content

Activate My Bucket

POST /api/users/@me/buckets/{bucketId}/activate

Make this bucket the one new uploads go to. Your other buckets are deactivated.

Returns: 204 No Content

Deactivate My Bucket

POST /api/users/@me/buckets/{bucketId}/deactivate

Deactivate a storage bucket. Existing files stay reachable, but new uploads don't use it.

Returns: 204 No Content

Update User Flags & Badges (Staff Only)

PATCH /api/internal/users/{userId}/flags-badges

Update a user's flags and badges. Requires FlagStaff permission.

FieldTypeDescription
flags ?integerNew flags bitfield value
badges ?integerNew badges bitfield value

Returns: User object.