API reference

Clients

Provision client workspaces under an MSP, each with one verification app and an app key, and update or delete them.

A client workspace (workspace_type msp_client) is the isolated tenant for one of an MSP's customers. Creating one creates, in one transaction, the workspace, its single app (tenant_mode verify_only), an app key for that app and, when you send webhook_url, a webhook endpoint.

Two endpoint families do this:

FamilyPath workspaceResponse wrapper
/v1/workspaces/:workspace_id/clientsThe MSP workspace (UUID or slug)client_workspace
/v1/workspaces/:workspace_id/childrenThe Master workspace with msp_id in the body, or the MSP workspacechild_workspace

Each response object is the client app's fields (as returned by the app endpoints: name, origin, callback_url, logo, slug, primary_color, custom_domain and others) merged with the workspace fields. Where both have a field, the workspace value wins: id is the workspace UUID and the app's public ID is in app_id.

Authentication#

Send a workspace key in Authorization. These endpoints do not read X-Authorization, so you can send the same header pair as the MSP endpoints.

  • /clients: the key must belong to the MSP workspace in the URL or to its direct parent (the Master). App keys are not accepted.
  • /children: the key must belong to the workspace in the URL or to its direct parent. An app key works for reads and writes on the workspace its app is in.
StatusBodyWhen
401No valid key
403Workspace key does not match path workspace/clients: the key is neither the MSP's nor its parent's
403Not authorized for this workspace/children: the key does not reach the URL workspace
403error_code feature_not_availableThe plan does not include client workspaces
404MSP Workspace not found / Parent workspace not foundThe URL workspace does not exist
422Endpoint requires an MSP Workspace id/clients: the URL workspace is not an MSP

Create a client#

POST/v1/workspaces/:workspace_id/clientsWorkspace key
workspace_idstringrequired
UUID or slug of the MSP workspace.
namestring
Workspace name. Defaults to branding_display_name, then Child Workspace.
branding_display_namestring
Name end users see. Also the app's name. Defaults to name.
branding_colorstring
Hex color. Also the app's email color. The app defaults to #4F46E5.
branding_logo_urlstring
Public URL of a logo image.
countriesstring[]
ISO 3166-1 alpha-2 codes allowed for SMS, for example ["us", "ca"]. Empty means no restriction.
magic_link_expiryinteger
Magic link lifetime in seconds. Default 900. Accepted range: 1 minute to 7 days.
originstring
Allowed origin of the app. Default https://verify.scute.io.
verification_modestring
What the verification page does after success. Default dismiss.
verification_redirect_url_templatestring
URL the person is sent to after verifying.
verification_redirect_delayinteger
Seconds before the redirect. Default 4.
verification_success_messagestring
Message shown after a successful verification.
webhook_urlstring
Creates a webhook endpoint on the new app, subscribed to the 12 SMS and email verification events: verification.sms.* and verification.email.* for requested, verified, expired, failed, denied and delivery_failed.
Requestbash
curl -X POST https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "Wayne Industries",    "branding_color": "#0c2340",    "countries": ["us", "ca"],    "webhook_url": "https://example.com/scute/webhook"  }'
Response 201json
{  "client_workspace": {    "id": "0193f8aa-5555-7666-8777-888888888888",    "app_id": "app_3mxZRrzWxhPZ08dXvqq6",    "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444",    "parent_workspace_id": "0193f8aa-1111-7222-8333-444444444444",    "workspace_name": "Wayne Industries",    "workspace_slug": "wayne-industries",    "workspace_type": "msp_client",    "countries": ["us", "ca"],    "name": "Wayne Industries",    "origin": "https://verify.scute.io",    "primary_color": "#0c2340",    "api_key_token": "scapp_xxxxxxxxxxxxxxxxxxxxx",    "api_key_id": 4821  }}

The example shows a subset of the app fields.

Store the app key

api_key_token is the app key of the client's app. Only this response returns it.

A validation failure returns 422 with the message in error.

Create a client (Master path)#

Creates the same resources with the Master workspace in the URL. Send msp_id to place the client under that MSP. Without msp_id, the call creates a child of the URL workspace itself: on a Master that is an MSP workspace (with a workspace key named "MSP key" in api_key_token), not a client.

POST/v1/workspaces/:workspace_id/childrenWorkspace key
workspace_idstringrequired
UUID or slug of the Master or MSP workspace.
msp_idstring
The MSP's msp_... public ID. Required to create a client from the Master.

The other body fields are the ones listed under Create a client.

