Skip to content

Values

Information values are the answers stored in a case. Each value belongs to an instance and to an information field identified by its key. A structured information holds its values in occurrences, which repeat the same set of fields.

Add an occurrence to a structure

POST /api/1/cases/{case_pk}/structure_occurrences

Appends one empty occurrence to a structured value. structure_value_id is the id of that value, which the value list of the case reports.

The occurrence is named after the structure's display name, and from the second occurrence on it carries its position as a suffix, so Real estate, Real estate 2, Real estate 3. A structure that has reached its maximum number of occurrences rejects the request with structure_occurrences.max_amount_reached.

To write several occurrences at once, send the whole structure through Update a case instead.

Request body

  • structure_value_id (integer, required)
{
  "structure_value_id": 90001
}

Example

curl -X POST \
  -H "Authorization: Api-Key $ATFINITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"structure_value_id": 90001}' \
  https://your-tenant.atfinity.app/api/1/cases/<case_pk>/structure_occurrences

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.

Remove an occurrence

DELETE /api/1/cases/{case_pk}/structure_occurrences/{id}

Deletes one occurrence together with the values it holds. The occurrences after it keep their own names, so the numbering the structure gave them no longer matches their position.

Example

curl -X DELETE \
  -H "Authorization: Api-Key $ATFINITY_API_KEY" \
  https://your-tenant.atfinity.app/api/1/cases/<case_pk>/structure_occurrences/<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.

Rename an occurrence

PATCH /api/1/cases/{case_pk}/structure_occurrences/{id}

Replaces the name of one occurrence. A structure whose occurrence names are not editable rejects the request with structure_occurrences.editable_name_disabled.

Request body

  • name (string, required)
{
  "name": "Holiday home"
}

Example

curl -X PATCH \
  -H "Authorization: Api-Key $ATFINITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Holiday home"}' \
  https://your-tenant.atfinity.app/api/1/cases/<case_pk>/structure_occurrences/<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.

Duplicate an occurrence

POST /api/1/cases/{case_pk}/structure_occurrences/{id}/duplicate

Copies one occurrence, including every field value in it and the files attached to those values.

The copy is appended after the existing occurrences and named the way a new occurrence is, so it does not inherit the name of the occurrence it came from. A structure that has reached its maximum number of occurrences rejects the request with structure_occurrences.max_amount_reached.

Example

curl -X POST \
  -H "Authorization: Api-Key $ATFINITY_API_KEY" \
  https://your-tenant.atfinity.app/api/1/cases/<case_pk>/structure_occurrences/<id>/duplicate

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 all values of a case

GET /api/1/cases/{case_pk}/values

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>/values

Response 200

  • meta (object)
    • pagination (object)
  • results (array)
    • case_id (integer, required, nullable)
    • ensured_by (string, nullable)
    • id (integer, required)
    • information (integer, nullable)
    • information_key (string, required)
    • information_user_readable_id (string, required)
    • instance_id (string, required)
    • is_touched (boolean)
    • needed_document_id (integer, required, nullable)
    • value (string, required)
{
  "meta": {
    "pagination": {
      "count": 1,
      "page": 1,
      "pages": 1
    }
  },
  "results": [
    {
      "case_id": 4711,
      "id": 90001,
      "information_key": "date_of_birth",
      "information_user_readable_id": "person.date_of_birth",
      "instance_id": 5001,
      "is_touched": true,
      "value": "1985-04-12"
    }
  ]
}

List all values of an instance

GET /api/1/instances/{instance_pk}/values

Accepts the standard list parameters.

Example

curl -X GET \
  -H "Authorization: Api-Key $ATFINITY_API_KEY" \
  https://your-tenant.atfinity.app/api/1/instances/<instance_pk>/values

Response 200

  • meta (object)
    • pagination (object)
  • results (array)
    • case_id (integer, required, nullable)
    • ensured_by (string, nullable)
    • id (integer, required)
    • information (integer, nullable)
    • information_key (string, required)
    • information_user_readable_id (string, required)
    • instance_id (string, required)
    • is_touched (boolean)
    • needed_document_id (integer, required, nullable)
    • value (string, required)