---
title: "REST API: Get Space Roles"
type: "wiki"
space: "Axero Documentation"
author: "Anonymous User"
created: 2020-08-03T22:57:15Z
updated: 2026-09-28T01:16:49Z
tags: ["API"]
url: "https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/66963/rest-api-get-space-roles"
---

# REST API: Get Space Roles

[Open API Guide](https://my.axerosolutions.com/spaces/5/axero-documentation/api-guide?id=66963)
GET/api/spaces/\{SpaceID\}/roles

List a space's roles. With UserID, list only the roles that user holds; with SpaceID 0, list the site-level roles.

## 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 | Space whose roles are returned. 0 returns the site-level roles. |
### Optional Parameters
| Parameter | Type | Required | Location | Description |
| :--- | :--- | :--- | :--- | :--- |
| `Rolename` | String | NO | Query | When sent with a SpaceID above 0, returns the one role with this name in the space instead of the list. With SpaceID 0, the role comes back empty. |
| `UserID` | Integer | NO | Query | Return only the roles this user holds in the space; with SpaceID 0, the user's site roles. When it is left out, every role is returned. A user who is not a member of the space gets the space's Guest role. A value that is not a whole number is ignored and every role is returned. |
## Example

### Request Header

```
Authorization: Bearer YOUR_TOKEN
```

### Request URL

`https://your-site.com/api/spaces/78/roles`

### Success Response

```
{
  "IsError": false,
  "ResponseMessage": "",
  "ResponseData": [
    {
      "RoleID": 1373,
      "UserID": 0,
      "SpaceID": 313,
      "RoleName": "Member",
      "Description": "This role is what most users will have. This role is assigned to every user that registers or is invited to the space. They cannot access the space Control Panel, but they can create content and interact with other users.",
      "RoleAssignSource": 1,
      "TenantID": 0
    }
  ]
}
```

### 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 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 | Internal failure. | Retry later. |

## 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.
