Add a custom event type
POST
/v1/buyer/event-types
const url = 'https://example.com/v1/buyer/event-types';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"example","counted":true,"name":"example","repeatable":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Idempotency-Key
string
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
Request Bodyrequired
Section titled “Request Bodyrequired”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}Responses
Section titled “Responses”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
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"}default
Section titled “default”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" }}