Skip to content

API Key

Request

Create a new API key for the specified questionnaire.

Requires a key with the apikey:write scope. The full key value is returned only in this response — store it securely immediately. Subsequent list calls return a masked version.

Security
authorization
Path
tenant_idstring, (uuid)required

UUID of the tenant

questionnaire_idstring, (uuid)required

UUID of the questionnaire

Bodyapplication/jsonrequired
key_namestringrequired

Human-readable name to identify this key

Example:"ci-participant-writer"
scopesArray of stringsrequired

List of scopes to grant this key. Valid values:

  • participant:write — create participants
  • apikey:write — create API keys for the same questionnaire
  • apikey:delete — delete API keys for the same questionnaire
Items Enum:"participant:write""apikey:write""apikey:delete"
Example:
[ "participant:write" ]
curl -i -X POST \
  'https://api.us.clearspeed.com/questionnaire/tenants/{tenant_id}/questionnaires/{questionnaire_id}/apikeys' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "key_name": "ci-participant-writer",
    "scopes": [
      "participant:write"
    ]
  }'

Responses

API key created. The api_key value is shown only once — save it now.

Bodyapplication/json
idstring, (uuid)

Unique identifier of the API key

Example:"a1b2c3d4-0000-0000-0000-000000000001"
api_keystring

The API key value. Returned in full only on creation — masked in all subsequent responses.

Example:"cs_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
key_namestring

Human-readable name for the key

Example:"ci-participant-writer"
scopesArray of strings

Scopes granted to this key

Example:
[ "participant:write" ]
questionnaire_idstring, (uuid)

UUID of the questionnaire this key is scoped to

Example:"fd9690b0-9050-4acd-ad74-7f906c07fe93"
create_tsstring, (date-time)

Creation timestamp (UTC)

Example:"2026-04-10T10:00:00Z"
update_tsstring, (date-time)

Last updated timestamp (UTC)

Example:"2026-04-10T10:00:00Z"
Response
{ "id": "a1b2c3d4-0000-0000-0000-000000000001", "api_key": "cs_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx", "key_name": "ci-participant-writer", "scopes": [ "participant:write" ], "questionnaire_id": "fd9690b0-9050-4acd-ad74-7f906c07fe93", "create_ts": "2026-04-10T10:00:00Z", "update_ts": "2026-04-10T10:00:00Z" }