---
updatedAt: 2026-05-28T08:16:45.000Z
agentTools:
  projectIndex: https://docs.scalr.io/llms.txt
---

# Create a Role

Create a new [IAM](https://docs.scalr.io/docs/identity-and-access-management) role.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "Role": {
        "description": "A collection of permissions that can be assigned to a user, team, or service account via an [access policy](/docs/identity-and-access-management#access-policies).",
        "properties": {
          "attributes": {
            "properties": {
              "description": {
                "description": "The description of the role.",
                "maxLength": 255,
                "nullable": true,
                "type": "string"
              },
              "is-system": {
                "description": "When `true` the role is built-in, and cannot be modified or deleted.",
                "readOnly": true,
                "type": "boolean"
              },
              "name": {
                "description": "The name of the role.",
                "maxLength": 128,
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object"
          },
          "id": {
            "readOnly": true,
            "type": "string"
          },
          "links": {
            "properties": {
              "self": {
                "readOnly": true,
                "type": "string"
              }
            },
            "readOnly": true,
            "type": "object"
          },
          "relationships": {
            "properties": {
              "account": {
                "description": "The account this role belongs to.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "accounts",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "permissions": {
                "description": "The collection of [permissions](permissions.html)",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "permissions",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "type": {
            "enum": [
              "roles"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "type": "object"
      },
      "RoleDocument": {
        "description": "JSON:API Document.\n\nsee: https://jsonapi.org/format/#document-structure",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Role"
          },
          "included": {
            "items": {
              "type": "object"
            },
            "readOnly": true,
            "type": "array"
          },
          "meta": {
            "readOnly": true,
            "type": "object"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "API-Key": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Scalr IACP API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Scalr IACP API",
    "version": "unversioned"
  },
  "openapi": "3.0.0",
  "paths": {
    "/roles": {
      "post": {
        "description": "Create a new [IAM](https://docs.scalr.io/docs/identity-and-access-management) role.",
        "operationId": "create_role",
        "parameters": [
          {
            "description": "The comma-separated list of relationship paths.",
            "explode": false,
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "items": {
                "enum": [
                  "account",
                  "permissions"
                ],
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "examples": {
                "default": {
                  "value": "{\n  \"data\": {\n    \"type\": \"roles\",\n    \"attributes\": {\n      \"description\": \"Workspace full access\",\n      \"name\": \"workspace-admin\"\n    },\n    \"relationships\": {\n      \"permissions\": {\n        \"data\": [\n          {\n            \"type\": \"permissions\",\n            \"id\": \"workspaces:create\"\n          },\n          {\n            \"type\": \"permissions\",\n            \"id\": \"workspaces:delete\"\n          },\n          {\n            \"type\": \"permissions\",\n            \"id\": \"workspaces:read\"\n          },\n          {\n            \"type\": \"permissions\",\n            \"id\": \"workspaces:set-access-policies\"\n          },\n          {\n            \"type\": \"permissions\",\n            \"id\": \"workspaces:update\"\n          }\n        ]\n      },\n      \"account\": {\n        \"data\": {\n          \"type\": \"accounts\",\n          \"id\": \"acc-svrcncgh453bi8g\"\n        }\n      }\n    }\n  }\n}"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/RoleDocument"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/vnd.api+json": {
                "examples": {
                  "default": {
                    "value": "{\n  \"data\": {\n    \"attributes\": {\n      \"description\": \"Workspace full access\",\n      \"is-system\": false,\n      \"name\": \"workspace-admin\"\n    },\n    \"id\": \"role-thjhle31nfrmujg\",\n    \"links\": {\n      \"self\": \"https://my.scalr.io/api/iacp/v3/roles/role-thjhle31nfrmujg\"\n    },\n    \"relationships\": {\n      \"account\": {\n        \"data\": {\n          \"id\": \"acc-svrcncgh453bi8g\",\n          \"type\": \"accounts\"\n        }\n      },\n      \"permissions\": {\n        \"data\": [\n          {\n            \"id\": \"workspaces:create\",\n            \"type\": \"permissions\"\n          },\n          {\n            \"id\": \"workspaces:delete\",\n            \"type\": \"permissions\"\n          },\n          {\n            \"id\": \"workspaces:read\",\n            \"type\": \"permissions\"\n          },\n          {\n            \"id\": \"workspaces:set-access-policies\",\n            \"type\": \"permissions\"\n          },\n          {\n            \"id\": \"workspaces:update\",\n            \"type\": \"permissions\"\n          }\n        ]\n      }\n    },\n    \"type\": \"roles\"\n  },\n  \"included\": null,\n  \"meta\": null\n}"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/RoleDocument"
                }
              }
            },
            "description": "Successfully created."
          },
          "403": {
            "description": "User unauthorized to perform this action."
          },
          "404": {
            "description": "Account not found or user unauthorized."
          },
          "422": {
            "description": "Malformed request body (missing attributes, wrong types, etc.)."
          },
          "4XX": {
            "description": "Client error."
          },
          "5XX": {
            "description": "Server error."
          }
        },
        "summary": "Create a Role",
        "tags": [
          "roles"
        ],
        "x-resource": "Role",
        "x-service": "tf-api"
      }
    }
  },
  "security": [
    {
      "API-Key": []
    }
  ],
  "servers": [
    {
      "url": "https://{Domain}/api/iacp/v3",
      "variables": {
        "Domain": {
          "default": "example.scalr.io",
          "description": "Domain where Scalr is hosted"
        }
      }
    }
  ]
}
```

# Sibling pages

* [List Roles](https://docs.scalr.io/scalr/reference/get_roles.md)
* [Delete a Role](https://docs.scalr.io/scalr/reference/delete_role.md)
* [Get a Role](https://docs.scalr.io/scalr/reference/get_role.md)
* [Update a Role](https://docs.scalr.io/scalr/reference/update_role.md)