Strait Docs
API Reference

Inbound event source and subscription management

List event sources

GET
/v1/event-sources

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

project_id*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/event-sources?project_id=string"
[
  {
    "id": "string",
    "project_id": "string",
    "name": "string",
    "description": "string",
    "schema": {},
    "enabled": true,
    "signature_header": "string",
    "signature_algorithm": "hmac-sha256",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
]

Create an event source

POST
/v1/event-sources

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/event-sources" \  -H "Content-Type: application/json" \  -d '{    "project_id": "string",    "name": "string"  }'
{
  "id": "string",
  "project_id": "string",
  "name": "string",
  "description": "string",
  "schema": {},
  "enabled": true,
  "signature_header": "string",
  "signature_algorithm": "hmac-sha256",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Get an event source

GET
/v1/event-sources/{sourceID}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

sourceID*string

Query Parameters

project_id*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/event-sources/string?project_id=string"
{
  "id": "string",
  "project_id": "string",
  "name": "string",
  "description": "string",
  "schema": {},
  "enabled": true,
  "signature_header": "string",
  "signature_algorithm": "hmac-sha256",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Update an event source

PATCH
/v1/event-sources/{sourceID}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

sourceID*string

Query Parameters

project_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH "http://localhost:8080/v1/event-sources/string?project_id=string" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Delete an event source

DELETE
/v1/event-sources/{sourceID}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

sourceID*string

Query Parameters

project_id*string

Response Body

curl -X DELETE "http://localhost:8080/v1/event-sources/string?project_id=string"
Empty

List subscriptions for an event source

GET
/v1/event-sources/{sourceID}/subscriptions

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

sourceID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/event-sources/string/subscriptions"
[
  {
    "id": "string",
    "source_id": "string",
    "target_type": "job",
    "target_id": "string",
    "filter_expr": {},
    "enabled": true,
    "created_at": "2019-08-24T14:15:22Z"
  }
]

Subscribe to an event source

POST
/v1/event-sources/{sourceID}/subscribe

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

sourceID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/event-sources/string/subscribe" \  -H "Content-Type: application/json" \  -d '{    "target_type": "job",    "target_id": "string"  }'
{
  "id": "string",
  "source_id": "string",
  "target_type": "job",
  "target_id": "string",
  "filter_expr": {},
  "enabled": true,
  "created_at": "2019-08-24T14:15:22Z"
}

Delete a subscription

DELETE
/v1/event-sources/{sourceID}/subscriptions/{subID}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

sourceID*string
subID*string

Response Body

curl -X DELETE "http://localhost:8080/v1/event-sources/string/subscriptions/string"
Empty

Dispatch an event

POST
/v1/events/dispatch

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/events/dispatch" \  -H "Content-Type: application/json" \  -d '{    "source": "string",    "project_id": "string"  }'
{
  "dispatched": 0,
  "source": "string"
}
Was this page helpful?