Ver .md

roles.create

Cria um cargo. Do zero (só as telas pessoais) ou de um modelo do original (operator, collaborator, attendant, finance, guest). Nome repetido responde invalid_input.

  • Endpoint: POST https://app.atomiks.com.br/api/v1/roles.create (corpo JSON)
  • Quem pode chamar: administrador da conta
  • Escopo da chave: team:write
  • Grava dados: sim
  • Pela chave de API: sim
  • Ferramenta MCP: roles_create
  • Ficha em JSON: https://app.atomiks.com.br/api/v1/openapi.json (operationId roles.create)

Entrada

CampoTipoObrigatórioNota
namestringsim
template"operator" | "collaborator" | "attendant" | "finance" | "guest" | nullnão
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "template": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "operator",
            "collaborator",
            "attendant",
            "finance",
            "guest"
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "name"
  ]
}

Exemplo

curl -X POST https://app.atomiks.com.br/api/v1/roles.create \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Atendimento","template":"attendant"}'

CLI:

node cli/atomiks.mjs roles.create --json '{"name":"Atendimento","template":"attendant"}'

MCP: ferramenta roles_create com a mesma entrada.

Saída

Sucesso: {"data": ...} com o formato abaixo.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}

Erros

{"error": {"code", "message", "requestId"}}. Códigos: invalid_input (400), unauthorized (401), forbidden / account_pending / scope_missing (403), not_found (404), limit_reached (409), internal (500).