Create role

Creates a custom role with the specified data access control scope. If dac is omitted, defaults to all-data.

POST
/api/roles
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

namestring

Must match ^[a-z][a-z0-9_.]*$. Max 255 characters. Unique.

Lengthlength <= 255
description?string
dac?string

Defaults to all-data when omitted.

Value in"own-data" | "team-data" | "all-data"

Response Body

curl -X POST "https://loading/{AI_GATEWAY_URL}/api/roles" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "role": {
    "id": 0,
    "name": "string",
    "description": "string",
    "is_system_role": true,
    "dac": "own-data",
    "created_by_user_id": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
On this page

On this page

No Headings