Pub/Sub API reference
Durable project-scoped publish and subscribe delivery.
Published contracts: @socra/pubsub-api@0.0.2.
Base URL
https://pubsub.socra.cloudTopics
A project-owned feed to which messages are published.
Create topic
POST
/v1/projects/{project_id}/topicsPath parameters
project_idcustomrequiredRequest body
namestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$retention_secondsintegeroptionaldefault: 86400 · min: 600 · max: 604800Response
8 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredstatus"active" | "deleted"requiredretention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredList topics
GET
/v1/projects/{project_id}/topicsPath parameters
project_idcustomrequiredQuery parameters
limitintegeroptionalmin: 1 · max: 100afterstringoptionalResponse
2 fields
dataobject[]required
dataobject[]requiredidcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredstatus"active" | "deleted"requiredretention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredhas_morebooleanrequiredGet topic
GET
/v1/projects/{project_id}/topics/{topic}Path parameters
project_idcustomrequiredtopicstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Query parameters
No query parameters
Response
8 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredstatus"active" | "deleted"requiredretention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredUpdate topic
PATCH
/v1/projects/{project_id}/topics/{topic}Path parameters
project_idcustomrequiredtopicstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Request body
retention_secondsintegeroptionalmin: 600 · max: 604800Response
8 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredstatus"active" | "deleted"requiredretention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredDelete topic
DELETE
/v1/projects/{project_id}/topics/{topic}Path parameters
project_idcustomrequiredtopicstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Query parameters
No query parameters
Response
No response body
Topic bindings
A project permission to publish to or subscribe to a topic.
Create topic binding
POST
/v1/projects/{project_id}/topics/{topic}/bindingsPath parameters
project_idcustomrequiredtopicstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Request body
project_idcustomrequiredrole"publisher" | "subscriber"requiredResponse
5 fields
idcustomrequiredtopicstringrequiredproject_idcustomrequiredrole"publisher" | "subscriber"requiredcreated_atcustomrequiredList topic bindings
GET
/v1/projects/{project_id}/topics/{topic}/bindingsPath parameters
project_idcustomrequiredtopicstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Query parameters
limitintegeroptionalmin: 1 · max: 100afterstringoptionalResponse
2 fields
dataobject[]required
dataobject[]requiredidcustomrequiredtopicstringrequiredproject_idcustomrequiredrole"publisher" | "subscriber"requiredcreated_atcustomrequiredhas_morebooleanrequiredDelete topic binding
DELETE
/v1/projects/{project_id}/topics/{topic}/bindings/{binding_id}Path parameters
project_idcustomrequiredtopicstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$binding_idcustomrequiredQuery parameters
No query parameters
Response
No response body
Subscriptions
An independently acknowledged delivery stream from one topic.
Create subscription
POST
/v1/projects/{project_id}/subscriptionsPath parameters
project_idcustomrequiredRequest body
namestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$topicstringrequiredpattern: ^projects\/proj_[0-9a-hjkmnp-tv-z]{26}\/topics\/[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$ack_deadline_secondsintegeroptionaldefault: 60 · min: 10 · max: 600retention_secondsintegeroptionaldefault: 86400 · min: 600 · max: 604800Response
10 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredtopicstringrequiredpattern: ^projects\/proj_[0-9a-hjkmnp-tv-z]{26}\/topics\/[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$status"active" | "paused" | "deleted"requiredack_deadline_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991retention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredList subscriptions
GET
/v1/projects/{project_id}/subscriptionsPath parameters
project_idcustomrequiredQuery parameters
limitintegeroptionalmin: 1 · max: 100afterstringoptionalResponse
2 fields
dataobject[]required
dataobject[]requiredidcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredtopicstringrequiredpattern: ^projects\/proj_[0-9a-hjkmnp-tv-z]{26}\/topics\/[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$status"active" | "paused" | "deleted"requiredack_deadline_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991retention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredhas_morebooleanrequiredGet subscription
GET
/v1/projects/{project_id}/subscriptions/{subscription}Path parameters
project_idcustomrequiredsubscriptionstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Query parameters
No query parameters
Response
10 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredtopicstringrequiredpattern: ^projects\/proj_[0-9a-hjkmnp-tv-z]{26}\/topics\/[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$status"active" | "paused" | "deleted"requiredack_deadline_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991retention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredUpdate subscription
PATCH
/v1/projects/{project_id}/subscriptions/{subscription}Path parameters
project_idcustomrequiredsubscriptionstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Request body
status"active" | "paused"optionalack_deadline_secondsintegeroptionalmin: 10 · max: 600retention_secondsintegeroptionalmin: 600 · max: 604800Response
10 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$resource_namestringrequiredtopicstringrequiredpattern: ^projects\/proj_[0-9a-hjkmnp-tv-z]{26}\/topics\/[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$status"active" | "paused" | "deleted"requiredack_deadline_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991retention_secondsintegerrequiredmin: -9007199254740991 · max: 9007199254740991created_atcustomrequiredupdated_atcustomrequiredDelete subscription
DELETE
/v1/projects/{project_id}/subscriptions/{subscription}Path parameters
project_idcustomrequiredsubscriptionstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Query parameters
No query parameters
Response
No response body
Publishers
Message publication operations.
Publish messages
POST
/v1/projects/{project_id}/topics/{topic}/publishPath parameters
project_idcustomrequiredtopicstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Request body
publisher_project_idcustomoptionalmessagesobject[]requiredmin items: 1 · max items: 100
messagesobject[]requiredmin items: 1 · max items: 100datastringrequiredmax length: 10000000attributesobjectoptionaldefault: {}ordering_keystringoptionalmax length: 1024Response
1 field
message_idscustom[]requiredSubscribers
Subscription delivery operations.
Pull messages
POST
/v1/projects/{project_id}/subscriptions/{subscription}/pullPath parameters
project_idcustomrequiredsubscriptionstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Request body
max_messagesintegeroptionaldefault: 10 · min: 1 · max: 100Response
1 field
received_messagesobject[]required
received_messagesobject[]requiredack_tokenstringrequireddelivery_attemptintegerrequiredmin: 1 · max: 9007199254740991messageobjectrequired
messageobjectrequireddatastringrequiredmax length: 10000000attributesobjectrequireddefault: {}ordering_keystringoptionalmax length: 1024idcustomrequiredpublished_atcustomrequiredAcknowledge messages
POST
/v1/projects/{project_id}/subscriptions/{subscription}/acknowledgePath parameters
project_idcustomrequiredsubscriptionstringrequiredmin length: 1 · max length: 128 · pattern: ^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$Request body
ack_tokensstring[]requiredmin items: 1 · max items: 1000Response
1 field
acknowledged_countintegerrequiredmin: -9007199254740991 · max: 9007199254740991