EndpointsPermission Templates

Permission Templates

Function-calling namespace: permissionTemplates

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

create

Source: backend/endpoints/permission-templates/create

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
namestringYes-
descriptionstringNo-
permissionsarray<object>No-
isDefaultbooleanNo-
forRolesarray<string>No-
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-ms timestamp; nullable

Nested Field Structures

permissions item

FieldTypeRequiredConstraints
resourceTypestringNo-
actionsarray<string>No-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "permissionTemplates",
  "apiName": "create",
  "data": {
    "organizationId": "org_123",
    "name": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

delete

Source: backend/endpoints/permission-templates/delete

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "permissionTemplates",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

duplicate

Source: backend/endpoints/permission-templates/duplicate

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
newNamestringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "permissionTemplates",
  "apiName": "duplicate",
  "data": {
    "id": "id_123",
    "organizationId": "org_123",
    "newName": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getById

Source: backend/endpoints/permission-templates/get-by-id

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "permissionTemplates",
  "apiName": "getById",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

listByOrganization

Source: backend/endpoints/permission-templates/list-by-organization

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
pageintegerNo-
pageSizeintegerNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "permissionTemplates",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

remove

Source: backend/endpoints/permission-templates/remove

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "permissionTemplates",
  "apiName": "remove",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

update

Source: backend/endpoints/permission-templates/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
namestringNonullable
descriptionstringNonullable
permissionsarray<object>Nonullable
isDefaultbooleanNonullable
forRolesarray<string>Nonullable
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-ms timestamp; nullable

Nested Field Structures

permissions item

FieldTypeRequiredConstraints
resourceTypestringNo-
actionsarray<string>No-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "permissionTemplates",
  "apiName": "update",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }