MechaMental
Api reference

App Token Policies

List App Token Policies

GET
/v1/orgs/{org_id}/app-token-policies

Path Parameters

org_id*Org Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/app-token-policies"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "policies": [
    {
      "policy_id": "string",
      "organization_id": "string",
      "app_id": "string",
      "max_ttl_days": 0,
      "max_live_tokens": 0,
      "allowed_permissions": [
        "string"
      ],
      "default_rate_limit_rps": 0,
      "max_rate_limit_rps": 0,
      "requires_admin_approval": true,
      "description": "string",
      "created_by": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ]
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Create App Token Policy

POST
/v1/orgs/{org_id}/app-token-policies

Path Parameters

org_id*Org Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/app-token-policies" \  -H "Content-Type: application/json" \  -d '{}'
{
  "policy_id": "string",
  "organization_id": "string",
  "app_id": "string",
  "max_ttl_days": 0,
  "max_live_tokens": 0,
  "allowed_permissions": [
    "string"
  ],
  "default_rate_limit_rps": 0,
  "max_rate_limit_rps": 0,
  "requires_admin_approval": true,
  "description": "string",
  "created_by": "string",
  "created_at": "string",
  "updated_at": "string"
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Get App Token Policy

GET
/v1/orgs/{org_id}/app-token-policies/{policy_id}

Path Parameters

org_id*Org Id
policy_id*Policy Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/app-token-policies/string"
{
  "policy_id": "string",
  "organization_id": "string",
  "app_id": "string",
  "max_ttl_days": 0,
  "max_live_tokens": 0,
  "allowed_permissions": [
    "string"
  ],
  "default_rate_limit_rps": 0,
  "max_rate_limit_rps": 0,
  "requires_admin_approval": true,
  "description": "string",
  "created_by": "string",
  "created_at": "string",
  "updated_at": "string"
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Update App Token Policy

PATCH
/v1/orgs/{org_id}/app-token-policies/{policy_id}

Path Parameters

org_id*Org Id
policy_id*Policy Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://loading/v1/orgs/string/app-token-policies/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "policy_id": "string",
  "organization_id": "string",
  "app_id": "string",
  "max_ttl_days": 0,
  "max_live_tokens": 0,
  "allowed_permissions": [
    "string"
  ],
  "default_rate_limit_rps": 0,
  "max_rate_limit_rps": 0,
  "requires_admin_approval": true,
  "description": "string",
  "created_by": "string",
  "created_at": "string",
  "updated_at": "string"
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Delete App Token Policy

DELETE
/v1/orgs/{org_id}/app-token-policies/{policy_id}

Path Parameters

org_id*Org Id
policy_id*Policy Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/v1/orgs/string/app-token-policies/string"
Empty
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}