Choose your avatar
const url = 'https://spaces.work.optidata.cloud/api/spaces/preferences/skin';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"skin":"premade:07"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://spaces.work.optidata.cloud/api/spaces/preferences/skin \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "skin": "premade:07" }'Saves the avatar you appear with in every space. Send one of
available_skins (premade:NN), a character made in the Spaces
character maker (custom:…, when is_custom_skin_accepted is true),
or null to go back to the default one. You see the change the next time
you enter a space.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examples
{ "skin": "premade:07"}Back to the default avatar
{ "skin": null}Responses
Section titled “ Responses ”Your avatar and the ones you can choose from.
object
Your avatar (premade:NN or custom:…).
false when you never picked one and skin is your default avatar.
Whether characters made in the character maker (custom:…) are accepted.
Examples
{ "skin": "premade:07", "has_skin_preference": true, "available_skins": [ "premade:01", "premade:02", "premade:03", "premade:04", "premade:05", "premade:06", "premade:07", "premade:08" ], "is_custom_skin_accepted": true}No authentication key was sent.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The authentication key is expired or not recognised. Get a fresh one and retry.
Authentication failures use an error key rather than message.
object
Examples
{ "error": "JWT passport expired: Passport expired"}The avatar is not one you can choose, or skin is missing.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The selected skin is invalid.", "errors": { "skin": [ "The selected skin is invalid." ] }}{ "message": "The skin field must be present.", "errors": { "skin": [ "The skin field must be present." ] }}