from openlayer import Openlayer

client = Openlayer()
api_key = client.workspaces.api_keys.create(
  workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  name="My API Key"
)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "Secret Key",
  "dateCreated": "2023-11-07T05:31:56Z",
  "dateUpdated": "2023-11-07T05:31:56Z",
  "dateLastUsed": "2023-11-07T05:31:56Z",
  "secureKey": "sk-ol-*************************5PW0"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your workspace API key. See Find your API key for more information.

Path Parameters

workspaceId
string
required

The workspace id.

Body

application/json
name
any

Response

201 - application/json
Status Created.
id
string
required

The API key id.

dateCreated
string
required

The API key creation date.

dateUpdated
string
required

The API key last update date.

dateLastUsed
string | null
required

The API key last use date.

secureKey
string
required

The API key value.

Maximum length: 120
name
string | null

The API key name.

Maximum length: 120