Interim API documentation

While we build permanent documentation for our API, this document contains information on our main endpoints.

Where can I kick the tires?
visit sweetprocess.com/api/v1/ (whilst logged in to your SweetProcess account)

You'll see listed all of the APIs that we use to build SweetProcess. Historically these have not been made known to customers, but we are changing that starting with this document.

How would I authenticate with the API
You may use a token in the Authorization header of your request to the SweetProcess API. To get a token, visit

sweetprocess.com/accounts/tokens/

Create your secret token and include it in the Authorization header to the SweetProcess API. For example:
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b 
Here is an example using the curl program
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' https://www.sweetprocess.com/api/v1/procedures/
And another example using the Python programming language (and using the 3rd party requests library)
import requests

response = requests.get(
    'https://www.sweetprocess.com/api/v1/procedures/',
    headers={'Authorization': 'Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'}
)
print(response.json())

Procedures
sweetprocess.com/api/v1/procedures/

Provides a paginated list of procedures that the current user has access to.

Filters
team_id - filter to procedures within the given team
search - search for a procedure
tag - procedures with the given tag(s) separated by comma
policy_id - procedures with the attached policy
visible_to_user - procedures that you can see and the requested user can see
ordering - rank,name,modified_at,approved_at,last_review_at add a minus symbol to reverse the order (e.g. -rank is required for ordering search relevance)

Example using some filters
https://www.sweetprocess.com/api/v1/procedures/?tag=accounts,tax&team_id=200000&search=quarterly&ordering=-rank

Each filter is separated by an ampersand (&) and the start of the filters is indicated with a question mark (?). You should not use the same filter twice e.g. search=holidays&search=christmas as the second would overwrite the first.

Taskinstances
sweetprocess.com/api/v1/taskinstances/

Provides a paginated list of taskinstances - you must use filters to find what you are looking for. A taskinstance is a specific task run at a specific time. Compare this with a Task Template which describes a series of recurring tasks (how often it recurs etc).

Why can't I see tasks that I think I should be able to see?
Our backend will automatically filter tasks to the ones you have permission to see. This is tasks that were assigned to you or by you to someone else.
However we have an option that your account owner can turn on. It will allow teammates to see co-worker's tasks if they have permission to see the procedure/process assigned. Your account owner can find this setting in the account overview area:
Teammates can see all tasks for documents they have permission to see. Even if they were not assigned to the task.
local.sweetprocess.com/accounts/overview/

Why am I being shown very old tasks? Where are all the new ones?
You must filter by date. Please use both the due__gte (due date greater than or equal to) and due__lte (due date less than or equal to) to filter your results. This will ensure the API is returning the date range that you want to see. Otherwise the default would be to show you oldest to newest. We can't sort by newest to oldest because some tasks don't end and there would be tasks due in the year 9999 being returned!

Filters
template_id - just taskinstances belonging to the given task template
user - tasks assigned to this user (use the user's api url e.g. /api/v1/users/3/)
content_type/object_id - filter for a particular document e.g. content_type=procedure&object_id=23
completed - true/false filter for completed task instances
due__lte / due__gte - taskinstances with a due date between these two dates. This might be the most useful filter. The date should be in iso8601 format 'YYYY-MM-DDTHH:MM:SSZ'. due__lte stands for due date less than or equal to, due__gte stands for due date greater than or equal to

example using some filters
https://www.sweetprocess.com/api/v1/taskinstances/?completed=false&due__gte=2020-01-01T00:00:00Z&due__lte=2020-02-01T00:00:00Z

example fetching previous month if this is May 2025 (fetching April 2025)

https://www.sweetprocess.com/api/v1/taskinstances/?due__gte=2025-04-01T00:00:00Z&due__lte=2025-05-01T00:00:00Z
the important parts are due__gte and due__lte. I've made sure the date is greater than April 1st 2025 and less than May 1st 2025. This would give me all the results for April 2025



If you still have a question, we’re here to help. Contact us.