---
title: "REST API: Get Space Role by Role Name"
type: "wiki"
space: "Axero Documentation"
author: "Anonymous User"
created: 2016-02-18T13:23:53Z
updated: 2026-09-28T01:16:47Z
tags: ["API"]
url: "https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/5801/rest-api-get-space-role-by-role-name"
---

# REST API: Get Space Role by Role Name

[Open API Guide](https://my.axerosolutions.com/spaces/5/axero-documentation/api-guide?id=5801)
GET/api/spaces/\{SpaceID\}/roles

Get a space role by its name.

## 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 |
### Optional Parameters
| Parameter | Type | Required | Location | Description |
| :--- | :--- | :--- | :--- | :--- |
| `RoleName` | String | NO | Query | Name of the space role to look up. The match ignores case. Sending it selects this operation. Without it, the same route returns every role in the space \(see Get Space Roles\), so a request without it still answers 200. |
## Example

### Request Header

```
Authorization: Bearer YOUR_TOKEN
```

### Request URL

`https://your-site.com/api/spaces/104/roles?rolename=member`

### Success Response

```
{
  "IsError": false,
  "ResponseMessage": "",
  "ResponseData": {
    "RoleID": 5,
    "UserID": 376,
    "SpaceID": 252,
    "RoleName": "Member",
    "Description": "Community members who have joined the space, with normal permissions."
  }
}
```

### 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 is not a site administrator and does not have the Manage Role permission in the space. | Confirm the user has the required roles for this action. |
| 200 with an empty role | SpaceID is 0 \(an empty role object is returned\), or no role in the space has that name \(ResponseData null\). | Check the SpaceID and the exact role name. |
| 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.
