{
  "type": "https://errors.swepay.com.br/native-guard/invalid-role",
  "service": "native-guard",
  "slug": "invalid-role",
  "httpStatus": 400,
  "title": "Invalid Role",
  "summary": "A role referenced by the request does not exist in the realm.",
  "description": "Returned by the Admin API when a request references a role that does not\nexist in the target realm. It applies to creating or updating a client\n(`roles`), and to creating a membership or replacing its roles (`roleIds`).\nNothing is persisted.\n\nRoles are scoped to a realm: a role that exists in another realm does not\nsatisfy the reference.\n",
  "commonCauses": [
    "The role name or id has a typo, or uses the wrong letter case.",
    "The role was deleted, or was never created in this realm.",
    "The role exists in a different realm or environment than the one in the request path."
  ],
  "clientAction": "List the realm's roles (`GET /admin/v1/realms/{realmId}/roles`), then either\ncreate the missing role or correct the reference, and send the request again.\nRetrying the same body will keep returning `400`.\n\n`error` and `errorDescription` are deprecated compatibility members of the\nAdmin API; key your handling off `type`.\n",
  "exampleResponse": {
    "type": "https://errors.swepay.com.br/native-guard/invalid-role",
    "title": "Invalid Role",
    "status": 400,
    "detail": "Role 'billing-admin' not found in this realm",
    "traceId": "Root=1-00000000-000000000000000000000000;Parent=0000000000000000;Sampled=0",
    "error": "invalid_role",
    "errorDescription": "Role 'billing-admin' not found in this realm"
  },
  "relatedDocs": [
    {
      "label": "RFC 9457 — Problem Details",
      "url": "https://www.rfc-editor.org/rfc/rfc9457"
    }
  ],
  "category": "service",
  "deprecated": false,
  "documentation": "https://errors.swepay.com.br/native-guard/invalid-role"
}