Skip to main content
POST
/
cloud
/
v1
/
caas
/
keys
/
{project_id}
/
{region_id}
Create API key
curl --request POST \
  --url https://api.gcore.com/cloud/v1/caas/keys/{project_id}/{region_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "containers": [
    {
      "name": "<string>",
      "namespace": "<string>"
    }
  ],
  "name": "<string>",
  "description": "",
  "expire": "2023-07-31T00:00:00Z",
  "is_disabled": false
}
'
{
  "containers": [
    {
      "name": "<string>",
      "namespace": "<string>"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "expire": "2023-07-31T00:00:00Z",
  "is_disabled": true,
  "name": "<string>",
  "secret": "<string>",
  "source": "<string>",
  "status": "<string>"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project id

Example:

1

region_id
integer
required

Region id

Example:

1

Body

application/json
containers
CaasNamespacedName · object[]
required

List of containers using key

Example:
[
{
"name": "my-container",
"namespace": "space"
}
]
name
string
required

Key name

Example:

"my-key"

description
string
default:""

Key description

Example:

"my first key"

expire
string<date-time> | null

Key expires at

Example:

"2023-07-31T00:00:00Z"

is_disabled
boolean
default:false

Set to true if key is disabled

Example:

false

Response

200 - application/json

OK

containers
CaasNamespacedName · object[]
required

List of containers using key

Example:
[
{
"name": "my-container",
"namespace": "space"
}
]
created_at
string<date-time>
required

Key starts to work

Example:

"2023-08-22T11:21:00Z"

description
string
required

Key description

Example:

"my first key"

expire
string<date-time> | null
required

Key expires at

Example:

"2023-07-31T00:00:00Z"

is_disabled
boolean
required

Set to true if key is disabled

Example:

false

name
string
required

Key name

Example:

"my-key"

secret
string
required

Secret api key

Example:

"my-secret"

source
string
required

Source of the apikey, can be 'cloud' or 'iate'

Example:

"cloud"

status
string
required

Key status

Example:

"Expired"