API reference

Preview

DealSleek API

Run the same commands the DealSleek app runs: create and update leads, accounts, deals, contracts and the records around them.

Version
1.0.0-preview
Endpoints
423
Areas
14
Open API Explorer

Base address

Requests go to your own workspace address, the one you sign in at.

Authentication

Send the access token of a signed-in user as a Bearer token. The token identifies the user, their role and the workspace, so no tenant header is needed. Each command states the minimum role it requires.

How the API behaves

One address per domain
Every command of a domain is sent to the same address, POST /api/v1/{domain}/dispatch. The X-CQRS-Action header names the command and the JSON body carries its fields.
The workspace comes from the token
The access token decides which workspace a command acts on. A tenant sent in a header is ignored.
Guarded updates
Where a command lists expected_version, send the version of the record you last read. If the record has changed since, the command is refused with 409 and nothing is written.
Retries
Send X-Idempotency-Key with a value unique to the attempt. A command repeated with the same key is not applied a second time.
Success is 202
A command that was applied answers 202 Accepted with a JSON body.

Headers on every request

Each endpoint page lists these again, with any header that is its own.

  • AuthorizationstringRequired

    Access token of the signed-in user, as a Bearer token. It identifies the user, their role and the workspace.

  • Content-TypestringRequired

    Always application/json.

  • X-Idempotency-KeystringOptional

    A key you choose that is unique to this attempt. A command repeated with the same key is not applied a second time.

  • X-Correlation-IdstringOptional

    Your own identifier for the request. Returned in the x-correlation-id response header; generated when you leave it out.

Errors every endpoint can return

Every error carries an HTTP status. Where it also carries a code, branch on the code, not on the message.

  • 400DOMAIN_ROUTINGThe body is not a valid command. Check the required fields and their types.
  • 401The access token is missing, expired or not valid.
  • 403L1_POLICYA business rule refused the command. The message names the rule.
  • 409L1_IDEMPOTENCYA command with this idempotency key was already applied.
  • 409CONFLICTThe command would duplicate a record that must be unique.
  • 500L3_COMMITThe command was valid but could not be saved.

All endpoints