Dashly Docs

Lost reasons

`/lost-reasons`

List lost reasons

GET
/lost-reasons

One page of records, newest first unless you say otherwise, with the total count in meta so you know how far to paginate.

Required scope: lost-reasons:read.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your agency's API key: Authorization: Bearer ak_…. Created in Connectors → API & webhooks and shown once. A key authenticates an agency, not a person.

Query Parameters

page?integer

1-based. meta.totalPages says how many there are.

Range1 <= value
Default1
per_page?integer

Rows per page. A value above 200 returns 400 - never a silent clamp.

Range1 <= value <= 200
Default50
sort?string

Prefix with - for descending. An undeclared sort returns 400.

Default"position"
Value in"position""-position""label""-label""createdAt""-createdAt"
q?string

Case-insensitive "contains", across: label.

filter[archived]?string

Exact match on archived.

Value in"true""false"

Response Body

The requested page.

application/json
  1. response
data*array<>
meta*
Example Request
curl -X GET 'https://api.usedashly.com/v1/lost-reasons'
Example Response
{  "data": [    {      "id": "string",      "label": "string",      "position": 0,      "archived": true,      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "meta": {    "page": 0,    "perPage": 0,    "total": 0,    "totalPages": 0  }}

Create a lost reason

POST
/lost-reasons

Links are given as the target's public id (clientId: "hsbftmp3f5"); the API resolves them server-side. Fields the database requires but the interface decides for you are filled in the same way here.

Required scope: lost-reasons:write.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your agency's API key: Authorization: Bearer ak_…. Created in Connectors → API & webhooks and shown once. A key authenticates an agency, not a person.

Header Parameters

Idempotency-Key?string

A value you choose (a UUID is the usual one), 8 to 255 characters of A-Z a-z 0-9 _ . : -. Retrying with the same key returns the first call's answer instead of creating a second record, for seven days. The same key with a different body returns 409.

Length8 <= length <= 255

Request Body

application/json
  1. body
label*string
Length1 <= length <= 80
createdAt?string

When this actually happened, for an import. Past dates only; defaults to now. updatedAt follows it unless the body sets one.

Formatdate-time

Response Body

Created. The body is the new record, as a read would return it.

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.usedashly.com/v1/lost-reasons' \  -H 'Content-Type: application/json' \  -d '{  "label": "string"}'
Example Response
{  "data": {    "id": "string",    "label": "string",    "position": 0,    "archived": true,    "createdAt": "2019-08-24T14:15:22Z"  }}

Retrieve a lost reason

GET
/lost-reasons/{id}

The full record, custom fields included when the resource carries them. A record from another agency is a 404, not a 403 - its existence is not ours to confirm.

Required scope: lost-reasons:read.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your agency's API key: Authorization: Bearer ak_…. Created in Connectors → API & webhooks and shown once. A key authenticates an agency, not a person.

Path Parameters

id*string

The record's public id (hsbftmp3f5), as returned in the id field. An internal UUID returns 404.

Response Body

Found.

application/json
  1. response
data*
Example Request
curl -X GET 'https://api.usedashly.com/v1/lost-reasons/string'
Example Response
{  "data": {    "id": "string",    "label": "string",    "position": 0,    "archived": true,    "createdAt": "2019-08-24T14:15:22Z"  }}

Update a lost reason

PATCH
/lost-reasons/{id}

A partial update: only the fields you send change. One exception - customFields is replaced wholesale, not merged, so sending it with a single key clears the others. Read the record, merge, then write.

Required scope: lost-reasons:write.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your agency's API key: Authorization: Bearer ak_…. Created in Connectors → API & webhooks and shown once. A key authenticates an agency, not a person.

Path Parameters

id*string

The record's public id (hsbftmp3f5), as returned in the id field. An internal UUID returns 404.

Request Body

application/json
  1. body
label?string
Length1 <= length <= 80
archived?boolean

Response Body

Updated. The body is the record as it now stands.

application/json
  1. response
data*
Example Request
curl -X PATCH 'https://api.usedashly.com/v1/lost-reasons/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "data": {    "id": "string",    "label": "string",    "position": 0,    "archived": true,    "createdAt": "2019-08-24T14:15:22Z"  }}

Delete a lost reason

DELETE
/lost-reasons/{id}

Permanent. The audit log keeps the trace; the record does not come back.

Required scope: lost-reasons:write.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your agency's API key: Authorization: Bearer ak_…. Created in Connectors → API & webhooks and shown once. A key authenticates an agency, not a person.

Path Parameters

id*string

The record's public id (hsbftmp3f5), as returned in the id field. An internal UUID returns 404.

Response Body

Deleted. Empty body.

Example Request
curl -X DELETE 'https://api.usedashly.com/v1/lost-reasons/string'
Example Response
Empty

List available actions

GET
/lost-reasons/actions

Every verb this resource answers to, with its target and the JSON Schema of its body - the same contracts this document describes, readable at runtime.

Required scope: lost-reasons:read.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your agency's API key: Authorization: Bearer ak_…. Created in Connectors → API & webhooks and shown once. A key authenticates an agency, not a person.

Response Body

The available verbs.

application/json
  1. response
data*array<>
Example Request
curl -X GET 'https://api.usedashly.com/v1/lost-reasons/actions'
Example Response
{  "data": [    {      "name": "string",      "label": "string",      "description": "string",      "target": "item",      "readOnly": true,      "path": "string",      "input": {}    }  ]}

Reorder a lost reason

POST
/lost-reasons/actions/move

Swaps the reason with its neighbour above or below in the catalogue's order. With no neighbour that way, the order is left as it is.

Does what the dashboard's moveLostReasonAction does - same implementation, so the two cannot diverge.

Required scope: lost-reasons:write.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your agency's API key: Authorization: Bearer ak_…. Created in Connectors → API & webhooks and shown once. A key authenticates an agency, not a person.

Header Parameters

Idempotency-Key?string

A value you choose (a UUID is the usual one), 8 to 255 characters of A-Z a-z 0-9 _ . : -. Retrying with the same key returns the first call's answer instead of creating a second record, for seven days. The same key with a different body returns 409.

Length8 <= length <= 255

Request Body

application/json
  1. body
reasonId*string
Length1 <= length <= 60
direction*string
Value in"up""down"

Response Body

Done.

application/json
  1. response
data*unknown

The action's result; its shape depends on the verb.

Example Request
curl -X POST 'https://api.usedashly.com/v1/lost-reasons/actions/move' \  -H 'Content-Type: application/json' \  -d '{  "reasonId": "string",  "direction": "up"}'
Example Response
{  "data": null}