Skip to content

Sortly API (1.0.0)

Sortly API can be used to manage items and folders in your Sortly account. Our API is organized around REST. It returns JSON-encoded responses and uses standard HTTP response codes. This API is only available on Sortly Enterprise Plan subscription.

NOTE:

  • This feature is currently under beta. Please expect minor updates in the near future.

  • Contact dev-support@sortly.com for developer support.

Authentication

Authentication to the API is performed via OAuth 2.0. Under this, you must provide your secret key as the Bearer token in the Authorization header. All requests must be made over HTTPS.

Getting Started
  • Visit: https://app.sortly.com/public-api to obtain an API access key pair for your account.

  • Use the secret key as the Bearer token.

Rate Limiting

Sortly API calls are rate limited. You can make 1000 requests per API in a 15-minute window. Rate limit information in available in the HTTP headers of the API response.

HeaderDescription
Sortly-Rate-Limit-MaxMaximum number of requests allowed within the 15-minute window
Sortly-Rate-Limit-RemainingNumber of requests remaining in the current 15-minute window
Sortly-Rate-Limit-ResetThe time at which the current rate limit window resets.(in seconds)

Once you go over the rate limit you will receive a HTTP 429 Too Many Requests error response.

Download OpenAPI description
Languages
Servers
Mock server
https://developer.sortly.com/_mock
https://api.sortly.co

Items

Operations

Item Groups

Operations

Units of Measure

Operations

Custom Fields

Operations

Alerts

Operations

List Alerts

Request

Query
per_pagenumber

Page size | Defaults to 10

Example: per_page=2
pagenumber

Page number | Defaults to 1

Example: page=1
Headers
Acceptstring

e.g. application/json

Example: application/json
Authorizationstring

e.g. Bearer

Example: Bearer <Enter Secret Key Here>
curl -i -X GET \
  'https://developer.sortly.com/_mock/api/v1/alerts?per_page=2&page=1' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <Enter Secret Key Here>'

Responses

OK

Headers
Sortly-Rate-Limit-Maxstring
Sortly-Rate-Limit-Remainingstring
Sortly-Rate-Limit-Resetstring
Body
Response
No content

Create an Alert

Request

Headers
Acceptstring

e.g. application/json

Example: application/json
Authorizationstring

e.g. Bearer

Example: Bearer <Enter Secret Key Here>
Bodyapplication/json
idnumber

ID of the instance

typestring

could be 'Quantity' or 'DateReminder'

threshold_methodstring

Allowed values for Quantity type: [ 'less_than_or_equal_to_min_quantity', 'quantity_greater_than', 'quantity_less_than', 'quantity_less_than_equal_to', 'quantity_greater_than_equal_to' ]; Allowed values for DateReminder type: [ 'before', 'after', 'same_day' ]

threshold_valuenumber
threshold_intervalstring

should be specified for DateReminder alerts. Could be one of ["days", "weeks", "months", "years"]

recipient_groupsArray of objects

describes the group which will be notified when alert triggers. If not specified 'owners' is added by default.

Allowed values: [ 'owners', 'admins', 'members ]

triggerable_typestring

specifies a resource it should applied to. Could be either 'Node' for 'Quantity' type or 'CustomAttributeValue' for 'DateReminder' type. The CustomField should be of datetime field.

triggerable_idnumber

specifies the ID of the resource either Item or CustomField

is_deletedboolean

specifies whether the alert is deleted or not.

is_firedboolean

specifies if the notification was sent to the recipient group or not.

curl -i -X POST \
  https://developer.sortly.com/_mock/api/v1/alerts \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <Enter Secret Key Here>' \
  -H 'Content-Type: application/json' \
  -d '{
    "threshold_method": "quantity_less_than",
    "threshold_value": 5,
    "threshold_interval": 0,
    "is_fired": true,
    "triggerable_type": "Node",
    "triggerable_id": 356,
    "type": "Quantity",
    "is_deleted": false,
    "recipient_groups": [
      "owners"
    ]
  }'

Responses

OK

Headers
Sortly-Rate-Limit-Maxstring
Sortly-Rate-Limit-Remainingstring
Sortly-Rate-Limit-Resetstring
Bodyapplication/json
dataobject
Response
application/json
{ "data": { "item_id": 55, "custom_attribute_id": null, "threshold_method": "quantity_less_than", "threshold_value": 5, "threshold_interval": null, "is_fired": null, "type": "Quantity", "is_deleted": false, "recipient_groups": [] } }

Update an Alert

Request

Headers
Acceptstring

e.g. application/json

Example: application/json
Authorizationstring

e.g. Bearer

Example: Bearer <Enter Secret Key Here>
Bodyapplication/json
idnumber

ID of the instance

typestring

could be 'Quantity' or 'DateReminder'

threshold_methodstring

Allowed values for Quantity type: [ 'less_than_or_equal_to_min_quantity', 'quantity_greater_than', 'quantity_less_than', 'quantity_less_than_equal_to', 'quantity_greater_than_equal_to' ]; Allowed values for DateReminder type: [ 'before', 'after', 'same_day' ]

threshold_valuenumber
threshold_intervalstring

should be specified for DateReminder alerts. Could be one of ["days", "weeks", "months", "years"]

recipient_groupsArray of objects

describes the group which will be notified when alert triggers. If not specified 'owners' is added by default.

Allowed values: [ 'owners', 'admins', 'members ]

triggerable_typestring

specifies a resource it should applied to. Could be either 'Node' for 'Quantity' type or 'CustomAttributeValue' for 'DateReminder' type. The CustomField should be of datetime field.

triggerable_idnumber

specifies the ID of the resource either Item or CustomField

is_deletedboolean

specifies whether the alert is deleted or not.

is_firedboolean

specifies if the notification was sent to the recipient group or not.

curl -i -X PUT \
  'https://developer.sortly.com/_mock/api/v1/alerts/{alert_id}' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <Enter Secret Key Here>' \
  -H 'Content-Type: application/json' \
  -d '{
    "item_id": 55,
    "custom_attribute_id": 22,
    "threshold_method": "before",
    "threshold_value": 5,
    "threshold_interval": "days",
    "is_fired": null,
    "type": "DateReminder",
    "is_deleted": false,
    "recipient_groups": [
      "owners"
    ]
  }'

Responses

OK

Headers
Sortly-Rate-Limit-Maxstring
Sortly-Rate-Limit-Remainingstring
Sortly-Rate-Limit-Resetstring
Bodyapplication/json
dataobject
Response
application/json
{ "data": { "id": 1234, "threshold_method": "before", "threshold_value": 5, "threshold_interval": "days", "is_fired": null, "triggerable_type": "CustomAttributeValue", "triggerable_id": 374, "type": "DateReminder", "is_deleted": false, "recipient_groups": [] } }

Delete Alert

Request

Path
alert_idstringrequired

an alert ID attribute

Example: 3
Headers
Acceptstring

e.g. application/json

Example: application/json
Authorizationstring

e.g. Bearer

Example: Bearer <Enter Secret Key Here>
curl -i -X DELETE \
  https://developer.sortly.com/_mock/api/v1/alerts/3 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <Enter Secret Key Here>'

Responses

OK

Bodyapplication/json
object
Response
application/json
{}