Skip to content

file

POST
/user/{id}/file

Uploads an avatar file for a user.

Authorizations

Parameters

Path Parameters

id
required
string

User Id

Example
4yql7587j64qdo5

Request Body

object
avatar
required

Avatar image file. Allowed file types: PNG, JPG, WEBP, SVG

string format: binary
file:///Users/christianbeutel/Downloads/23xxesym0e9w18z2904frnpgy7.jpg

Responses

200

object
avatar
required
string
bio
required
string
collectionId
required
string
collectionName
required
string
created
required
string
email
required
string
emailVisibility
required
boolean
id
required
string
token
required
string
updated
required
string
username
required
string
verified
required
boolean
Examples

Success

{
"avatar": "23xxesym0e9w18z2904frnpgy7_OzsVanAmWP.jpg",
"bio": "Enim beatae labore vel. Pariatur hic doloribus quia quasi eos. Cumque error nobis.",
"collectionId": "_pb_users_auth_",
"collectionName": "users",
"created": "2024-06-29 19:23:47.731Z",
"email": "mymail@gmail.com",
"emailVisibility": false,
"id": "3mugf953w4a9fg5",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlLZXlVaWQiOiIzMjk3NmExMi03ODE1LTQ1NGQtYTU5Yi1hNzY0ZTE4NmJjNjIiLCJzZWFyY2hSdWxlcyI6eyJjaXRpZXM1MDAiOnt9LCJ0cmFpbHMiOnsiZmlsdGVyIjoicHVibGljID0gdHJ1ZSBPUiBhdXRob3IgPSAzbXVnZjk1M3c0YTlmZzUgT1Igc2hhcmVzID0gM211Z2Y5NTN3NGE5Zmc1In19fQ.swips6eep2qMd0Nf3hdZr711N2fHyikOo7syWvuLEIA",
"updated": "2025-01-03 12:32:15.270Z",
"username": "Flomp",
"verified": true
}

400

object
message
required
string
detail
required
Array<object>
object
code
string
minimum
integer
type
string
inclusive
boolean
exact
boolean
message
string
path
Array<string>
Examples

Exception

{
"message": "invalid_params",
"detail": [
{
"code": "too_small",
"minimum": 15,
"type": "string",
"inclusive": true,
"exact": true,
"message": "String must contain exactly 15 character(s)",
"path": [
"id"
]
}
]
}

404

object
message
required
string
detail
required
object
code
required
integer
message
required
string
data
required
object
Examples

Exception

{
"message": "The requested resource wasn't found.",
"detail": {
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
}