Cases¶
Create cases, read their data, move them through their workflow and delete them.
List the activity log of a case¶
GET /api/1/case_activity_log
Accepts the standard list parameters.
Example
curl -X GET \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/case_activity_log
Response 200
meta(object)pagination(object)
results(array)_created(string, date-time, required, nullable)activity(string, required, nullable)case_id(integer, required)content(string, required)id(integer, required)instance(integer, nullable)message(string, required)needed_document(integer, nullable)user(string, required)user_readable_id(string, required)
List cases¶
GET /api/1/cases
Returns the cases the API key's tenant can see, newest first. Paginated.
Example
curl -X GET \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/cases
Response 200
One page of cases. Each entry carries the case list columns, not the full case.
data(array)calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
meta(object)pagination(object)
{
"data": [
{
"id": 4711,
"name": "Onboarding Jane Doe",
"state_key": "in_review",
"user_readable_id": "#4711"
},
{
"id": 4712,
"name": "Onboarding Acme AG",
"state_key": "draft",
"user_readable_id": "#4712"
}
],
"meta": {
"pagination": {
"count": 24,
"page": 1,
"pages": 3
}
}
}
Create a case¶
POST /api/1/cases
Starts a new case for a process. The rule engine runs before the response is returned, so the response already contains the questions the case asks.
Request body
assignee_email(string, email)name(string)outcome_instance_id(integer)owner_email(string, email)predefined_objects(object)preferred_language_key(string)process_id(integer)process_key(string)transition_with_transition_key(string)
Send at least one of process_id, process_key.
{
"name": "Onboarding Jane Doe",
"owner_email": "advisor@example.com",
"process_key": "onboarding"
}
Example
curl -X POST \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Onboarding Jane Doe", "owner_email": "advisor@example.com", "process_key": "onboarding"}' \
https://your-tenant.atfinity.app/api/1/cases
Response 200
The case. The listed properties are the stable ones. The payload also carries the fields the Atfinity frontend needs, which are not part of this contract and can change.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
List the activity log of a case¶
GET /api/1/cases/{case_pk}/activity_log
Accepts the standard list parameters.
Example
curl -X GET \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/cases/<case_pk>/activity_log
Response 200
meta(object)pagination(object)
results(array)_created(string, date-time, required, nullable)activity(string, required, nullable)case_id(integer, required)content(string, required)id(integer, required)instance(integer, nullable)message(string, required)needed_document(integer, nullable)user(string, required)user_readable_id(string, required)
Comment on a case¶
POST /api/1/cases/{case_pk}/comments
text is the comment body and is required. Set is_issue to raise it as an issue rather
than a plain comment, assigned_user to make it a task for that user, and reply_to to
answer an existing comment.
Request body
assigned_user(integer)deadline(string, date-time)is_issue(boolean)referenced_value(integer)reply_to(integer)text(string, required)title(string)
Example
curl -X POST \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "The passport scan is unreadable.", "title": "Missing proof"}' \
https://your-tenant.atfinity.app/api/1/cases/<case_pk>/comments
Response 200
The case. The listed properties are the stable ones. The payload also carries the fields the Atfinity frontend needs, which are not part of this contract and can change.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
Delete a case¶
DELETE /api/1/cases/{id}
format(string, one ofjson,text)
Example
curl -X DELETE \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/cases/<id>
Response 204
The case, its files and its unused instances are deleted.
Get a case¶
GET /api/1/cases/{id}
The full case: instances, information values, documents, buttons and workflow state.
format(string, one ofjson,text)
Example
curl -X GET \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/cases/<id>
Response 200
The case. The listed properties are the stable ones. The payload also carries the fields the Atfinity frontend needs, which are not part of this contract and can change.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
Sent as text/plain.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
Update a case¶
PATCH /api/1/cases/{id}
Writes field values, the owner, the assignee, the name, the language and the tags. Send only the
keys you want to change. field addresses one value, fields a list of them, and a value is
addressed either by case_field_key, or by information_key together with instance_id. Add
structure_occurrence_index and structure_occurrence_information_key for a value inside a
structure. The rule engine runs afterwards, so the response reflects the recalculated case.
Addressing a structured information without an occurrence index writes the whole structure at
once, and value is then a list with one object per occurrence, in order. Inside such an object
each key is the information key of a component, and __name sets the occurrence name. The list
replaces the occurrences the case has: further objects add occurrences, and occurrences past the
end of the list are deleted together with their values. A list longer than the structure's maximum
number of occurrences is rejected. To copy an occurrence with its files, or to add or remove a
single one without sending the others, use the occurrence operations in
Values instead.
given_name only applies when the case's process allows given names.
format(string, one ofjson,text)
Request body
assignee_email(string, email)assignee_id(integer)field(object)case_field_key(string)information_key(string)instance_id(integer)needed_document_id(integer)remove_file_id(integer)structure_occurrence_index(integer)structure_occurrence_information_key(string)value(object)
fields(array)case_field_key(string)information_key(string)instance_id(integer)needed_document_id(integer)remove_file_id(integer)structure_occurrence_index(integer)structure_occurrence_information_key(string)value(object)
given_name(string)owner_email(string, email)owner_id(integer)preferred_language(string)remove_file(integer)tags(array)id(integer)key(string)
use_given_name(boolean)
{
"fields": [
{
"information_key": "date_of_birth",
"instance_id": 5001,
"value": "1985-04-12"
},
{
"case_field_key": "Person.first_name",
"value": "Jane"
},
{
"information_key": "real_estate",
"instance_id": 5001,
"value": [
{
"__name": "Main residence"
},
{
"__name": "Holiday home"
}
]
}
]
}
Example
curl -X PATCH \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fields": [{"information_key": "date_of_birth", "instance_id": 5001, "value": "1985-04-12"}, {"case_field_key": "Person.first_name", "value": "Jane"}, {"information_key": "real_estate", "instance_id": 5001, "value": [{"__name": "Main residence"}, {"__name": "Holiday home"}]}]}' \
https://your-tenant.atfinity.app/api/1/cases/<id>
Response 200
The case. The listed properties are the stable ones. The payload also carries the fields the Atfinity frontend needs, which are not part of this contract and can change.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
Sent as text/plain.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
List the other cases of this case's outcome instance¶
GET /api/1/cases/{id}/case_history
The cases that share the outcome instance of this case, newest first, which is the client's history rather than revisions of this case.
format(string, one ofjson,text)
Example
curl -X GET \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/cases/<id>/case_history
Response 200
One page of the cases sharing the outcome instance.
data(array)calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
meta(object)pagination(object)
Sent as text/plain.
data(array)calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
meta(object)pagination(object)
Copy a case¶
POST /api/1/cases/{id}/copy
format(string, one ofjson,text)
Example
curl -X POST \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/cases/<id>/copy
Response 200
The case. The listed properties are the stable ones. The payload also carries the fields the Atfinity frontend needs, which are not part of this contract and can change.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
Sent as text/plain.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
Check for background tasks still running on a case¶
GET /api/1/cases/{id}/has_ongoing_tasks
Useful after a transition that freezes documents, or after uploading a document whose text is read: poll this until it returns false.
format(string, one ofjson,text)
Example
curl -X GET \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
https://your-tenant.atfinity.app/api/1/cases/<id>/has_ongoing_tasks
Response 200
Whether background work on the case, for example freezing documents or reading the text of an uploaded one, is still running.
has_ongoing_tasks(boolean)
Sent as text/plain.
has_ongoing_tasks(boolean)
Set the tags of a case¶
POST /api/1/cases/{id}/set_tags
format(string, one ofjson,text)
Request body
tags(array, required)id(integer)key(string)
Example
curl -X POST \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tags": [{"id": 12, "key": "high_risk"}, {"id": 15, "key": "eu"}]}' \
https://your-tenant.atfinity.app/api/1/cases/<id>/set_tags
Response 204
The tags of the case are now exactly the ones given.
Transition a case¶
POST /api/1/cases/{id}/transition
Moves the case along one workflow transition. Pass either transition_id or transition_key.
The transition's condition is validated first, so a case that is not ready stays where it is.
format(string, one ofjson,text)
Request body
transition_id(integer)transition_key(string)
Send at least one of transition_id, transition_key.
Example
curl -X POST \
-H "Authorization: Api-Key $ATFINITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"transition_key": "submit_for_review"}' \
https://your-tenant.atfinity.app/api/1/cases/<id>/transition
Response 200
The case. The listed properties are the stable ones. The payload also carries the fields the Atfinity frontend needs, which are not part of this contract and can change.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.
Sent as text/plain.
calculated_name(string, nullable)color(string)created(string, date-time)given_name(string, nullable)id(integer)is_created(boolean)is_dirty(boolean)is_editable(boolean)last_modified(string, date-time)last_transition_at(string, date-time)name(string)outcome_instance_id(integer, nullable)preferred_language(string, nullable)state_id(integer, nullable)state_key(string, nullable)status(string)use_given_name(boolean)user_readable_id(string)
Further fields are present but are not part of this contract.