Skip to main content
POST
/
v2.0
/
endpoints
/
{endpointId}
/
apikeys
Create an Endpoint API Key
curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/endpoints/{endpointId}/apikeys \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "My CRM webhook"
}
'
{
  "key": "8a4fcd9b2e5f17b03f9c4a6d7c2e5f17b03f9c4a6d7c2e5f17b03f9c4a6d7c2e",
  "_id": "<string>",
  "name": "My CRM webhook",
  "keyPreview": "8a4f••••••••7c2e",
  "createdAt": 1694518620
}

Authorizations

X-API-Key
string
header
required

Supply the API Key in the HTTP-Header

Headers

Accept
enum<string>

The Accept header specifies the media type that the client expects in the response. Available options: application/json, application/hal+json, application/xml, text/xml, text/csv. The default value is application/json.

Available options:
application/json,
application/hal+json,
application/xml,
text/xml,
text/csv

Path Parameters

endpointId
string
required

The Id of the Endpoint

Required string length: 24
Pattern: ^[a-z0-9]{24}$

Body

application/json

Request body for creating a new Endpoint API Key.

name
string
required

Customer-provided display name for the key.

Example:

"My CRM webhook"

Response

The Endpoint API Key was created. The plaintext key is returned exactly once.

Response body returned exactly once at creation time. The plaintext key is never persisted and never returned by any other route.

key
string
required

The plaintext API key. Returned exactly once. The caller must persist it client-side — the server will not show it again.

Example:

"8a4fcd9b2e5f17b03f9c4a6d7c2e5f17b03f9c4a6d7c2e5f17b03f9c4a6d7c2e"

_id
string
Required string length: 24
Pattern: ^[a-z0-9]{24}$
name
string

Customer-provided display name for the key.

Example:

"My CRM webhook"

keyPreview
string

Masked preview of the plaintext key (first 4 chars + masked middle + last 4 chars). Captured at generation time.

Example:

"8a4f••••••••7c2e"

createdAt
integer

Unix-timestamp

Required range: 0 <= x <= 2147483647
Example:

1694518620

Last modified on June 23, 2026