stable · api · 0.1.0
Create a Notification Intent
POST /api/v1/notification-intents
Capability Domain: Notifications
Authentication
projectCredential (notifications:write)
Scope: notifications:write
Parameters and request body
-
Idempotency-Key— header, requiredIdempotency-Key schema { "type": "string", "maxLength": 120 } -
X-Correlation-ID— header, optionalX-Correlation-ID schema { "type": "string", "format": "uuid" }
Request schema
application/json
{
"type": "object",
"additionalProperties": false,
"required": [
"sender_profile_id",
"template_key",
"locale",
"endpoint_id",
"variables"
],
"properties": {
"sender_profile_id": {
"type": "string",
"format": "uuid"
},
"template_key": {
"type": "string",
"maxLength": 120
},
"locale": {
"type": "string",
"maxLength": 20
},
"endpoint_id": {
"type": "string",
"format": "uuid"
},
"variables": {
"type": "object",
"maxProperties": 50,
"additionalProperties": {
"oneOf": [
{
"type": "string",
"maxLength": 5000
},
{
"type": "integer"
},
{
"type": "number"
}
]
}
},
"marketing_purpose": {
"type": [
"string",
"null"
],
"maxLength": 120
}
}
}
application/json request example
{
"sender_profile_id": "81000000-0000-4000-8000-000000000001",
"template_key": "sandbox-welcome",
"locale": "zh-TW",
"endpoint_id": "82000000-0000-4000-8000-000000000001",
"variables": {
"display_name": "Sandbox user"
}
}
Responses and errors
| Status | Description |
|---|---|
200 | Durable Notification Intent |
401 | Invalid or revoked Project Credential |
403 | Project Credential lacks the required scope |
422 | Request violates the public contract |
200 schema
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"intent_id",
"delivery_id",
"status"
],
"properties": {
"intent_id": {
"type": "string",
"format": "uuid"
},
"delivery_id": {
"type": "string",
"format": "uuid"
},
"status": {
"type": "string",
"enum": [
"pending"
]
}
}
}
}
}
401 schema
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message",
"retryable",
"correlation_id",
"details"
],
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"correlation_id": {
"type": "string",
"format": "uuid"
},
"details": {
"type": "object"
}
}
}
}
}
403 schema
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message",
"retryable",
"correlation_id",
"details"
],
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"correlation_id": {
"type": "string",
"format": "uuid"
},
"details": {
"type": "object"
}
}
}
}
}
422 schema
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message",
"retryable",
"correlation_id",
"details"
],
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"correlation_id": {
"type": "string",
"format": "uuid"
},
"details": {
"type": "object"
}
}
}
}
}
200 example
{
"data": {
"intent_id": "84000000-0000-4000-8000-000000000001",
"delivery_id": "85000000-0000-4000-8000-000000000001",
"status": "pending"
}
}
Idempotency
Requires Idempotency-Key. Retry the same Notification Intent with the same key and unchanged body.