Skip to main content

Provisioning

Claim tokens that let new devices join your fleet at first boot.

Endpoints

MethodPathDescription
GET/api/orgs/{org_id}/claim_tokensList claim tokens
POST/api/orgs/{org_id}/claim_tokensCreate a claim token
GET/api/orgs/{org_id}/claim_tokens/{id}Get a claim token
PUT/api/orgs/{org_id}/claim_tokens/{id}Update a claim token
DELETE/api/orgs/{org_id}/claim_tokens/{id}Delete a claim token
GET/api/orgs/{org_id}/projects/{project_id}/claim_tokensList claim tokens for a project

List claim tokens

GET /api/orgs/{org_id}/claim_tokens

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Query parameters:

NameTypeRequiredDescription
cursorstringNoOpaque pagination cursor from a prior response's meta.after/meta.before.
limitintegerNoMax items per page (clamped 1–100). Defaults to 20. Range 1–100.
directionstringNoPage direction relative to the cursor. One of: after, before. Defaults to "after".

Responses:

StatusBodyDescription
200data: array of ClaimToken, meta: PaginationMetaClaim tokens (raw token values omitted).

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/claim_tokens" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": [
{
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"expires_at": "2026-08-14T12:00:00Z",
"max_uses": 0,
"consume_count": 0,
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"created_by_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"tags": ["string"],
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
],
"meta": {
"after": "string",
"before": "string",
"has_next": true,
"has_previous": true,
"total": 0
}
}

Create a claim token

POST /api/orgs/{org_id}/claim_tokens

Admin only. The raw token is returned once, in the create response only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Request body:

FieldTypeRequiredDescription
claim_tokenobjectYes
claim_token.namestringNo
claim_token.max_usesintegerNo
claim_token.expires_atstring (date-time)No
claim_token.cohort_idstringNo
claim_token.tagsstring[]No

Responses:

StatusBodyDescription
201data: ClaimTokenCreated.
422ValidationErrorRequest body failed validation.

Example request:

curl -X POST "https://connect.peridio.com/api/orgs/{org_id}/claim_tokens" \
-H "Authorization: Bearer $AVOCADO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"claim_token": {
"name": "string",
"max_uses": 0,
"expires_at": "2026-08-14T12:00:00Z",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"tags": [
"string"
]
}
}'

Example response (201):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"expires_at": "2026-08-14T12:00:00Z",
"max_uses": 0,
"consume_count": 0,
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"created_by_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"tags": ["string"],
"token": "string",
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Get a claim token

GET /api/orgs/{org_id}/claim_tokens/{id}

Admin only. Includes the token's use history.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Responses:

StatusBodyDescription
200data: ClaimTokenWithUsesClaim token.
404ErrorResource not found.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/claim_tokens/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"expires_at": "2026-08-14T12:00:00Z",
"max_uses": 0,
"consume_count": 0,
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"created_by_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"tags": ["string"],
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z",
"uses": [
{
"device_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"claimed_at": "2026-08-14T12:00:00Z"
}
]
}
}

Update a claim token

PUT /api/orgs/{org_id}/claim_tokens/{id}

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Request body:

FieldTypeRequiredDescription
claim_tokenobjectYes
claim_token.namestringNo
claim_token.max_usesintegerNo
claim_token.expires_atstring (date-time)No
claim_token.tagsstring[]No

Responses:

StatusBodyDescription
200data: ClaimTokenUpdated.
404ErrorResource not found.
422ValidationErrorRequest body failed validation.

Example request:

curl -X PUT "https://connect.peridio.com/api/orgs/{org_id}/claim_tokens/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"claim_token": {
"name": "string",
"max_uses": 0,
"expires_at": "2026-08-14T12:00:00Z",
"tags": [
"string"
]
}
}'

Example response (200):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"expires_at": "2026-08-14T12:00:00Z",
"max_uses": 0,
"consume_count": 0,
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"created_by_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"tags": ["string"],
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Delete a claim token

DELETE /api/orgs/{org_id}/claim_tokens/{id}

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Responses:

StatusBodyDescription
200OkDeleted.
404ErrorResource not found.

Example request:

curl -X DELETE "https://connect.peridio.com/api/orgs/{org_id}/claim_tokens/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"ok": true
}

List claim tokens for a project

GET /api/orgs/{org_id}/projects/{project_id}/claim_tokens

Admin only. Claim tokens whose cohort belongs to the given project.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
project_idstring (uuid)Project UUID.

Query parameters:

NameTypeRequiredDescription
cursorstringNoOpaque pagination cursor from a prior response's meta.after/meta.before.
limitintegerNoMax items per page (clamped 1–100). Defaults to 20. Range 1–100.
directionstringNoPage direction relative to the cursor. One of: after, before. Defaults to "after".

Responses:

StatusBodyDescription
200data: array of ClaimToken, meta: PaginationMetaClaim tokens.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/projects/{project_id}/claim_tokens" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": [
{
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"expires_at": "2026-08-14T12:00:00Z",
"max_uses": 0,
"consume_count": 0,
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"created_by_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"tags": ["string"],
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
],
"meta": {
"after": "string",
"before": "string",
"has_next": true,
"has_previous": true,
"total": 0
}
}

Object reference

ClaimToken

FieldTypeDescription
idstring
namestringNullable.
expires_atstring (date-time)Nullable.
max_usesintegerNullable.
consume_countinteger
organization_idstring
created_by_idstringNullable.
cohort_idstringNullable.
tagsstring[]Tags applied to devices claimed with this token.
tokenstringRaw claim token — returned only on create.
inserted_atstring (date-time)
updated_atstring (date-time)

PaginationMeta

Cursor pagination metadata. Present only when the request supplied a pagination param (cursor, limit, or direction); otherwise the full list is returned unpaginated with no meta.

FieldTypeDescription
afterstringOpaque cursor for the next page. Pass back as ?cursor=. Nullable.
beforestringOpaque cursor for the previous page. Nullable.
has_nextboolean
has_previousboolean
totalintegerNullable.

ValidationError

Changeset validation error. Keys are field names; values are lists of messages.

FieldTypeDescription
errorsobject

ClaimTokenWithUses

FieldTypeDescription
idstring
namestringNullable.
expires_atstring (date-time)Nullable.
max_usesintegerNullable.
consume_countinteger
organization_idstring
created_by_idstringNullable.
cohort_idstringNullable.
tagsstring[]Tags applied to devices claimed with this token.
tokenstringRaw claim token — returned only on create.
inserted_atstring (date-time)
updated_atstring (date-time)
usesobject[]
uses[].device_idstring
uses[].claimed_atstring (date-time)

Error

Standard error envelope.

FieldTypeDescription
errorstringMachine-readable error code.
messagestringHuman-readable explanation.

Ok

Simple acknowledgement.

FieldTypeDescription
okboolean