---
title: "REST API: Get User Space Roles"
type: "wiki"
space: "Axero Documentation"
author: "Anonymous User"
created: 2011-03-29T08:08:34Z
updated: 2026-10-02T12:56:36Z
tags: ["API"]
url: "https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/524/rest-api-get-user-s-space-roles"
---

# REST API: Get User Space Roles

[Open API Guide](https://my.axerosolutions.com/spaces/5/axero-documentation/api-guide?id=524)
GET/api/spaces/\{SpaceID\}/roles

Get the space roles a user holds in a space. A user who is not a member of the space gets the space's Guest role.

## 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). |
### Required Parameters
| Parameter | Type | Required | Location | Description |
| :--- | :--- | :--- | :--- | :--- |
| `SpaceID` | Integer | YES | Path | Unique identifier for a particular space |
| `UserID` | Integer | YES | Query | User whose roles in the space are returned. With SpaceID 0, the user's site-level roles are returned. An ID that belongs to no user returns the space's Guest role. The endpoint does not check that it was sent: left out, or sent as something other than a whole number, the call answers 200 with every role in the space instead \(see Get Space Roles\). A caller who cannot manage the space's roles gets 403 instead. |
## Example

### Request Header

```
Authorization: Bearer YOUR_TOKEN
```

### Request URL

`https://your-site.com/api/spaces/78/roles?userid=90`

### Success Response

```
{
  "IsError": false,
  "ResponseMessage": "",
  "ResponseData": [
    {
      "RoleID": 980,
      "UserID": 90,
      "SpaceID": 78,
      "RoleName": "Member",
      "Description": "Community members who have joined the space, with normal permissions.",
      "RoleImageFileName": null
    }
  ]
}
```

### 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 | The caller asks for someone else's roles, or leaves UserID out, and cannot manage the space's roles or create Page Builder pages. A site administrator always can, and anyone can read their own roles. | Confirm the user has the required roles for this action. |
| 500 Server Error | UserID was sent with a SpaceID that belongs to no space, or another internal failure. | Check SpaceID, then retry. |

## 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.
