Skip to content

SSH Key

All operations require authentication.

4 operationsv2/publicCloud/project
Agent setup

List SSH keysProduction

GET
/v2/publicCloud/project/{projectId}/sshKey

Returns the SSH public keys stored in the project.

Path parameters

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200SSHKey[]successful operation
createdAt
read-only
stringdate-time

Creation date of the SSH key

name
read-only
string

Unique name of the SSH key

publicKey
read-only
string

SSH public key content

updatedAt
read-only
stringdate-time

Last update date of the SSH key

Example uses projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/sshKey \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "createdAt": "2024-01-01T12:00:00Z", "name": "string", "publicKey": "string", "updatedAt": "2024-01-01T12:00:00Z" }]

Get an SSH keyProduction

GET
/v2/publicCloud/project/{projectId}/sshKey/{name}

Returns the SSH key with its public key content.

Path parameters

name
required
string

Name

projectId
required
string

Project ID

Response

200SSHKeysuccessful operation
createdAt
read-only
stringdate-time

Creation date of the SSH key

name
read-only
string

Unique name of the SSH key

publicKey
read-only
string

SSH public key content

updatedAt
read-only
stringdate-time

Last update date of the SSH key

404objectError 404 response

Example uses name = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/sshKey/{name} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "createdAt": "2024-01-01T12:00:00Z", "name": "string", "publicKey": "string", "updatedAt": "2024-01-01T12:00:00Z"}

Create an SSH keyProduction

POST
/v2/publicCloud/project/{projectId}/sshKey

Stores an SSH public key under a name that is unique in the project. Use this name to install the key on an instance at creation.

Path parameters

projectId
required
string

Project ID

Request body (required)

name
required
string

Unique name for the SSH key

publicKey
required
string

SSH public key content

Response

200SSHKeysuccessful operation
createdAt
read-only
stringdate-time

Creation date of the SSH key

name
read-only
string

Unique name of the SSH key

publicKey
read-only
string

SSH public key content

updatedAt
read-only
stringdate-time

Last update date of the SSH key

409objectError 409 response

Example uses projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/sshKey \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "createdAt": "2024-01-01T12:00:00Z", "name": "string", "publicKey": "string", "updatedAt": "2024-01-01T12:00:00Z"}

Delete an SSH keyProduction

DELETE
/v2/publicCloud/project/{projectId}/sshKey/{name}

Deletes the SSH key from the project. Instances created with this key keep it.

Path parameters

name
required
string

Name

projectId
required
string

Project ID

Response

200SSHKeysuccessful operation
createdAt
read-only
stringdate-time

Creation date of the SSH key

name
read-only
string

Unique name of the SSH key

publicKey
read-only
string

SSH public key content

updatedAt
read-only
stringdate-time

Last update date of the SSH key

404objectError 404 response

Example uses name = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/sshKey/{name} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "createdAt": "2024-01-01T12:00:00Z", "name": "string", "publicKey": "string", "updatedAt": "2024-01-01T12:00:00Z"}