Skip to main content

Get target details by ID

POST 

/api/v2/workspace/:workspaceId/survey/:surveyCode/targets/details

Returns the definition and metadata of saved targets of a workspace: name, TGL expression, creation date and last update date.

Use it after GET /api/v2/workspace/{workspaceId}/survey/{surveyCode}/targets, which returns only ids and names, or after creating or updating a target, to read the expression as stored. POST is used only to send the list of ids in the body: the operation reads data, changes nothing and is safe to retry.

Before you call it​

  • workspaceId: the workspace that contains the targets.
  • ids: target ids, from GET .../targets (nodes with type: TARGET_VAR) or from the id returned by POST .../target.
  • surveyCode: any survey code you can access, usually the workspace's own. It does not change the result.

Response​

A JSON array with one Target per id that can be returned, in the order of ids (an id sent twice is returned twice).

FieldDescription
idTarget id, as requested.
labelTarget name.
filterTglThe stored definition written as TGL (see the TGL guide). It is equivalent to the expression sent when the target was created or last updated, but can be written differently: parentheses are normalised, negations are pushed down to single conditions and OR groups can be distributed. Part labels (:'...') are not included. Omitted when the stored definition cannot be written as TGL.
creationDateWhen the target was created, as an ISO 8601 instant, for example 2026-05-27T10:15:30.123Z.
updatedDateWhen the target was last changed, same format.

workspaceId is not returned by this operation.

Ids that are not returned​

The request never fails because of a particular id: an id that cannot be returned is left out of the response without an error. This covers ids that do not exist, that belong to another workspace, or that belong to a workspace you cannot access. If no id can be returned, the response is 200 with []. Compare the returned id values with your request to find the missing ones. Send target ids only.

There is no fixed limit on the number of ids, but each id is resolved separately, so very large lists take longer.

Errors​

StatuserrorCodeWhen
400VAL_ERR_001ids is missing or empty, or the body is empty.
400E400The body is not valid JSON.
400AE_ERR_400The body is a JSON array, or a value has the wrong JSON type, such as a string in ids. The message names the field.
400TW_ERR_500The X-API-Key value does not identify a TOM user.
401E401The X-API-Key header is missing or empty.
500GEN_ERR_500Unexpected error.

Request​

Responses​

Details of the requested targets that can be returned, in request order. Ids that cannot be returned are left out.