Create approval leavel
Create new approval level
createApprovalLevel
Creates a new approval level. Returns the created ApprovalLevel object.
Method
POST
Path
/graphql
Authentication
Bearer Token
Request Body Schema
Content-type: application/json
Variables
| Name | Type | Required | Description |
|---|---|---|---|
input.name | String | Required | Display name of the approval level |
input.code | String | Required | Short code identifier (e.g. "MGR") |
input.rank | Int | Required | Numeric rank; lower values indicate lower authority |
input.threshold_price_requested | Float | Optional | Maximum requested price this level can handle |
input.threshold_price_approved | Float | Optional | Maximum price this level can approve |
input.description | String | Optional | Description of the approval level |
Example Payload
{
"query": "mutation ($input: CreateApprovalLevelInput!) { createApprovalLevel(input: $input) { id name code rank threshold_price_requested threshold_price_approved } }",
"variables": {
"input": {
"name": "Manager",
"code": "MGR",
"rank": 2,
"threshold_price_requested": 10000.0,
"threshold_price_approved": 8000.0,
"description": "Manager-level approvals"
}
}
}
Response
Returns the newly created ApprovalLevel object.
Example Response
{
"data": {
"createApprovalLevel": {
"id": "01JNQX4KZB7WNVR3MPXT6A0002",
"name": "Manager",
"code": "MGR",
"rank": 2,
"threshold_price_requested": 10000.0,
"threshold_price_approved": 8000.0
}
}
}
Errors
Validation errors are returned when required fields are missing.
Example Response
{
"errors": [
{
"message": "Validation failed for the field [createApprovalLevel].",
"extensions": {
"validation": {
"input.name": ["The input.name field is required."],
"input.code": ["The input.code field is required."],
"input.rank": ["The input.rank field is required."]
}
}
}
]
}
Method
POSTPath
/graphqlAuthentication
Bearer TokenPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | User identifier |