Browse Notifications

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, required
    Idempotency-Key schema
    {
        "type": "string",
        "maxLength": 120
    }
  • X-Correlation-ID — header, optional
    X-Correlation-ID schema
    {
        "type": "string",
        "format": "uuid"
    }

Request schema

application/json

application/json request schema
{
    "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

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

StatusDescription
200Durable Notification Intent
401Invalid or revoked Project Credential
403Project Credential lacks the required scope
422Request violates the public contract

200 schema

200 response 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

401 response 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

403 response 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

422 response 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

200 response 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.