Pub/SubCreate subscription
Pub/Sub

Create subscription

Create a new Pub/Sub subscription. Subscriptions receive messages published to a topic and can deliver them via pull or push mechanisms.

curl -X POST "https://api.mythic-analytics.com/api/v1/admin/pubsub/subscriptions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "name": "analytics-events-processor",
  "topic": "analytics.events",
  "push_endpoint": "example_string",
  "ack_deadline_seconds": 42,
  "max_delivery_attempts": 42,
  "filter": {
    "event_type": "pageview"
  }
}'
{
  "success": true,
  "data": {
    "id": "sub_5kN2mPqR",
    "name": "analytics-events-processor",
    "topic": "analytics.events",
    "status": "active",
    "push_endpoint": "example_string",
    "ack_deadline_seconds": 60,
    "max_delivery_attempts": 5,
    "filter": {},
    "created_at": "2024-04-01T10:00:00.000Z"
  }
}
POST
/admin/pubsub/subscriptions
POST
Security Scheme
Bearer Tokenstring
Required

Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY

Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY
Content-Typestring
Required

The media type of the request body

Options: application/json
namestring
Required

Unique subscription name.

topicstring
Required

Topic to subscribe to.

push_endpointstring

Optional push delivery URL. If omitted, use pull delivery.

Format: uri
ack_deadline_secondsinteger

Time in seconds to acknowledge a message before redelivery. Default 60.

max_delivery_attemptsinteger

Maximum delivery attempts before dead-lettering. Default 5.

filterobject

Message attribute filter.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY

Body

application/json
namestring
Required

Unique subscription name.

topicstring
Required

Topic to subscribe to.

push_endpointstring

Optional push delivery URL. If omitted, use pull delivery.

ack_deadline_secondsinteger

Time in seconds to acknowledge a message before redelivery. Default 60.

max_delivery_attemptsinteger

Maximum delivery attempts before dead-lettering. Default 5.

filterobject

Message attribute filter.

Responses