Skip to main content
POST
Create an Event Contract

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The input for creating a Contract

name
string
required

The contract's name

slug
string

The contract's slug. If not specified, one will be generated.

description
string

The contract's description

onUndeclaredSchema
enum<string>

What happens to events that aren't defined in the contract. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT.

Available options:
ALLOW_EVENT,
BLOCK_EVENT
events
object[]

The definitions for the events in the contract.

Response

Ok

A collection of schemas that are used for validating your events.

id
string
required

The contract's id

name
string
required

The contract's name

workspaceId
number<double>
required

The id of the workspace that the contract belongs to

createdAt
string<date-time>
required

The timestamp when the contract was created

updatedAt
string<date-time>
required

The timestamp when the contract was last updated

eventSources
object[]
required

The Event Sources linked to the Contract.

slug
string

The contract's slug. If not specified, one will be generated.

description
string

The contract's description

onUndeclaredSchema
enum<string>

What happens to events that aren't defined in the contract. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT.

Available options:
ALLOW_EVENT,
BLOCK_EVENT
events
object[]

The definitions for the events in the contract.