---
title: "REST API: Add Space User"
type: "wiki"
space: "Axero Documentation"
author: "Anonymous User"
created: 2011-03-29T06:34:06Z
updated: 2026-09-28T01:06:59Z
tags: ["API"]
url: "https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/511/rest-api-add-space-user"
---

# REST API: Add Space User

[Open API Guide](https://my.axerosolutions.com/spaces/5/axero-documentation/api-guide?id=511)
POST/api/spaces/\{SpaceID\}/users

Add a user to a space, or send them an invitation to join. What happens depends on AsMember and on who is calling, as described below.

## 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/json` | Must be set to application/json |
### Required Parameters
| Parameter | Type | Required | Location | Description |
| :--- | :--- | :--- | :--- | :--- |
| `SpaceID` | Integer | YES | Path | Unique identifier for a particular space |
| `UserID` | Integer | YES | Body | Unique identifier for a particular user |
### Optional Parameters
| Parameter | Type | Required | Location | Description |
| :--- | :--- | :--- | :--- | :--- |
| `AsMember` | Boolean | NO | Query | Set to true to add the user at once: a pending request is approved, and otherwise the user joins. ResponseData is then Invitation sent, even though no invitation is sent. Set to false to send an invitation instead. When omitted, a site administrator adding someone, or a user adding themselves, joins the user directly. ResponseMessage is then 1 and ResponseData is Member. On a moderated space the join waits for approval instead: ResponseMessage is 0 and ResponseData is Pending. Anyone else sends an invitation. A value that is not true or false is ignored, as if AsMember were left out. |
| `CheckSpaceModeration` | Boolean | NO | Query | Used only when AsMember is true. When true and the space is moderated, the user's membership stays pending until a moderator approves it, and each moderator is emailed. When false \(default\), the user joins at once. A value that is not true or false is read as false. |
## Example

### Request Header

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
```

### Request URL

`https://your-site.com/api/spaces/10/users`

### Request Body

```
1340
```

### Success Response

```
{
  "IsError": false,
  "ResponseMessage": "1",
  "ResponseData": "Member"
}
```

### 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, or the JSON body is not a whole number. | Verify the request payload against the required parameters |
| 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 | The caller is not a site administrator and is inviting someone else to a space where they do not have the Invite People permission. | Confirm the user has the required roles for this action |
| 500 Server Error | Internal failure | Retry later |
| 200 with ResponseData Invalid | UserID is 0, or the body is empty. IsError is false and ResponseData is the text Invalid. | Send the user's ID as the JSON body. |
| 200 with a message | AsMember was sent and nothing changed. ResponseData says why: This person is already a member., or This person has already been invited. while a request is pending. | No action needed. |

## 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.
