Skip to main content

Create a test

Create an assessment test. Scope: tests:write.

POST/api/v1/tests 🔒 API key

Creates an assessment test. Scope: tests:write. The creator also persists the test’s taxonomy and meters org usage. Non-admins must pass organizationIds they have employer-write authority in.

Request body

FieldTypeRequiredDescription
namestringYesTest name.
typestringYesTest type (e.g. multiple_choice).
descriptionstringYesTest description.
durationintegerYesDuration in minutes.
contentobjectYesThe question structure (shape depends on type).
organizationIdsstring[]For non-adminsOrgs the test belongs to.
targetPersona / analysisCategory / languagestringNoMetadata.
primarySkills / domains / skillLevel / tagsstring[]NoTaxonomy.

Example request

curl -X POST https://app.talent-ray.com/api/v1/tests \
  -H "Authorization: Bearer tr_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "JavaScript Fundamentals", "type": "multiple_choice", "description": "Core JS assessment.", "duration": 30, "organizationIds": ["org_acme"], "content": { "questions": [] } }'

Response

201 Created — the created test (same shape as Get a test; the question content is not echoed back).

Status codes

StatusMeaning
201Created.
400bad_request — missing/invalid required fields.
401No valid API key.
403insufficient_scope (missing tests:write) or forbidden (no write authority in the target org).
429Rate limit / usage limit exceeded.