Skip to main content
POST
/
cloud
/
v2
/
secrets
/
{project_id}
/
{region_id}
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
task_id_list = client.cloud.secrets.upload_tls_certificate(
    project_id=1,
    region_id=1,
    name="Load balancer certificate #1",
    payload={
        "certificate": "<certificate>",
        "certificate_chain": "<certificate_chain>",
        "private_key": "<private_key>",
    },
)
print(task_id_list.tasks)
{
  "tasks": [
    "<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

region_id
integer
required

Region ID

Body

application/json
name
string
required

Secret name

payload
CreateSecretPayloadSerializer · object
required

Secret payload.

expiration
string<date-time> | null

Datetime when the secret will expire. Defaults to None

Response

200 - application/json

OK

tasks
string[]
required

List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:

  • GET /v1/tasks/{task_id} - Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.