Approvals

List approval flows

GET/organizations/{organizationId}/approvals
Authorization
Path parameters
organizationId*string

The organization ID

Query parameters
Response

OK

Body
results*array of ApprovalFlow
nextPageTokenstring

The token to fetch the next page of results. If empty, there are no more results to fetch.

Request
const response = await fetch('/organizations/{organizationId}/approvals', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "organizationId": "123e4567-e89b-12d3-a456-426614174000",
      "workspaceId": "123e4567-e89b-12d3-a456-426614174000",
      "ownerId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "objectType": "text",
      "objectAction": "create",
      "steps": [
        {
          "type": "any",
          "reviewers": [
            {
              "type": "user",
              "id": "123e4567-e89b-12d3-a456-426614174000"
            }
          ],
          "message": "text"
        }
      ],
      "createdAt": "2024-12-21T12:27:08.144Z",
      "updatedAt": "2024-12-21T12:27:08.144Z",
      "tags": [
        {
          "key": "text",
          "value": "text"
        }
      ]
    }
  ],
  "nextPageToken": "text"
}

Create approval flow

POST/organizations/{organizationId}/approvals
Authorization
Path parameters
organizationId*string

The organization ID

Body
name*string
description*string
objectType*objectType (string (mrn))

The identifier of the object

objectAction*objectAction (enum)

The action performed on the object

createupdatedelete
tagsarray of ApprovalFlowIdentifierTag
steps*array of object
Response

OK

Body
id*string (uuid)
organizationIdstring (uuid)
workspaceIdstring (uuid)
ownerId*string (uuid)
name*string
description*string
objectType*objectType (string (mrn))

The identifier of the object

objectAction*objectAction (enum)

The action performed on the object

createupdatedelete
steps*array of object
createdAt*string (date-time)
updatedAt*string (date-time)
tagsarray of ApprovalFlowIdentifierTag
Request
const response = await fetch('/organizations/{organizationId}/approvals', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer jwt",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "text",
      "description": "text",
      "objectType": "text",
      "objectAction": "create",
      "steps": [
        {
          "type": "any"
        }
      ]
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organizationId": "123e4567-e89b-12d3-a456-426614174000",
  "workspaceId": "123e4567-e89b-12d3-a456-426614174000",
  "ownerId": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "objectType": "text",
  "objectAction": "create",
  "steps": [
    {
      "type": "any",
      "reviewers": [
        {
          "type": "user",
          "id": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "message": "text"
    }
  ],
  "createdAt": "2024-12-21T12:27:08.144Z",
  "updatedAt": "2024-12-21T12:27:08.144Z",
  "tags": [
    {
      "key": "text",
      "value": "text"
    }
  ]
}

Retrieve approval flow

GET/organizations/{organizationId}/approvals/{approvalId}
Authorization
Path parameters
organizationId*string

The organization ID

approvalId*string (uuid)
Response

OK

Body
id*string (uuid)
organizationIdstring (uuid)
workspaceIdstring (uuid)
ownerId*string (uuid)
name*string
description*string
objectType*objectType (string (mrn))

The identifier of the object

objectAction*objectAction (enum)

The action performed on the object

createupdatedelete
steps*array of object
createdAt*string (date-time)
updatedAt*string (date-time)
tagsarray of ApprovalFlowIdentifierTag
Request
const response = await fetch('/organizations/{organizationId}/approvals/{approvalId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organizationId": "123e4567-e89b-12d3-a456-426614174000",
  "workspaceId": "123e4567-e89b-12d3-a456-426614174000",
  "ownerId": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "objectType": "text",
  "objectAction": "create",
  "steps": [
    {
      "type": "any",
      "reviewers": [
        {
          "type": "user",
          "id": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "message": "text"
    }
  ],
  "createdAt": "2024-12-21T12:27:08.144Z",
  "updatedAt": "2024-12-21T12:27:08.144Z",
  "tags": [
    {
      "key": "text",
      "value": "text"
    }
  ]
}

Delete approval flow

DELETE/organizations/{organizationId}/approvals/{approvalId}
Authorization
Path parameters
organizationId*string

The organization ID

approvalId*string (uuid)
Response

OK

Request
const response = await fetch('/organizations/{organizationId}/approvals/{approvalId}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "code": "text",
  "message": "text"
}

Update approval flow

PATCH/organizations/{organizationId}/approvals/{approvalId}
Authorization
Path parameters
organizationId*string

The organization ID

approvalId*string (uuid)
Body
namestring
descriptionstring
objectTypestring
objectActionenum
createupdatedelete
stepsarray of object
Response

OK

Body
id*string (uuid)
organizationIdstring (uuid)
workspaceIdstring (uuid)
ownerId*string (uuid)
name*string
description*string
objectType*objectType (string (mrn))

The identifier of the object

objectAction*objectAction (enum)

The action performed on the object

createupdatedelete
steps*array of object
createdAt*string (date-time)
updatedAt*string (date-time)
tagsarray of ApprovalFlowIdentifierTag
Request
const response = await fetch('/organizations/{organizationId}/approvals/{approvalId}', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer jwt",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organizationId": "123e4567-e89b-12d3-a456-426614174000",
  "workspaceId": "123e4567-e89b-12d3-a456-426614174000",
  "ownerId": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "objectType": "text",
  "objectAction": "create",
  "steps": [
    {
      "type": "any",
      "reviewers": [
        {
          "type": "user",
          "id": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "message": "text"
    }
  ],
  "createdAt": "2024-12-21T12:27:08.144Z",
  "updatedAt": "2024-12-21T12:27:08.144Z",
  "tags": [
    {
      "key": "text",
      "value": "text"
    }
  ]
}

Last updated