Event write keys

Create event write key

Creates an event write key for an SDK or webhook connection. Returns an error if the connection already has the maximum limit of 20 keys.

Request

  • :id

    int Required

    The ID of the connection for which to create the key. It must be an SDK or webhook connection.

Response

  • key

    string

    The newly created key.

POST /v1/connections/:id/event-write-keys
curl -X POST https://example.com/v1/connections/1371036433/event-write-keys \
-H "Authorization: Bearer api_xxxxxxx"
Response
{
  "key": "aC7B37Bug92OI2JSnl9eKrfGeecZT5hA"
}
Errors
404
workspace does not exist
404
connection does not exist
422
connection already has 20 keys

List all event write keys

Returns all event write keys for an SDK or webhook connection.

Request

  • :id

    int Required

    The ID of the connection for which to return the keys. It must be an SDK or webhook connection.

Response

  • keys

    array of string

    The keys of the connection. At least one key is guaranteed to be present.

GET /v1/connections/:id/event-write-keys
curl https://example.com/v1/connections/1371036433/event-write-keys \
-H "Authorization: Bearer api_xxxxxxx"
Response
{
  "keys": [
    "aC7B37Bug92OI2JSnl9eKrfGeecZT5hA",
    "9HnSIbfreXvzD8tCb0L04xSseUNOavEp"
  ]
}
Errors
404
workspace does not exist
404
connection does not exist

Delete event write key

Deletes an event write key from an SDK or webhook connection. If the connection has only one key, it cannot be deleted.

Request

  • :id

    int Required

    The ID of the connection for which to delete the key. It must be an SDK or webhook connection.

  • :key

    string Required

    The key to delete.

Response

No response.
DELETE /v1/connections/:id/event-write-keys/:key
curl -X DELETE https://example.com/v1/connections/1371036433/event-write-keys/aC7B37Bug92OI2JSnl9eKrfGeecZT5hA \
-H "Authorization: Bearer api_xxxxxxx"
Errors
404
workspace does not exist
404
connection does not exist
404
key does not exist
422
key cannot be deleted as it is the connection's only key