---
updatedAt: 2025-03-10T14:06:52.000Z
agentTools:
  projectIndex: https://docs.umbrellacost.io/llms.txt
---

# Create Role

Create a Role

> ℹ️ How to specify the accounts
>
> Use AWS terminololgy in the account fields: accountId, linkedAccountIds\
> accountId represents: AWS - Payer Account, Azure - Billing Account, GCP - Billing Account
> linkedAccountIds: AWS - Linked Accounts, Azure - subscriptions, GCP - projects
>
> Each Payar or billing account, and its related accounts are enclosed in curly braces.
>
> The linkedAccountIds field may contain an array of linked acccounts, or the string "all".

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Admin",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.umbrellacost.io"
    }
  ],
  "x-readme": {
    "explorer-enabled": false
  },
  "paths": {
    "/api/v2/roles": {
      "post": {
        "description": "Create a Role",
        "summary": "Create Role",
        "tags": [
          "Roles"
        ],
        "operationId": "post_apiv2roles",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": " "
                    },
                    "name": {
                      "type": "string",
                      "description": " "
                    },
                    "type": {
                      "type": "string",
                      "description": " "
                    },
                    "accounts": {
                      "type": "object",
                      "description": " "
                    }
                  }
                },
                "examples": {
                  "newExample": {
                    "summary": "Response Example",
                    "value": "[{\n          \"id\": \"1234\",\n          \"name\": \"Role Name\",\n        \"type\": \"EDITOR\",\n        \"accounts\": [{ \"accountId\": \"123\", \"linkedAccountIds\": \"all\"}]\n    }\n]\n"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "apikey",
            "in": "header",
            "required": true,
            "description": "",
            "schema": {
              "type": "string",
              "default": ""
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The role's name\t",
                    "x-readme-id": "0.0"
                  },
                  "Type": {
                    "type": "string",
                    "description": "The role's type, Values: EDITOR / VIEWER\t",
                    "x-readme-id": "0.1"
                  },
                  "accounts": {
                    "type": "string",
                    "description": "Payer and linked accounts accessible for the role\t",
                    "x-readme-id": "0.2"
                  }
                },
                "type": "object",
                "required": [
                  "name",
                  "Type",
                  "accounts"
                ]
              }
            }
          }
        }
      }
    }
  }
}
```