Antfly Role API

Operations related to Casbin role and group membership

Operations 4

GET /auth/v1/users/{userName}/roles List user roles #
POST /auth/v1/users/{userName}/roles Add role to user #
DELETE /auth/v1/users/{userName}/roles Remove role from user #
GET /auth/v1/subjects List auth subjects #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/antfly:antfly-role-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

antfly-role-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Antfly Public Role API
  version: v1alpha1
  description: Joined public contract for the Antfly server. Antfly APIs are served under `/db/v1`, auth APIs under `/auth/v1`, inference APIs under `/ai/v1`, ML prediction APIs under `/ml/v1`, and extension lifecycle APIs under `/extensions/v1`.
servers:
- url: /
security:
- BasicAuth: []
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Role
  x-displayName: Role
  description: Operations related to Casbin role and group membership
paths:
  /auth/v1/users/{userName}/roles:
    parameters:
    - $ref: '#/components/parameters/UserNamePathParameter'
    get:
      tags:
      - Role
      summary: List user roles
      description: Returns inherited role and group subjects for a user.
      operationId: listUserRoles
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - BasicAuth: []
      - ApiKeyAuth: []
      - BearerAuth: []
    post:
      tags:
      - Role
      summary: Add role to user
      description: Adds a direct role or group membership for a user.
      operationId: addRoleToUser
      requestBody:
        description: Role or group subject to assign
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleAssignment'
      responses:
        '201':
          description: Role added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessMessage'
        '400':
          description: Bad Request (e.g., invalid role)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - BasicAuth: []
      - ApiKeyAuth: []
      - BearerAuth: []
    delete:
      tags:
      - Role
      summary: Remove role from user
      description: Removes a direct role or group membership from a user.
      operationId: removeRoleFromUser
      parameters:
      - name: role
        in: query
        required: true
        description: Role or group subject to remove.
        schema:
          type: string
          example: role:tenant_reader
      responses:
        '204':
          description: Role removed successfully
        '400':
          description: Bad Request (e.g., missing role)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User or role not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - BasicAuth: []
      - ApiKeyAuth: []
      - BearerAuth: []
  /auth/v1/subjects:
    get:
      tags:
      - Role
      summary: List auth subjects
      description: Returns unique subjects derived from users and Casbin permission, row-filter, and grouping policies.
      operationId: listAuthSubjects
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AuthSubject'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - BasicAuth: []
      - ApiKeyAuth: []
      - BearerAuth: []
components:
  schemas:
    RoleAssignment:
      type: object
      properties:
        role:
          type: string
          description: 'Role or group subject to assign, usually prefixed with role: or group:.'
          example: role:tenant_reader
      required:
      - role
    AuthSubject:
      type: object
      properties:
        subject:
          type: string
          description: Casbin subject name.
          example: role:tenant_reader
        kind:
          type: string
          enum:
          - user
          - role
          - group
          - subject
          description: Conservative subject classification inferred from user records and subject prefixes.
          example: role
      required:
      - subject
      - kind
    SuccessMessage:
      type: object
      properties:
        message:
          type: string
          example: Operation completed successfully
    Error:
      type: object
      properties:
        code:
          type: string
          description: Optional stable machine-readable error code for programmatic handling.
        error:
          type: string
          example: An error message
          description: Legacy human-readable error text.
        message:
          type: string
          description: Human-readable error description when supplied by the endpoint.
        retryable:
          type: boolean
          description: Whether retrying the operation may succeed without changing the request.
        retry_after_ms:
          type: integer
          format: int32
          minimum: 1
          description: Suggested minimum retry delay in milliseconds.
      required:
      - error
  parameters:
    UserNamePathParameter:
      name: userName
      in: path
      required: true
      description: The username.
      schema:
        type: string
        example: johndoe
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
    BearerAuth:
      type: http
      scheme: bearer
x-tagGroups:
- name: Antfly
  tags:
  - cluster_management
  - table_management
  - data_operations
  - query_operations
  - index_management
- name: Auth
  tags:
  - User
  - Permission
  - ApiKey
  - RowFilter
- name: Inference
  tags: []
- name: Extensions
  tags:
  - Packages
  - Installed