Skip to main content
Update Space
Updates a space. Only the space’s admin can update it. Send multipart/form-data to upload a new avatar or banner; without files, use application/json. Every other field goes as a form field on a multipart request (objects and arrays as JSON strings).

Path Parameters

string
required
UUID of the space to update.

Body Parameters

All fields are optional. Only provided fields are updated.
string
Updated display name: 3–100 characters after trimming. Leave it out to keep the current name. It can’t be cleared: null returns 400 space/invalid-body with param: "name".
string
Updated URL slug. Pass empty to clear.
string
Updated description.
string
"anyone" or "members".
string
"anyone", "members" (active members), or "team" (the space’s active admins and moderators). Any other value, "admins" included, is refused with 400 space/invalid-body.
string
"public", "unlisted", or "private". Controls who can find and see the space (and the spaces under it), independent of readingPermission. Changes take effect immediately and are freely reversible. See Space visibility.
boolean
Whether joining the space needs admin approval. Applies to joins from this point on — memberships that are already pending or active are unaffected.
object
Updated metadata object.
file
New avatar image, replacing the current one (the old file is deleted). Requires avatarFile.options.
string
Stringified JSON describing how to process the avatar. Must include a mode field; see Upload Image for the modes and optional fields. Not used when no avatarFile is sent, but still validated: invalid JSON or options get a 400. A key the options don’t take, a key of another mode included (for example sizes with exact-dimensions), is refused with 400 space/invalid-body, param naming it.
file
New banner image, replacing the current one (the old file is deleted). Requires bannerFile.options.
string
Stringified JSON describing how to process the banner, as avatarFile.options. Not used when no bannerFile is sent, but still validated: invalid JSON or options get a 400.
string[]
Files to remove from the space: its avatarFileId and/or bannerFileId, nothing else. Removing one clears that image (the pointer becomes null and the file is deleted). Works alone or with uploads in the same request; uploading a new avatar while listing the old one is a plain replace. On a multipart request, send it as a JSON string ('["<fileId>"]'). Any other id, including a file that only carries this space’s spaceId, refuses the whole request with 400 space/invalid-remove-file-ids.
string
Required with a service key: the user this request acts as. The request has exactly that user’s permissions, so it is refused unless they are an admin of the space, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 space/acting-user-not-allowed).

Response

Returns the updated Space object with memberPermissions: what the caller (or the user named by actingUserId) may do in the space after the update, as a SpaceMemberPermissions object.

Error Responses

Returned with no JSON body: 401 when no Authorization header is sent, 403 when the access token is invalid or expired. Checked before any uploaded file is read, so a request with no credentials gets 401 rather than a body or acting-user error.
Returned when spaceId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
name was sent as null (a space can’t lose its name) or isn’t 3–100 characters after trimming. Nothing is updated.
A service key sent no actingUserId.
actingUserId is not a user id.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
actingUserId was sent in the query string. On this endpoint every field, actingUserId included, goes in the request body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The caller (or the user named by actingUserId) is not an admin of the space.
removeFileIds names a file that isn’t this space’s current avatar or banner. invalidIds lists those ids. Checked before anything is uploaded, so nothing is stored or removed.
A removeFileIds that isn’t an array of file ids gets 400 space/invalid-body instead.
Returned when an avatar or banner is uploaded on a project without the files-images bundle. missingTables lists the tables that aren’t installed and bundleId the bundle to install. While the bundle is still being installed, the response is 503 database/tables-provisioning instead. See Bundles.
The image is over 50 MB. param names its field: avatarFile or bannerFile.
The file can’t be read as an image. Also returned for the banner, with param: "bannerFile". An image over 10000 px on a side gets the same code. error gives its size:
For bannerFile:
avatarFile or bannerFile was uploaded without its .options field. param is avatarFile.options or bannerFile.options.
The .options field isn’t valid JSON. param names the field: avatarFile.options or bannerFile.options. avatarFile.options without mode, or with a mode that isn’t one of the five (other options fields the same way, named in error and param):
In an aspect-ratio mode, a variant’s computed side would be outside 1–10000 px. Checked once the image is read, before anything is stored. param names the option:
In aspect-ratio-height-based it names a heights option and gives a width. In multi-aspect-ratio it names a sizes option, and the ratio is the one in aspectRatios closest to the image, so the text reads ”… at the 3:1 aspect ratio, the one in aspectRatios closest to this image. Each side of a variant must be 1–10000 px.” More than 30 entries in dimensions, widths, heights or sizes (one variant each). param names the option:
A variant name that uses a character other than letters, digits, _, - and ., that is longer than 64 characters, that contains .., or that is original. param names the option:
A key the options don’t take (also a key of another mode). error names the object holding it, param the key itself:
A file was refused as the body was read: space/unsupported-file-type or space/unexpected-file-field (a file in another field, or a second file in avatarFile or bannerFile), with param naming the field when there is one. A body over 250 MB gets 413 request/body-too-large; one that can’t be read at all gets request/invalid-multipart or request/field-too-large. See Upload errors.
See also: useUpdateSpace