Browse documentation DocumentationLet’s talk
Documentation / Build with Rokn

Clients API: timeline, tags and custom fields

A client's timeline, tags and custom fields over the API and MCP: the routes, their scopes, the rules a schema does not show, and what a client delete would remove.

These routes let an integration, an MCP client and Rokn's in-app assistant work with a client's record. Every MCP tool calls exactly one REST route, under the same scope check and the same member permissions. Every path below is under /api/v1/workspaces/{slug} and follows the usual rules: bearer credential, the workspace in the path, problem-details errors. The API reference lists every body and response; this page gives the rules a schema does not show and names the MCP tool for each route. A record that belongs to another workspace is always 404 not_found.

A client's timeline

  • GET …/clients/{id}/timeline (communications:read, tool list_client_timeline): notes, calls, meetings, emails and system events, pinned first and then newest first. It is keyset-paginated with limit and cursor.
  • POST …/clients/{id}/timeline (communications:write, tool add_timeline_entry): logs a note, call, meeting or email with content (at most 10,000 characters). subject defaults to the content's first line, occurredAt back-dates the entry and projectId links a project of the workspace. system is never accepted.
  • PATCH …/timeline/{id} and DELETE …/timeline/{id} (communications:write, tools update_timeline_entry and delete_timeline_entry): change the type, subject, content (null clears it) or pinned flag, or delete the entry and its attachments for good.

A timeline entry of type email only records a conversation; it never sends mail. An entry is authored by a person, so an API key that tries to log one is refused with 403: use an OAuth token. A member edits or deletes only their own entries and owner and admin any; a colleague's entry and a system entry are 404.

Tags and custom fields

  • GET …/tags (clients:read, tool list_tags) and POST …/tags (clients:write, tool create_tag): a name (trimmed, at most 120 characters) and an optional #rrggbb colour. A name already used in the workspace is 409 tag_name_taken.
  • POST …/clients/{id}/tags (clients:write, tool tag_client) takes a tagId and is idempotent: a client that already carries the tag answers 200 with the same tag.
  • DELETE …/clients/{id}/tags/{tagId} (clients:write, tool untag_client) detaches the tag and keeps it. A client that does not carry the tag is 404.
  • GET …/custom-fields (clients:read, tool list_custom_fields) lists the client field definitions (type, options, whether required) in display order.
  • PUT …/clients/{id}/custom-fields/{fieldId} (clients:write, tool set_custom_field_value) sets, replaces or, with null, clears one value. A date field takes YYYY-MM-DD, a select one of its options and a url an http(s) address. A value the field's type does not accept is 422 and nothing is written.

Tags and custom-field definitions can be listed and created over the API, never deleted.

Delete preview

Read what a delete would do before you do it. The read changes nothing: GET …/clients/{id}/delete-impact (clients:write, tool get_client_delete_impact). The answer counts what the delete removes (deleted), what it detaches and keeps (unlinked) and what stops it (blocked, with the records in blockedRecords). It also gives signedContracts. blockedByPermission names the sections whose removed rows the caller may not delete; the delete is then refused, as the preview needs a role that may delete. A delete moves the record to the recycle bin for 30 days, where owners and admins can restore it.

Next: Projects API, then Billing and catalogue API.