Skip to main content
POST
/
v1
/
api-keys
Create API Key
curl --request POST \
  --url https://api.dispersed.com/v1/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My API Key",
  "permissions": [
    "nodes.read.own",
    "nodes.update.own",
    "jobs.read.own",
    "job_runs.read.own",
    "job_runs.update.own"
  ],
  "allowed_ips": [
    "127.0.0.1",
    "192.168.1.1/24"
  ],
  "expires_at": "2023-01-01T00:00:00Z"
}
'
{
  "created_at": "2023-11-07T05:31:56Z",
  "is_revoked": true,
  "name": "<string>",
  "object": "api_key",
  "permissions": [
    "<string>"
  ],
  "public_key": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "secret_key": "<string>",
  "_id": "<string>",
  "account": "<string>",
  "account_uuid": "<string>",
  "allowed_ips": [
    "127.0.0.1",
    "192.168.1.1/24"
  ],
  "deleted_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z",
  "uuid": "<string>"
}

Body

application/json
name
string
required

Name of the API key

Minimum string length: 1
Example:

"My API Key"

permissions
string[]
required

List of permissions for the API key

Minimum array length: 1
Example:
[
"nodes.read.own",
"nodes.update.own",
"jobs.read.own",
"job_runs.read.own",
"job_runs.update.own"
]
allowed_ips
string[]

OPTIONAL: List of allowed IP addresses or CIDR ranges. If no IPs are provided, the API key can be used from any IP address.

Example:
["127.0.0.1", "192.168.1.1/24"]
expires_at
string<date-time> | null

Date and time when the API key should expire. If not provided, the API key will never expire.

Example:

"2023-01-01T00:00:00Z"

Response

API key created successfully

created_at
string<date-time> | null
required
is_revoked
boolean
required
name
string
required
object
enum<string>
required
Available options:
api_key
permissions
string[]
required
public_key
string
required
updated_at
string<date-time> | null
required
secret_key
string
required
_id
string | null
account
string | null
account_uuid
string | null
allowed_ips
string[]

OPTIONAL: List of allowed IP addresses or CIDR ranges. If no IPs are provided, the API key can be used from any IP address.

Example:
["127.0.0.1", "192.168.1.1/24"]
deleted_at
string<date-time> | null
expires_at
string<date-time> | null
last_used_at
string<date-time> | null
uuid
string | null