Requestbash
curl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/children \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "Content-Type: application/json" \  -d '{"name": "Wayne Industries", "msp_id": "msp_a4b2c1KQ7nVx9LpRsT2u", "countries": ["us"]}'
Response 201json
{  "child_workspace": {    "id": "0193f8aa-5555-7666-8777-888888888888",    "app_id": "app_3mxZRrzWxhPZ08dXvqq6",    "parent_workspace_id": "0193f8aa-1111-7222-8333-444444444444",    "name": "Wayne Industries",    "slug": "wayne-industries",    "workspace_name": "Wayne Industries",    "workspace_slug": "wayne-industries",    "workspace_type": "msp_client",    "child_workspaces_count": 0,    "branding": { "display_name": "Wayne Industries", "color": null, "logo_url": null },    "msp_id": "msp_a4b2c1KQ7nVx9LpRsT2u",    "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444",    "msp_public_id": null,    "countries": ["us"],    "api_key_token": "scapp_xxxxxxxxxxxxxxxxxxxxx",    "api_key_id": 4821  }}

A standard workspace in the URL becomes an MSP when a key creates its first child; the response then has "workspace_became_msp": true.

Statuserror_codeWhen
404msp_not_foundmsp_id is not an MSP under the URL workspace
422msp_workspace_missingThe MSP has no workspace
422Validation failure, or the workspace cannot create children

List clients#

Lists the client workspaces of an MSP.

GET/v1/workspaces/:workspace_id/clientsWorkspace key
Requestbash
curl https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY"
Response 200json
{  "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444",  "clients": [    {      "id": "0193f8aa-5555-7666-8777-888888888888",      "app_id": "app_3mxZRrzWxhPZ08dXvqq6",      "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444",      "parent_workspace_id": "0193f8aa-1111-7222-8333-444444444444",      "workspace_name": "Wayne Industries",      "workspace_slug": "wayne-industries",      "workspace_type": "msp_client",      "countries": ["us", "ca"]    }  ]}

GET /v1/workspaces/:workspace_id/children lists every child of the URL workspace in the child_workspace shape, under children, with workspace_id and saml_locks_on_first_client.

Retrieve a client#

GET/v1/workspaces/:workspace_id/clients/:idWorkspace key
workspace_idstringrequired
UUID or slug of the MSP workspace.
idstringrequired
UUID of the client workspace.
Requestbash
curl https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients/0193f8aa-5555-7666-8777-888888888888 \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY"

Returns {"client_workspace": {...}}. An unknown client returns 404 with Client Workspace not found. GET /v1/workspaces/:workspace_id/children/:id returns {"child_workspace": {...}}.

Update a client#

Send only the fields to change. Fields sent as an empty string are ignored, except countries: an empty array clears the list.

PATCH/v1/workspaces/:workspace_id/clients/:idWorkspace key
namestring
Workspace name. Does not change branding_display_name.
branding_display_namestring
Name end users see. Also renames the app. Does not change name.
branding_colorstring
Hex color, also applied to the app.
branding_logo_urlstring
Logo URL, also applied to the app.
countriesstring[]
Replaces the SMS country list.
originstring
Allowed origin of the app.
magic_link_expiryinteger
Magic link lifetime in seconds.
verification_modestring
What the verification page does after success.
verification_redirect_url_templatestring
Redirect URL after verifying.
verification_redirect_delayinteger
Seconds before the redirect.
verification_success_messagestring
Message shown after success.
webhook_urlstring
Replaces the URL of the app's first webhook endpoint, or creates one subscribed to the 12 verification events when the app has none.

The fields may also be nested under a client_workspace object.

Requestbash
curl -X PATCH https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients/0193f8aa-5555-7666-8777-888888888888 \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "Content-Type: application/json" \  -d '{"branding_color": "#059669", "countries": ["us", "ca", "gb"]}'

Returns 200 with {"client_workspace": {...}}.

StatusWhen
404The client is not under the MSP
422No updatable field was sent, or a value failed validation

PATCH /v1/workspaces/:workspace_id/children/:id takes branding_display_name (also sets name), branding_color, branding_logo_url, countries, msp_id (an empty value unlinks the MSP), magic_link_expiry, verification_mode, verification_redirect_url_template, verification_redirect_delay and verification_success_message.

Delete a client#

Soft-deletes the client workspace and its app. Challenges against the app stop working. The rows are kept with discarded_at set.

DELETE/v1/workspaces/:workspace_id/clients/:idWorkspace key
Requestbash
curl -X DELETE https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients/0193f8aa-5555-7666-8777-888888888888 \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY"

Returns 204 with no body. DELETE /v1/workspaces/:workspace_id/children/:id does the same for any child of the URL workspace.