post_org_admin_by_orgid_roles

Changes data · you confirm first

Calls POST /api/org-admin/{orgId}/roles as the signed-in person · REST reference

Create a role in the organization, granting some of its permissions

With the caller's own token; requires admin.roles.create in the organization. Every orgPermissionIds entry must be this organization's, and the caller must hold every one of them here (403 naming the first it does not).

Arguments

ArgumentTypeDescription
orgIdpathstring (uuid)required
bodyJSONobjectrequiredThe request body, as a JSON object. Its fields are listed below.

Fields of body

FieldTypeDescription
descriptionstring
namestringrequiredLetters, digits and underscores, 2-50 characters (the DAL's rule).
orgPermissionIdsarray of string (uuid)

Example call

A client sends this over the MCP session; Claude and other agents build it for you. The values are placeholders — the shape is real.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "post_org_admin_by_orgid_roles",
    "arguments": {
      "orgId": "11111111-1111-4111-8111-111111111111",
      "body": {
        "name": "string",
        "description": "string",
        "orgPermissionIds": [
          "11111111-1111-4111-8111-111111111111"
        ]
      }
    }
  }
}
Confirmation
The client shows the person the exact request and waits. Nothing runs until they tick Make this change. See Reading and changing.

Result

On success (HTTP 201) the tool returns one text item holding the API's JSON, pretty-printed.

The role was created.

json
{
  "data": {
    "id": "11111111-1111-4111-8111-111111111111",
    "name": "string"
  },
  "success": true
}

Fields

FieldTypeDescription
dataobject
data.idstring (uuid)
data.namestring
successtrue

When it fails

A failed call returns isError: true with the API's message as text. A change the person declines, or lets time out, also comes back this way and nothing changes.

400

The request was malformed or failed a guard.

403

No admin.roles.create in the organization, or the role would grant a permission the caller does not hold there (the message names it).

409

The resource is not in a state that allows this operation.

What the model is shown

This is the tool exactly as the server lists it in tools/list. The description starts with the REST call it makes.

json
{
  "name": "post_org_admin_by_orgid_roles",
  "description": "POST /api/org-admin/{orgId}/roles — With the caller's own token; requires `admin.roles.create` in the organization. Every `orgPermissionIds` entry must be this organization's, and the caller must hold every one of them here (403 naming the first it does not).\n\nThis changes data. The person is asked to confirm it before it runs, and nothing happens if they decline.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "orgId": {
        "type": "string"
      },
      "body": {
        "type": "string",
        "description": "The JSON request body: { description: string; name*: string (Letters, digits and underscores, 2-50 characters (the DAL's rule).); orgPermissionIds: array of string }"
      }
    },
    "required": [
      "orgId",
      "body"
    ]
  },
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": false,
    "openWorldHint": false
  }
}