Create

Description

Add a block to a case.

Request

HTTP Method: POST

Parameter Description
title The title of the block.
block_type The type of block to create - options: note, file.
elements Optional An array of elements to add to the block.
position Optional The zero-indexed position of the block in the case.

Element Parameters

Note Element Parameters

Parameter Description
content The content of the note.
note_type The type of note - currently only "text" is supported.
color Optional The color of the note - options: white, gold, magenta, green, blue.

File Element Parameters

Parameter Description
filename The name of the file.
file_contents The base64-encoded contents of the file.
Path Parameter Description
case_id The ID of the case.

Sample request for a note block

curl -X POST \
  https://<<META.tenant.domain>>/api/v2/cases/<<case_id>>/blocks \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>' \
  -d '{
        "title": "My Note Block",
        "block_type": "note",
        "elements": [
          {
            "content": "This is a note element",
            "note_type": "text",
            "color": "white"
          }
        ],
        "position": 0
      }'

Sample request for a file block

curl -X POST \
  https://<<META.tenant.domain>>/api/v2/cases/<<case_id>>/blocks \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>' \
  -d '{
        "title": "My File Block",
        "block_type": "file",
        "elements": [
          {
            "filename": "example.txt",
            "file_contents": "SGVsbG8gV29ybGQ="
          }
        ],
        "position": 1
      }'

Response

A successful request will return a JSON object describing the created block.

Field description

Parameter Description
block The block object.
Block Parameter Description
id The ID of the block record attached to the case.
title The title of the block.
block_type The type of the block - options: note, file.
position The position of the block in the case.
elements An array of elements contained within the block.
created_at ISO 8601 Timestamp representing creation date and time.
updated_at ISO 8601 Timestamp representing last updated date and time.

Common Element Parameters

Parameter Description
element_id The unique ID of this element within the current block.
id The original/source ID of the element.
element_type The type of the element - options: note, file.
author Details of the author of the element.
created_at ISO 8601 Timestamp representing creation date and time.
updated_at ISO 8601 Timestamp representing last updated date and time.
Author parameter Description
user_id The user ID.
first_name The user's first name.
last_name The user's last name.
email The user's email address.
avatar_url The user's avatar url.
is_service_account Whether this user is a service account (true/false).

Note Element Parameters

Parameter Description
content The content of the note.
note_type The type of note - currently only "text" is supported.
color The color of the note - options: white, gold, magenta, green, blue.

File Element Parameters

Parameter Description
file Object containing file information (filename and url).

Sample response for a note block

{
  "block": {
    "id": 123,
    "title": "My Note Block",
    "block_type": "note",
    "position": 0,
    "elements": [
      {
        "element_id": 456,
        "id": 123,
        "element_type": "note",
        "content": "This is a note element",
        "note_type": "text",
        "color": "white",
        "author": {
          "user_id": "1",
          "first_name": "Jane",
          "last_name": "Doe",
          "email": "jane@tines.io",
          "avatar_url": "example.com/avatar",
          "is_service_account": false
        },
        "created_at": "2025-01-07T11:42:58Z",
        "updated_at": "2025-01-07T11:42:58Z"
      }
    ],
    "created_at": "2025-01-07T11:42:58Z",
    "updated_at": "2025-01-07T11:42:58Z"
  }
}
Was this helpful?