Skip to content
Odinex Cloud
API reference

Projects

GET
/quota

Limits with current use, and the restrictions staff may have set: creating resources disabled altogether (creation_blocked, with a reason) or in some locations (blocked_locations). Readable by every member of the project, so panels can disable create buttons before a request fails.

Authorization

headerAuthorizationBearer <token>

Response Body

Quota

application/json
  1. response
quota*
curl -X GET "https://example.com/quota"
{  "quota": {    "account_status": "active",    "creation_blocked": true,    "creation_block_reason": "string",    "blocked_locations": [      "string"    ],    "limits": {      "property1": {        "limit": 0,        "used": 0      },      "property2": {        "limit": 0,        "used": 0      }    }  }}
GET
/projects

Authorization

cookieAuth
cookieodx_session<token>

Response Body

Projects

application/json
  1. response
projects*array<>
curl -X GET "https://example.com/projects"
{  "projects": [    {      "id": 0,      "name": "string",      "organization_id": 0,      "role": "admin",      "created": "2019-08-24T14:15:22Z"    }  ]}
POST
/projects

Authorization

cookieAuth
cookieodx_session<token>

Request Body

application/json
  1. body
name*string
Length1 <= length <= 64
organization_id?integer

Defaults to the personal organization

Formatint64

Response Body

Created

application/json
  1. response
project*
curl -X POST "https://example.com/projects" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "project": {    "id": 0,    "name": "string",    "organization_id": 0,    "role": "admin",    "created": "2019-08-24T14:15:22Z"  }}

Get project

GET
/projects/{id}

Authorization

cookieAuth
cookieodx_session<token>

Path Parameters

id*integer
Formatint64

Response Body

Project

application/json
  1. response
project*
curl -X GET "https://example.com/projects/0"
{  "project": {    "id": 0,    "name": "string",    "organization_id": 0,    "role": "admin",    "created": "2019-08-24T14:15:22Z"  }}

Update project

PATCH
/projects/{id}

Authorization

cookieAuth
cookieodx_session<token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
name*string
Length1 <= length <= 64

Response Body

Updated

application/json
  1. response
project*
curl -X PATCH "https://example.com/projects/0" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "project": {    "id": 0,    "name": "string",    "organization_id": 0,    "role": "admin",    "created": "2019-08-24T14:15:22Z"  }}

Delete an empty project

DELETE
/projects/{id}

Fails with project_not_empty while the project still has resources.

Authorization

cookieAuth
cookieodx_session<token>

Path Parameters

id*integer
Formatint64

Response Body

Deleted

curl -X DELETE "https://example.com/projects/0"
Empty

List API tokens

GET
/projects/{id}/tokens

Authorization

cookieAuth
cookieodx_session<token>

Path Parameters

id*integer
Formatint64

Response Body

Tokens (secrets are never returned again)

application/json
  1. response
tokens*array<>
curl -X GET "https://example.com/projects/0/tokens"
{  "tokens": [    {      "id": 0,      "name": "string",      "prefix": "string",      "scope": "read",      "created": "2019-08-24T14:15:22Z",      "expires": "2019-08-24T14:15:22Z",      "last_used": "2019-08-24T14:15:22Z"    }  ]}

Create API token

POST
/projects/{id}/tokens

Authorization

cookieAuth
cookieodx_session<token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
name*string
Length1 <= length <= 64
scope*string
Value in"read""read_write"
expires_in_days?integer
Range1 <= value <= 3650

Response Body

Created. secret is shown only in this response.

application/json
  1. response
token*
secret*string
curl -X POST "https://example.com/projects/0/tokens" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "scope": "read"  }'
{  "token": {    "id": 0,    "name": "string",    "prefix": "string",    "scope": "read",    "created": "2019-08-24T14:15:22Z",    "expires": "2019-08-24T14:15:22Z",    "last_used": "2019-08-24T14:15:22Z"  },  "secret": "odx_k3j2h1_2fK9..."}

Revoke API token

DELETE
/projects/{id}/tokens/{token_id}

Authorization

cookieAuth
cookieodx_session<token>

Path Parameters

id*integer
Formatint64
token_id*integer
Formatint64

Response Body

Revoked

curl -X DELETE "https://example.com/projects/0/tokens/0"
Empty