SalesOS

Approval Workflows

Multi-step approval processes

Get stats

GET
/v1/approval-workflows/stats

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

curl -X GET "https://api.salesos.org/v1/approval-workflows/stats" \
  -H "Authorization: Bearer <token>"

List

GET
/v1/approval-workflows

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Query Parameters

entitystring
isActivestring
curl -X GET "https://api.salesos.org/v1/approval-workflows?entity=%3Cstring%3E&isActive=%3Cstring%3E" \
  -H "Authorization: Bearer <token>"

[
  {}
]

Create

POST
/v1/approval-workflows

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
nameRequiredstring
descriptionstring
entityRequiredstring
Value in: "QUOTE" | "DISCOUNT" | "ORDER" | "CONTRACT" | "CUSTOM_OBJECT" | "LEAD" | "CONTACT" | "ACCOUNT" | "OPPORTUNITY" | "CASE" | "TASK"
customObjectNamestring

Required when entity is CUSTOM_OBJECT: the object's API name.

Pattern: "^[a-z][a-z0-9_]{0,62}$"
conditionsarray<object>
isActiveboolean
prioritynumber
Minimum: 0
lockRecordboolean

Lock the record while a request is pending (standard and custom objects; never quotes).

allowRecallboolean
statusFieldstring

Record field that mirrors the request status (null clears it).

statusValuesobject
fieldUpdatesobject

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/approval-workflows" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "description": "string",
    "entity": "QUOTE",
    "customObjectName": "string",
    "conditions": [
      {
        "field": "string",
        "operator": "EQUALS",
        "value": {}
      }
    ],
    "isActive": true,
    "priority": 0,
    "lockRecord": true,
    "allowRecall": true,
    "statusField": "string",
    "statusValues": {
      "PENDING": "string",
      "APPROVED": "string",
      "REJECTED": "string",
      "RECALLED": "string"
    },
    "fieldUpdates": {
      "onSubmit": [
        {
          "field": "string",
          "value": {}
        }
      ],
      "onApprove": [
        {
          "field": "string",
          "value": {}
        }
      ],
      "onReject": [
        {
          "field": "string",
          "value": {}
        }
      ],
      "onRecall": [
        {
          "field": "string",
          "value": {}
        }
      ]
    }
  }'

{}

Find by entity

GET
/v1/approval-workflows/entity/{entity}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

entityRequiredstring
curl -X GET "https://api.salesos.org/v1/approval-workflows/entity/<string>" \
  -H "Authorization: Bearer <token>"

[
  {}
]

Check approval required

GET
/v1/approval-workflows/check/{entityType}/{entityId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

entityTypeRequiredstring
entityIdRequiredstring
curl -X GET "https://api.salesos.org/v1/approval-workflows/check/<string>/<string>" \
  -H "Authorization: Bearer <token>"

{}

Find one

GET
/v1/approval-workflows/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring
curl -X GET "https://api.salesos.org/v1/approval-workflows/<string>" \
  -H "Authorization: Bearer <token>"

{}

Update

PATCH
/v1/approval-workflows/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
namestring
descriptionstring
entitystring
Value in: "QUOTE" | "DISCOUNT" | "ORDER" | "CONTRACT" | "CUSTOM_OBJECT" | "LEAD" | "CONTACT" | "ACCOUNT" | "OPPORTUNITY" | "CASE" | "TASK"
customObjectNamestring
Pattern: "^[a-z][a-z0-9_]{0,62}$"
conditionsarray<object>
isActiveboolean
prioritynumber
Minimum: 0
lockRecordboolean

Lock the record while a request is pending (standard and custom objects; never quotes).

allowRecallboolean
statusFieldstring

Record field that mirrors the request status (null clears it).

statusValuesobject
fieldUpdatesobject

Path Parameters

idRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X PATCH "https://api.salesos.org/v1/approval-workflows/<string>" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "description": "string",
    "entity": "QUOTE",
    "customObjectName": "string",
    "conditions": [
      {
        "field": "string",
        "operator": "EQUALS",
        "value": {}
      }
    ],
    "isActive": true,
    "priority": 0,
    "lockRecord": true,
    "allowRecall": true,
    "statusField": "string",
    "statusValues": {
      "PENDING": "string",
      "APPROVED": "string",
      "REJECTED": "string",
      "RECALLED": "string"
    },
    "fieldUpdates": {
      "onSubmit": [
        {
          "field": "string",
          "value": {}
        }
      ],
      "onApprove": [
        {
          "field": "string",
          "value": {}
        }
      ],
      "onReject": [
        {
          "field": "string",
          "value": {}
        }
      ],
      "onRecall": [
        {
          "field": "string",
          "value": {}
        }
      ]
    }
  }'

{}

Delete

DELETE
/v1/approval-workflows/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring
curl -X DELETE "https://api.salesos.org/v1/approval-workflows/<string>" \
  -H "Authorization: Bearer <token>"

Clone

POST
/v1/approval-workflows/{id}/clone

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
nameRequiredstring

Path Parameters

idRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/approval-workflows/<string>/clone" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string"
  }'

{}

Toggle active

POST
/v1/approval-workflows/{id}/toggle-active

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/approval-workflows/<string>/toggle-active" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>"

{}

Add step

POST
/v1/approval-workflows/{workflowId}/steps

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
orderRequirednumber
Minimum: 1
nameRequiredstring
descriptionstring
approverTypeRequiredstring
Value in: "USER" | "ROLE" | "MANAGER" | "SKIP_LEVEL_MANAGER"
approverIdstring
roleIdstring
autoApproveAfterHoursnumber
Minimum: 1
autoRejectAfterHoursnumber
Minimum: 1
requireCommentboolean
allowDelegationboolean

Path Parameters

workflowIdRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/approval-workflows/<string>/steps" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "order": 1,
    "name": "string",
    "description": "string",
    "approverType": "USER",
    "approverId": "string",
    "roleId": "string",
    "autoApproveAfterHours": 1,
    "autoRejectAfterHours": 1,
    "requireComment": true,
    "allowDelegation": true
  }'

{}

Update step

PATCH
/v1/approval-workflows/{workflowId}/steps/{stepId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
ordernumber
Minimum: 1
namestring
descriptionstring
approverTypestring
Value in: "USER" | "ROLE" | "MANAGER" | "SKIP_LEVEL_MANAGER"
approverIdstring
roleIdstring
autoApproveAfterHoursnumber
Minimum: 1
autoRejectAfterHoursnumber
Minimum: 1
requireCommentboolean
allowDelegationboolean

Path Parameters

workflowIdRequiredstring
stepIdRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X PATCH "https://api.salesos.org/v1/approval-workflows/<string>/steps/<string>" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "order": 1,
    "name": "string",
    "description": "string",
    "approverType": "USER",
    "approverId": "string",
    "roleId": "string",
    "autoApproveAfterHours": 1,
    "autoRejectAfterHours": 1,
    "requireComment": true,
    "allowDelegation": true
  }'

{}

Delete step

DELETE
/v1/approval-workflows/{workflowId}/steps/{stepId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

workflowIdRequiredstring
stepIdRequiredstring
curl -X DELETE "https://api.salesos.org/v1/approval-workflows/<string>/steps/<string>" \
  -H "Authorization: Bearer <token>"

Reorder steps

POST
/v1/approval-workflows/{workflowId}/steps/reorder

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
stepIdsRequiredarray<string>

Path Parameters

workflowIdRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/approval-workflows/<string>/steps/reorder" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "stepIds": [
      "string"
    ]
  }'

[
  {}
]