Environments
Register developer machines and list or revoke them.
5 endpoints. 2 are ingest/public and 3 require a JWT. The badge under each path shows which.
/v1/environments Register or update a developer machine environment from the CLI.
Auth Org secret
Path parameters
None.
Query parameters
None.This endpoint does not read query parameters.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
displayName | string | Optional | Friendly name for the environment. |
hostname | string | Required | Machine hostname reported by the CLI. |
platform | "darwin" | "linux" | "win32" | Required | OS platform: darwin, linux, or win32. |
repoRoot | string | Optional | Absolute path to the repository root on the machine. |
repoRemote | string | Optional | Git remote URL, when known. |
gitBranch | string | Optional | Active git branch during capture. |
relayCliVersion | string | Required | Relay CLI semver string. |
Request
{
"hostname": "ash-laptop.local",
"platform": "darwin",
"relayCliVersion": "0.1.0",
"displayName": "Ash laptop",
"repoRoot": "/Users/dev/myproject",
"gitBranch": "main"
} Response
201 Success
{
"environmentId": "env_abc123",
"environment": {
"environmentId": "env_abc123",
"organizationId": "org_abc123",
"displayName": "Ash laptop",
"hostname": "ash-laptop.local",
"platform": "darwin",
"relayCliVersion": "0.1.0",
"status": "active",
"lastSeenAt": "2026-08-28T12:00:00.000Z",
"createdAt": "2026-08-28T12:00:00.000Z",
"updatedAt": "2026-08-28T12:00:00.000Z"
}
} Status codes
curl
curl -X POST 'https://api.dev.relay.oprag.ai/v1/environments' \
-H 'X-Relay-Secret: sk_live_...' \
-H 'Content-Type: application/json' \
-d '{"hostname": "ash-laptop.local","platform": "darwin","relayCliVersion": "0.1.0","displayName": "Ash laptop","repoRoot": "/Users/dev/myproject","gitBranch": "main"}' /v1/environments/{environmentId}/heartbeat Refresh last-seen timestamp for a registered environment.
Auth Org secret
Before you call it
- Response shape is
{ environmentId, lastSeenAt }per@relay/api-contract.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
environmentId | string | Required | Registered developer environment id. |
Query parameters
None.This endpoint does not read query parameters.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
relayCliVersion | string | Optional | Relay CLI semver string. |
Request
{
"relayCliVersion": "0.1.0"
} Response
200 Success
{
"environmentId": "env_abc123",
"lastSeenAt": "2026-08-28T12:05:00.000Z"
} Status codes
curl
curl -X POST 'https://api.dev.relay.oprag.ai/v1/environments/{environmentId}/heartbeat' \
-H 'X-Relay-Secret: sk_live_...' \
-H 'Content-Type: application/json' \
-d '{"relayCliVersion": "0.1.0"}' /v1/organizations/me/environments List developer environments registered for the organization.
Auth Cognito JWT member+
Path parameters
None.
Query parameters
None.This endpoint does not read query parameters.
Body parameters
None.This endpoint does not read a request body.
Response
200 Success
{
"environments": [
{
"environmentId": "env_abc123",
"organizationId": "org_abc123",
"displayName": "Ash laptop",
"hostname": "ash-laptop.local",
"platform": "darwin",
"relayCliVersion": "0.1.0",
"status": "active",
"lastSeenAt": "2026-08-28T12:05:00.000Z",
"createdAt": "2026-08-28T12:00:00.000Z",
"updatedAt": "2026-08-28T12:05:00.000Z"
}
]
} Status codes
curl
curl -X GET 'https://api.dev.relay.oprag.ai/v1/organizations/me/environments' \
-H 'Authorization: Bearer <Cognito JWT>' /v1/organizations/me/environments/{environmentId} Fetch one developer environment by id.
Auth Cognito JWT member+
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
environmentId | string | Required | Registered developer environment id. |
Query parameters
None.This endpoint does not read query parameters.
Body parameters
None.This endpoint does not read a request body.
Response
200 Success
{
"environment": {
"environmentId": "env_abc123",
"organizationId": "org_abc123",
"displayName": "Ash laptop",
"hostname": "ash-laptop.local",
"platform": "darwin",
"relayCliVersion": "0.1.0",
"status": "active",
"lastSeenAt": "2026-08-28T12:05:00.000Z",
"createdAt": "2026-08-28T12:00:00.000Z",
"updatedAt": "2026-08-28T12:05:00.000Z"
}
} Status codes
curl
curl -X GET 'https://api.dev.relay.oprag.ai/v1/organizations/me/environments/{environmentId}' \
-H 'Authorization: Bearer <Cognito JWT>' /v1/organizations/me/environments/{environmentId} Revoke a developer environment.
Auth Cognito JWT admin+
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
environmentId | string | Required | Registered developer environment id. |
Query parameters
None.This endpoint does not read query parameters.
Body parameters
None.This endpoint does not read a request body.
Response
200 Success
{
"environment": {
"environmentId": "env_abc123",
"organizationId": "org_abc123",
"displayName": "Ash laptop",
"hostname": "ash-laptop.local",
"platform": "darwin",
"relayCliVersion": "0.1.0",
"status": "revoked",
"lastSeenAt": "2026-08-28T12:05:00.000Z",
"createdAt": "2026-08-28T12:00:00.000Z",
"updatedAt": "2026-08-28T14:00:00.000Z"
}
} Status codes
curl
curl -X DELETE 'https://api.dev.relay.oprag.ai/v1/organizations/me/environments/{environmentId}' \
-H 'Authorization: Bearer <Cognito JWT>' Ready to ship?
Get started free