---
title: "REST API: Update Space Image"
type: "wiki"
space: "Axero Documentation"
author: "Anonymous User"
created: 2014-05-14T07:54:07Z
updated: 2026-10-02T12:57:05Z
tags: ["API"]
url: "https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/1806/rest-api-update-space-image"
---

# REST API: Update Space Image

[Open API Guide](https://my.axerosolutions.com/spaces/5/axero-documentation/api-guide?id=1806)
POST/api/spaces/\{SpaceID\}/image

Set or replace a space's image from the raw bytes of the request body. ResponseData is the result name. ToBePublished means the image was saved, Unspecified means the update was not saved, and Error means the call failed: no space has that ID, the caller has no right to update the space, or the bytes are not an image. The call answers 200 in each case, so read ResponseData. The upload works only on a space that already has an image: on a space without one, every upload answers Error. An empty body answers ToBePublished without changing the image.

## Request

### Request Header
| Header | Required | Value | Description |
| :--- | :--- | :--- | :--- |
| `Authorization` | YES | `Bearer YOUR_TOKEN` | Bearer token for the authenticated user. [Learn how to create Bearer tokens](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/108973/creating-bearer-tokens) |
| `Content-Type` | YES | `application/octet-stream` | Send `application/octet-stream`. The endpoint reads the body as raw bytes and does not check this header. A multipart form upload answers Error. |
### Required Parameters
| Parameter | Type | Required | Location | Description |
| :--- | :--- | :--- | :--- | :--- |
| `Image Stream` | File Stream | YES | Body | The image file's raw bytes, sent as the whole request body |
| `SpaceID` | Integer | YES | Path | Unique identifier for a particular space |
## Example

### Request Header

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/octet-stream
```

### Request URL

`https://your-site.com/api/spaces/123/image`

### Request Body

**To set or replace the image for a space using Postman:**

1. In Postman, select the **Body** tab
2. Choose **binary**
3. Select your image \(JPG, PNG, or GIF\)

### Success Response

```
{
  "IsError": false,
  "ResponseMessage": "",
  "ResponseData": "ToBePublished"
}
```

### Error Response

```
{
  "Message": "The request is invalid."
}
```

## Error Handling

| Status Code | Likely Cause | Next Action |
| :--- | :--- | :--- |
| 400 Bad Request | SpaceID in the path is not an integer. | Send the space's numeric ID. |
| 401 Unauthorized | Missing or invalid Bearer token | Check token validity. [Learn how to create Bearer tokens →](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/108973/creating-bearer-tokens) |
| 403 Forbidden | Not returned: every failure, a refusal included, answers 200 with Error in ResponseData. | Read ResponseData on every response. |

## Rate Limits

While Axero does not enforce hard rate limits by default, we recommend the following best practices to ensure optimal performance:

- **Sustained Request Rate:** Do not exceed 5 API calls per second
- **Sequential Processing:** Wait for each request to complete before sending the next in automated workflows
- **Concurrent Connections:** If parallel processing is required, limit to 3 or fewer simultaneous requests
- **Response Timeout:** Ensure API responses complete within 15 seconds during testing

Axero may implement temporary rate restrictions if excessive API usage affects overall site performance. For high-volume integrations, contact Axero to discuss your requirements.
