Skip to content

Add a custom event type

POST
/v1/buyer/event-types
curl --request POST \
--url https://example.com/v1/buyer/event-types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "code": "example", "counted": true, "name": "example", "repeatable": true }'

Who: a workspace’s buyer, or its key. API keys with the buyer:write scope.

Idempotency-Key
string
<= 64 characters

Made once per action and sent again on every retry of it, so the service acts once: the request_id of the create or money-moving call; a new one when left out

Media typeapplication/json
object
code
string
counted
boolean | null
name
string | null
repeatable
boolean | null

Example generated

{
"code": "example",
"counted": true,
"name": "example",
"repeatable": true
}

Created

Media typeapplication/json
object
builtin
required
boolean
code
required
string
counted
required
boolean
created_at
required
string format: date-time
kind
required
string | null
Allowed values: lead registration sale deposit subscription rebill custom install reengagement
name
required
string
repeatable
required
boolean
sequence
required
integer format: int64
updated_at
required
string format: date-time
workspace_id
required
integer format: int64

Example

{
"kind": "lead"
}

An error, as go-commons apperr maps it

Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string

Example generated

{
"error": {
"code": "example",
"fields": {
"additionalProperty": "example"
},
"message": "example"
}
}