SalesOS

Flows

Run screen flows: start, resume, submit screens, go back, cancel

Active flows (optionally for one launch context)

GET
/v1/flows

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

statusstring
Value in: "ACTIVE"
contextstring

e.g. record:LEAD, list:ACCOUNT, page, standalone.

curl -X GET "https://api.salesos.org/v1/flows?status=ACTIVE&context=%3Cstring%3E" \
  -H "Authorization: Bearer <token>"

{
  "data": [
    {
      "id": "string",
      "apiName": "string",
      "label": "string",
      "description": "string",
      "type": "SCREEN",
      "launchContexts": [
        "string"
      ]
    }
  ]
}

Your paused interviews, to resume

GET
/v1/flows/interviews

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/flows/interviews" \
  -H "Authorization: Bearer <token>"

{
  "data": [
    {
      "id": "string",
      "flowId": "string",
      "flowApiName": "string",
      "flowLabel": "string",
      "status": "string",
      "currentElement": "string",
      "updatedAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ]
}

Start a flow (runs to its first screen or the end)

POST
/v1/flows/{idOrApiName}/interviews

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
recordIdstring
Maximum length: 64
objectTypestring

LEAD, CONTACT, ACCOUNT, OPPORTUNITY, TASK or custom:.

Pattern: "^(LEAD|CONTACT|ACCOUNT|OPPORTUNITY|TASK|CASE|lead|contact|account|opportunity|task|custom:[a-z][a-z0-9_]{0,62})$"
recordIdsarray<string>

List actions: the selected record ids (become the recordIds collection). Items: at most 1000.

inputsobject

Values for input variables.

debugboolean

Admins: run with the variable inspector and trace.

dryRunboolean

Admins (debug): skip record writes, actions and email.

versionIdstring

Admins (debug): run this version (e.g. the draft) instead of the active one.

Path Parameters

idOrApiNameRequiredstring

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/flows/<string>/interviews" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "recordId": "string",
    "objectType": "string",
    "recordIds": [
      "string"
    ],
    "inputs": {},
    "debug": true,
    "dryRun": true,
    "versionId": "string"
  }'

{
  "id": "string",
  "flowId": "string",
  "flowApiName": "string",
  "flowLabel": "string",
  "version": 0,
  "status": "RUNNING",
  "revision": 0,
  "debug": true,
  "screen": {
    "elementId": "string",
    "label": "string",
    "nextLabel": "string",
    "fields": [
      {
        "name": "string",
        "type": "string",
        "label": "string",
        "helpText": "string",
        "required": true,
        "value": {},
        "text": "string",
        "options": [
          {
            "value": "string",
            "label": "string"
          }
        ],
        "multiple": true,
        "controllingField": "string",
        "dependentValues": {
          "property1": [
            "string"
          ],
          "property2": [
            "string"
          ]
        },
        "lookupObject": "string",
        "min": 0,
        "max": 0,
        "maxLength": 0,
        "visibleWhen": {}
      }
    ],
    "canGoBack": true,
    "isLast": true
  },
  "message": "string",
  "error": {
    "code": "string",
    "message": "string",
    "elementId": "string"
  },
  "outputs": {}
}

Resume: the interview’s current screen or result

GET
/v1/flows/interviews/{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/flows/interviews/<string>" \
  -H "Authorization: Bearer <token>"

{
  "id": "string",
  "flowId": "string",
  "flowApiName": "string",
  "flowLabel": "string",
  "version": 0,
  "status": "RUNNING",
  "revision": 0,
  "debug": true,
  "screen": {
    "elementId": "string",
    "label": "string",
    "nextLabel": "string",
    "fields": [
      {
        "name": "string",
        "type": "string",
        "label": "string",
        "helpText": "string",
        "required": true,
        "value": {},
        "text": "string",
        "options": [
          {
            "value": "string",
            "label": "string"
          }
        ],
        "multiple": true,
        "controllingField": "string",
        "dependentValues": {
          "property1": [
            "string"
          ],
          "property2": [
            "string"
          ]
        },
        "lookupObject": "string",
        "min": 0,
        "max": 0,
        "maxLength": 0,
        "visibleWhen": {}
      }
    ],
    "canGoBack": true,
    "isLast": true
  },
  "message": "string",
  "error": {
    "code": "string",
    "message": "string",
    "elementId": "string"
  },
  "outputs": {}
}

Submit the current screen (validated server-side) and continue

POST
/v1/flows/interviews/{id}/next

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
revisionRequirednumber
Minimum: 0
valuesobject

Screen field name → value.

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/flows/interviews/<string>/next" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "revision": 0,
    "values": {}
  }'

{
  "id": "string",
  "flowId": "string",
  "flowApiName": "string",
  "flowLabel": "string",
  "version": 0,
  "status": "RUNNING",
  "revision": 0,
  "debug": true,
  "screen": {
    "elementId": "string",
    "label": "string",
    "nextLabel": "string",
    "fields": [
      {
        "name": "string",
        "type": "string",
        "label": "string",
        "helpText": "string",
        "required": true,
        "value": {},
        "text": "string",
        "options": [
          {
            "value": "string",
            "label": "string"
          }
        ],
        "multiple": true,
        "controllingField": "string",
        "dependentValues": {
          "property1": [
            "string"
          ],
          "property2": [
            "string"
          ]
        },
        "lookupObject": "string",
        "min": 0,
        "max": 0,
        "maxLength": 0,
        "visibleWhen": {}
      }
    ],
    "canGoBack": true,
    "isLast": true
  },
  "message": "string",
  "error": {
    "code": "string",
    "message": "string",
    "elementId": "string"
  },
  "outputs": {}
}

Return to the previous screen (when no write happened since)

POST
/v1/flows/interviews/{id}/back

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
revisionRequirednumber
Minimum: 0

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/flows/interviews/<string>/back" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "revision": 0
  }'

