Population Sets

Core

GET

List population sets

/population-sets

List population sets (across all workspaces and forms).

Filters

Provided via query string:

Name Type Description
id String ID
formId String Owning form's ID
workspaceId String Owning workspace's ID
name String Name
published Boolean Published

Parameters

Provided via query string:

Name Type Description
limit Number Number of items to return
offset Number Number of items to skip before returning

Response

An array of PopulationSet objects.

GET

Count population sets

/population-sets/count

Count population sets (across all workspaces and forms).

Filters

Provided via query string:

Name Type Description
id String ID
formId String Owning form's ID
workspaceId String Owning workspace's ID
name String Name
published Boolean Published

Response

A Count object.

POST

Add a population set

/population-sets

Add a population set (to a form or workspace).

Request Body

As JSON object with the following contents:

Property Type Description
formId String

Owning form's ID

Nullable
workspaceId String

Owning workspace's ID

Nullable
name String Name

Note that either a formId or workspaceId must be provided.

Example

{
    "formId": "0963435f-f5a4-4379-b751-7573e9be5ec6",
    "workspaceId": null,
    "name": "Example",
}

Response

A PopulationSet object.

Note that since new population sets are created without any populations, they're created as not published.

GET

Get a population set

/population-sets/{id}

Find a population set by ID.

Response

A PopulationSet object.

PATCH

Update a population set

/population-sets/{id}

Update a population set.

Request Body

As JSON object with the following contents:

Property Type Description
name String

Name

Unchanged if null
published Boolean

Published

Unchanged if null

Response

A PopulationSet object.

DELETE

Delete a population set

/population-sets/{id}

Delete a population set.

Response

An empty 204.

Mapped Forms

These endpoints only apply to workspace-level population sets.

GET

List mapped form IDs

/population-sets/{id}/form-ids

List the IDs of forms mapped to this population set.

Response

An array of form IDs.

PUT

Set mapped form IDs

/population-sets/{id}/form-ids

Set the IDs of forms mapped to this population set.

Request Body

A JSON array of form IDs.

Response

The resultant array of form IDs.

Populations

GET

List populations in a set

/population-sets/{id}/populations

List populations in a population set.

Parameters

Provided via query string:

Name Type Description
limit Number Number of items to return
offset Number Number of items to skip before returning

Response

An array of Population objects.

GET

Count populations in a set

/population-sets/{id}/populations/count

Count populations in a population set.

Response

A Count object.

POST

Add populations

/population-sets/{id}/populations

Add populations.

Request Body

An array of JSON object with the following contents:

Property Type Description
key String Population identifier
user String

Optional user binding (email or ID)

Nullable
participant String

Optional participant binding

Nullable
data Object Token key-value map

Example

[
    {
        "key": "First",
        "user": null,
        "participant": null,
        "data": {
            "text": "Hello World",
            "choices": "a;b;c"
        }
    },
    {
        "key": "Second",
        "user": null,
        "participant": null,
        "data": {
            "text": "Goodbye World",
            "choices": "d;e;f"
        }
    }
]

Response

An array of population IDs.

DELETE

Delete all populations in a set

/population-sets/{id}/populations

Delete all populations in a set.

Response

An empty 204.

GET

Get a population

/population-sets/{id}/populations/{id}

Find a population by ID.

Response

A Population object.

DELETE

Delete a population

/population-sets/{id}/populations/{id}

Delete a population.

Response

An empty 204.

results matching ""

    No results matching ""