Docs API reference

neoserver 0.1.2

Create role

POST /api/v1/roles · Roles

← All operations and schemas
POST /api/v1/roles

Creates a custom role. Requires super_admin role.

Operation ID: createRole

Authentication

Use one of the following authentication options. Permissions and workspace scope still apply. See authentication and access control.

  • Authorization: Bearer YOUR_ACCESS_TOKEN
  • X-API-Key: YOUR_API_KEY

Request body

Required

Role to create

Content type application/json

object
description string
id string required
name string

Responses

201 Created role

Content type application/json

400 Bad Request

Content type application/json

401 Unauthorized

Content type application/json

403 Forbidden - requires super_admin role

Content type application/json

409 Role ID already exists or has been retired

Content type application/json

413 Request body exceeds the configured limit

Content type application/json

426 HTTPS required

Content type application/json

429 Request rate exceeded

Content type application/json

503 Service temporarily unavailable

Content type application/json

OpenAPI operation definition
{
  "description": "Creates a custom role. Requires super_admin role.",
  "operationId": "createRole",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "description": {
              "type": "string"
            },
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "type": "object"
        }
      }
    },
    "description": "Role to create",
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Role"
          }
        }
      },
      "description": "Created role"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Bad Request"
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Unauthorized"
    },
    "403": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Forbidden - requires super_admin role"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Role ID already exists or has been retired"
    },
    "413": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Request body exceeds the configured limit"
    },
    "426": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "HTTPS required"
    },
    "429": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Request rate exceeded"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Service temporarily unavailable"
    }
  },
  "summary": "Create role",
  "tags": [
    "Roles"
  ]
}

Search documentation

Type to search guides and reference pages.