{
  "id": "string",
  "flowId": "string",
  "flowApiName": "string",
  "flowLabel": "string",
  "version": 0,
  "status": "RUNNING",
  "revision": 0,
  "debug": true,
  "screen": {
    "elementId": "string",
    "label": "string",
    "nextLabel": "string",
    "fields": [
      {
        "name": "string",
        "type": "string",
        "label": "string",
        "helpText": "string",
        "required": true,
        "value": {},
        "text": "string",
        "options": [
          {
            "value": "string",
            "label": "string"
          }
        ],
        "multiple": true,
        "controllingField": "string",
        "dependentValues": {
          "property1": [
            "string"
          ],
          "property2": [
            "string"
          ]
        },
        "lookupObject": "string",
        "min": 0,
        "max": 0,
        "maxLength": 0,
        "visibleWhen": {}
      }
    ],
    "canGoBack": true,
    "isLast": true
  },
  "message": "string",
  "error": {
    "code": "string",
    "message": "string",
    "elementId": "string"
  },
  "outputs": {}
}

Cancel an interview

POST
/v1/flows/interviews/{id}/cancel

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/flows/interviews/<string>/cancel" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>"

{
  "id": "string",
  "flowId": "string",
  "flowApiName": "string",
  "flowLabel": "string",
  "version": 0,
  "status": "RUNNING",
  "revision": 0,
  "debug": true,
  "screen": {
    "elementId": "string",
    "label": "string",
    "nextLabel": "string",
    "fields": [
      {
        "name": "string",
        "type": "string",
        "label": "string",
        "helpText": "string",
        "required": true,
        "value": {},
        "text": "string",
        "options": [
          {
            "value": "string",
            "label": "string"
          }
        ],
        "multiple": true,
        "controllingField": "string",
        "dependentValues": {
          "property1": [
            "string"
          ],
          "property2": [
            "string"
          ]
        },
        "lookupObject": "string",
        "min": 0,
        "max": 0,
        "maxLength": 0,
        "visibleWhen": {}
      }
    ],
    "canGoBack": true,
    "isLast": true
  },
  "message": "string",
  "error": {
    "code": "string",
    "message": "string",
    "elementId": "string"
  },
  "outputs": {}
}