Skip to content

Roles Endpoints

Roles API endpoints.


Overview

Method Endpoint Description
GET /api/v1/roles/ List Roles
GET /api/v1/roles/{role_id} Get Role

API Reference

Sartiq Backend Server - Roles 0.1.0

roles


GET /api/v1/roles/

List Roles

Description

List all available roles.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No

Responses

{
    "data": [
        {
            "id": "53280b84-4e41-4e26-95fa-131f74bb59c5",
            "name": "OPERATOR",
            "description": null
        }
    ],
    "count": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "data": {
            "items": {
                "$ref": "#/components/schemas/RolePublic"
            },
            "type": "array",
            "title": "Data"
        },
        "count": {
            "type": "integer",
            "title": "Count"
        }
    },
    "type": "object",
    "required": [
        "data",
        "count"
    ],
    "title": "RolesPublic"
}

GET /api/v1/roles/{role_id}

Get Role

Description

Get a specific role by ID.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
role_id path string No

Responses

{
    "id": "c80e3b13-bf6b-4576-82c9-f09f6ca5dd57",
    "name": "OPERATOR",
    "description": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "name": {
            "$ref": "#/components/schemas/RoleName"
        },
        "description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Description"
        }
    },
    "type": "object",
    "required": [
        "id",
        "name"
    ],
    "title": "RolePublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

Schemas

HTTPValidationError

Name Type Description
detail Array<ValidationError>

RoleName

Type: string

RolePublic

Name Type Description
description
id string(uuid)
name RoleName

RolesPublic

Name Type Description
count integer
data Array<RolePublic>

ValidationError

Name Type Description
ctx
input
loc Array<>
msg string
type string

Security schemes

Name Type Scheme Description
OAuth2PasswordBearer oauth2