For the base URL, authentication and errors, see the REST API overview.
POST /v1/claims
- Request: POST /v1/claims
- Operation: RequestClaim
- Operation ID:
Claim_Request - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Request body (application/json, required)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
code | string | yes | Pattern: ^[a-zA-Z0-9_-]{1,32}$ | A unique identifier for resources, consisting of alphanumeric characters, underscores, or hyphens, and limited to 32 characters. |
project | string | yes | Pattern: ^[a-zA-Z0-9_-]{1,32}$ | A unique identifier for resources, consisting of alphanumeric characters, underscores, or hyphens, and limited to 32 characters. |
Example request: Claim into a project
curl -X POST 'https://YOUR_SERVER/v1/claims' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"code": "a1B2c3D4e5",
"project": "my_greenhouse"
}'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/claims/{code}
- Request: GET /v1/claims/
- Operation: ReadClaim
- Operation ID:
Claim_Read - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
code | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/claims/YOUR_CODE' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/users/{user}/claims
- Request: GET /v1/users/{user}/claims
- Operation: ListClaims
- Operation ID:
Claim_List - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/claims' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
Response example (200)
[
{
"claim": "kit_0042",
"created": 1792263090794,
"description": "Gateway, sensor and dashboard shipped in box 0042",
"enabled": true,
"modified": 1792263090794,
"name": "Starter kit 0042"
}
]POST /v1/users/{user}/claims
- Request: POST /v1/users/{user}/claims
- Operation: CreateClaim
- Operation ID:
Claim_Create - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes |
Request body (application/json, required)
A claim lets another account take some of your resources into one of the projects you share with it: it opens the claim URL (or posts the code to /v1/claims), and the listed resources join that project; 'members' are added to it with 'members_roles' (global roles). 'max_claims' limits how many times the code works (0 = unlimited).
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
claim | string | yes | Pattern: ^[a-zA-Z0-9_-]{1,32}$ | A unique identifier for resources, consisting of alphanumeric characters, underscores, or hyphens, and limited to 32 characters. |
config | object | yes | ||
config.domain | string | no | Pattern: ^([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$ | |
config.max_claims | integer | no | Minimum: 0 | |
config.members | array of string | no | ||
config.members_roles | array of string | no | ||
config.projects | array of string | no | ||
config.resources | array of object | yes | ||
config.resources[].identifiers | array of string | no | ||
config.resources[].type | string | no | ||
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
enabled | boolean | yes | ||
name | string | yes | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
Example request: Starter kit
curl -X POST 'https://YOUR_SERVER/v1/users/YOUR_USER/claims' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"claim": "kit_0042",
"config": {
"max_claims": 1,
"members": [
"support"
],
"members_roles": [
"viewer"
],
"resources": [
{
"identifiers": [
"kit_0042_gw",
"kit_0042_sensor"
],
"type": "device"
},
{
"identifiers": [
"kit_dashboard"
],
"type": "dashboard"
}
]
},
"description": "Gateway, sensor and dashboard shipped in box 0042",
"enabled": true,
"name": "Starter kit 0042"
}'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/users/{user}/claims/{claim}
- Request: GET /v1/users/{user}/claims/
- Operation: ReadClaimConfig
- Operation ID:
Claim_ReadConfig - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
claim | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/claims/YOUR_CLAIM' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
Response example (200, Starter kit)
{
"claim": "kit_0042",
"config": {
"max_claims": 1,
"members": [
"support"
],
"members_roles": [
"viewer"
],
"resources": [
{
"identifiers": [
"kit_0042_gw",
"kit_0042_sensor"
],
"type": "device"
},
{
"identifiers": [
"kit_dashboard"
],
"type": "dashboard"
}
]
},
"created": 1792263090794,
"description": "Gateway, sensor and dashboard shipped in box 0042",
"enabled": true,
"modified": 1792263090794,
"name": "Starter kit 0042"
}PUT /v1/users/{user}/claims/{claim}
- Request: PUT /v1/users/{user}/claims/
- Operation: UpdateClaim
- Operation ID:
Claim_Update - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
claim | path | string | yes |
Request body (application/json, required)
config replaces the whole claim configuration.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
config | object | no | ||
config.domain | string | no | Pattern: ^([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$ | |
config.max_claims | integer | no | Minimum: 0 | |
config.members | array of string | no | ||
config.members_roles | array of string | no | ||
config.projects | array of string | no | ||
config.resources | array of object | yes | ||
config.resources[].identifiers | array of string | no | ||
config.resources[].type | string | no | ||
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
enabled | boolean | no | ||
name | string | no | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
Example request: Disable the code
curl -X PUT 'https://YOUR_SERVER/v1/users/YOUR_USER/claims/YOUR_CLAIM' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"enabled": false
}'Example body: Rename
{
"name": "Starter kit 0042 - returned"
}Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
DELETE /v1/users/{user}/claims/{claim}
- Request: DELETE /v1/users/{user}/claims/
- Operation: DeleteClaim
- Operation ID:
Claim_Delete - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
claim | path | string | yes |
Example request
curl -X DELETE 'https://YOUR_SERVER/v1/users/YOUR_USER/claims/YOUR_CLAIM' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/users/{user}/claims/{claim}/clone
- Request: GET /v1/users/{user}/claims/{claim}/clone
- Operation: CloneClaimConfig
- Operation ID:
Claim_CloneConfig - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
claim | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/claims/YOUR_CLAIM/clone' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
POST /v1/users/{user}/claims/{claim}/clone
- Request: POST /v1/users/{user}/claims/{claim}/clone
- Operation: CloneClaim
- Operation ID:
Claim_Clone - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
claim | path | string | yes |
Request body (application/json, required)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
claim | string | yes | Pattern: ^[a-zA-Z0-9_-]{1,32}$ | A unique identifier for resources, consisting of alphanumeric characters, underscores, or hyphens, and limited to 32 characters. |
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
enabled | boolean | no | ||
name | string | no | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
Example request: Copy with a new id
curl -X POST 'https://YOUR_SERVER/v1/users/YOUR_USER/claims/YOUR_CLAIM/clone' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"claim": "copy_of_claim"
}'Example body: Copy with name and description
{
"claim": "line_2_claim",
"description": "Same configuration as the original, for production line 2",
"name": "Line 2 copy"
}Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
PUT /v1/users/{user}/claims/{claim}/projects
- Request: PUT /v1/users/{user}/claims/{claim}/projects
- Operation: UpdateClaimProjects
- Operation ID:
Claim_UpdateProjects - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
claim | path | string | yes |
Request body (application/json, required)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
(body) | array of string | no | Projects the resource belongs to, as <owner>@<project> ids. Replaces the whole list: read the current one first to add or remove a single project; [] removes it from every project. |
Example request: No projects
curl -X PUT 'https://YOUR_SERVER/v1/users/YOUR_USER/claims/YOUR_CLAIM/projects' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '[]'Example body: One project
[
"YOUR_USER@greenhouse"
]Example body: Two projects
[
"YOUR_USER@greenhouse",
"YOUR_USER@maintenance"
]Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |