Approval groups: API examples
Contract-derived requests, potential responses and API links for approval groups.
Generated from the public OpenAPI. Examples illustrate the contract and are not live results. Use your assigned gateway, credentials and identifiers. The snippets do not execute automatically.
Use Node.js 22 or later. Copy the setup below into an .mjs file, set QFP_BASE_URL and QFP_ACCESS_TOKEN, then append the operation snippet you need. No repository checkout or downloaded client is required. Keep secrets in your backend and persist each write key and body before sending.
Request setup
const required = name => {
const value = process.env[name];
if (!value) throw new Error(`Set ${name} before running this example`);
return value;
};
const baseUrl = required('QFP_BASE_URL').replace(/\/$/, '');
if (!/^https:\/\//.test(baseUrl)) throw new Error('Use your assigned HTTPS gateway');
const token = required('QFP_ACCESS_TOKEN');
const segment = value => encodeURIComponent(value);
async function request(method, path, body, key) {
const headers = { Authorization: `Bearer ${token}`, 'API-Version': '1.0.0', Accept: 'application/json' };
if (key) headers['Idempotency-Key'] = key;
const multipart = body instanceof FormData;
if (body !== undefined && !multipart) headers['Content-Type'] = 'application/json';
const response = await fetch(baseUrl + path, {
method, headers, body: body === undefined ? undefined : multipart ? body : JSON.stringify(body),
signal: AbortSignal.timeout(30_000), redirect: 'error',
});
const text = await response.text();
const data = text && response.headers.get('content-type')?.includes('json') ? JSON.parse(text) : text || null;
if (!response.ok) {
const error = new Error(`HTTP ${response.status}`);
Object.assign(error, { status: response.status, data, headers: response.headers });
throw error;
}
return { status: response.status, data };
}createGroup
Create an approval group. API Reference · Integration guide
POST /api/tenants/{id}/groups
| Parameter | Location | Required |
|---|---|---|
id | path | Yes |
API-Version | header | Yes |
Request body: mlro
{
"key": "#mlro",
"name": "MLRO",
"description": "Money laundering reporting officers"
}const body = {
"key": "#mlro",
"name": "MLRO",
"description": "Money laundering reporting officers"
};
const result = await request('POST', '/api/tenants/' + encodeURIComponent('<id>') + '/groups', body, undefined);
console.log(result.status, result.data);Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.
Potential responses
Documented statuses: 201, 400, 401, 403, 409.
Example 201 (created); see the reference for other outcomes.
{
"id": "7b3e5a10-6c2d-4f8e-9a41-d0c8b7e6f512",
"key": "#mlro",
"name": "MLRO",
"description": "Money laundering reporting officers",
"status": "ACTIVE"
}For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.
listGroups
List approval groups. API Reference · Integration guide
GET /api/tenants/{id}/groups
| Parameter | Location | Required |
|---|---|---|
id | path | Yes |
API-Version | header | Yes |
name | query | No |
status | query | No |
page | query | No |
size | query | No |
sort | query | No |
const body = undefined;
const result = await request('GET', '/api/tenants/' + encodeURIComponent('<id>') + '/groups', body, undefined);
console.log(result.status, result.data);Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.
Potential responses
Documented statuses: 200, 400, 401, 403, 500.
Example 200 (firstPage); see the reference for other outcomes.
{
"pageNumber": 0,
"pageSize": 20,
"totalResults": 2,
"items": [
{
"id": "7b3e5a10-6c2d-4f8e-9a41-d0c8b7e6f512",
"key": "#mlro",
"name": "MLRO",
"description": "Money laundering reporting officers",
"status": "ACTIVE"
},
{
"id": "2e9d4c83-1a5f-4b60-8c72-f3a1d0b9e847",
"key": "#org_unit_approval_group",
"name": "Org unit approvers",
"description": null,
"status": "DEACTIVATED"
}
]
}For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.
getGroup
View a group and its members. API Reference · Integration guide
GET /api/tenants/{id}/groups/{groupId}
| Parameter | Location | Required |
|---|---|---|
id | path | Yes |
groupId | path | Yes |
API-Version | header | Yes |
page | query | No |
size | query | No |
sort | query | No |
const body = undefined;
const result = await request('GET', '/api/tenants/' + encodeURIComponent('<id>') + '/groups/' + encodeURIComponent('<groupId>') + '', body, undefined);
console.log(result.status, result.data);Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.
Potential responses
Documented statuses: 200, 400, 401, 403, 404.
Example 200 (mlro); see the reference for other outcomes.
{
"id": "7b3e5a10-6c2d-4f8e-9a41-d0c8b7e6f512",
"key": "#mlro",
"name": "MLRO",
"description": "Money laundering reporting officers",
"status": "ACTIVE",
"members": {
"pageNumber": 0,
"pageSize": 20,
"totalResults": 1,
"items": [
{
"id": "3f1c9e2a-5b47-4f0e-9a1d-2c8b7e6d5a40",
"firstName": "Jane",
"lastName": "Doe",
"email": "[email protected]",
"role": "ADMIN",
"status": "ACTIVE"
}
]
}
}For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.
updateGroup
Rename or re-describe a group. API Reference · Integration guide
PUT /api/tenants/{id}/groups/{groupId}
| Parameter | Location | Required |
|---|---|---|
id | path | Yes |
groupId | path | Yes |
API-Version | header | Yes |
Request body: rename
{
"name": "Compliance leads",
"description": "Approvers for compliance-gated actions"
}const body = {
"name": "Compliance leads",
"description": "Approvers for compliance-gated actions"
};
const result = await request('PUT', '/api/tenants/' + encodeURIComponent('<id>') + '/groups/' + encodeURIComponent('<groupId>') + '', body, undefined);
console.log(result.status, result.data);Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.
Potential responses
Documented statuses: 200, 400, 401, 403, 404, 409.
For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.
deactivateGroup
Deactivate a group. API Reference · Integration guide
DELETE /api/tenants/{id}/groups/{groupId}
| Parameter | Location | Required |
|---|---|---|
id | path | Yes |
groupId | path | Yes |
API-Version | header | Yes |
const body = undefined;
const result = await request('DELETE', '/api/tenants/' + encodeURIComponent('<id>') + '/groups/' + encodeURIComponent('<groupId>') + '', body, undefined);
console.log(result.status, result.data);Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.
Potential responses
Documented statuses: 200, 400, 401, 403, 404.
Example 200 (deactivated); see the reference for other outcomes.
{
"id": "7b3e5a10-6c2d-4f8e-9a41-d0c8b7e6f512",
"key": "#mlro",
"name": "MLRO",
"description": "Money laundering reporting officers",
"status": "DEACTIVATED"
}For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.
addGroupMember
Add a member. API Reference · Integration guide
POST /api/tenants/{id}/groups/{groupId}/members
| Parameter | Location | Required |
|---|---|---|
id | path | Yes |
groupId | path | Yes |
API-Version | header | Yes |
Request body: add
{
"userId": "3f1c9e2a-5b47-4f0e-9a1d-2c8b7e6d5a40"
}const body = {
"userId": "3f1c9e2a-5b47-4f0e-9a1d-2c8b7e6d5a40"
};
const result = await request('POST', '/api/tenants/' + encodeURIComponent('<id>') + '/groups/' + encodeURIComponent('<groupId>') + '/members', body, undefined);
console.log(result.status, result.data);Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.
Potential responses
Documented statuses: 200, 400, 401, 403, 404, 409.
For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.
removeGroupMember
Remove a member. API Reference · Integration guide
DELETE /api/tenants/{id}/groups/{groupId}/members/USERID
| Parameter | Location | Required |
|---|---|---|
id | path | Yes |
groupId | path | Yes |
userId | path | Yes |
API-Version | header | Yes |
const body = undefined;
const result = await request('DELETE', '/api/tenants/' + encodeURIComponent('<id>') + '/groups/' + encodeURIComponent('<groupId>') + '/members/' + encodeURIComponent('<userId>') + '', body, undefined);
console.log(result.status, result.data);Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.
Potential responses
Documented statuses: 200, 400, 401, 403, 404.
For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.
Updated 4 days ago

