Svix Message API

Messages are the webhook events being sent.

OpenAPI Specification

svix-message-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Svix Application Message API
  description: 'Welcome to the Svix API documentation!


    Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/)


    # Introduction


    This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com).


    ## Main concepts


    In Svix you have four important entities you will be interacting with:


    - `messages`: these are the webhooks being sent. They can have contents and a few other properties.

    - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform.

    - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type).

    - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint.



    ## Authentication


    Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys).


    <SecurityDefinitions />



    ## Code samples


    The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/).



    ## Idempotency


    Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response.


    To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Your idempotency key should not begin with the string `auto_`, which is reserved for internal use by the client libraries.


    Svix''s idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result for a period of up to 12 hours.


    Please note that idempotency is only supported for `POST` requests.



    ## Cross-Origin Resource Sharing


    This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.

    '
  version: 1.84.0
  x-logo:
    altText: Svix Logo
    url: https://www.svix.com/static/img/brand-padded.svg
servers:
- url: https://api.eu.svix.com/
  description: The Svix EU region
- url: https://api.us.svix.com/
  description: The Svix US region
- url: https://api.ca.svix.com/
  description: The Svix Canada region
- url: https://api.au.svix.com/
  description: The Svix Australia region
- url: https://api.in.svix.com/
  description: The Svix India region
tags:
- name: Message
  description: Messages are the webhook events being sent.
paths:
  /api/v1/app/{app_id}/msg:
    get:
      tags:
      - Message
      summary: List Messages
      description: 'List all of the application''s messages.


        The `before` and `after` parameters let you filter all items created before or after a certain date. These can be

        used alongside an iterator to paginate over results within a certain window.


        Note that by default this endpoint is limited to retrieving 90 days'' worth of data

        relative to now or, if an iterator is provided, 90 days before/after the time indicated

        by the iterator ID. If you require data beyond those time ranges, you will need to explicitly

        set the `before` or `after` parameter as appropriate.'
      operationId: v1.message.list
      parameters:
      - in: path
        name: app_id
        description: The Application's ID or UID.
        required: true
        schema:
          description: The Application's ID or UID.
          type: string
          maxLength: 256
          minLength: 1
          pattern: ^[a-zA-Z0-9\-_.]+$
          example: unique-identifier
        style: simple
      - in: query
        name: limit
        description: Limit the number of returned items
        schema:
          description: Limit the number of returned items
          type: integer
          format: uint64
          maximum: 250.0
          minimum: 1.0
        style: form
      - in: query
        name: iterator
        description: The iterator returned from a prior invocation
        schema:
          description: The iterator returned from a prior invocation
          type: string
          maxLength: 31
          minLength: 31
          pattern: ^msg_[A-Za-z0-9]{27}$
          nullable: true
          example: msg_1srOrx2ZWZBpBUvZwXKQmoEYga2
        style: form
      - in: query
        name: channel
        description: Filter response based on the channel.
        schema:
          description: Filter response based on the channel.
          type: string
          maxLength: 128
          pattern: ^[a-zA-Z0-9\-_.:]+$
          nullable: true
          example: project_1337
        style: form
      - in: query
        name: before
        description: Only include items created before a certain date.
        schema:
          description: Only include items created before a certain date.
          type: string
          format: date-time
          nullable: true
        style: form
      - in: query
        name: after
        description: Only include items created after a certain date.
        schema:
          description: Only include items created after a certain date.
          type: string
          format: date-time
          nullable: true
        style: form
      - in: query
        name: with_content
        description: When `true` message payloads are included in the response.
        schema:
          description: When `true` message payloads are included in the response.
          default: true
          type: boolean
        style: form
      - in: query
        name: tag
        description: Filter messages matching the provided tag.
        schema:
          description: Filter messages matching the provided tag.
          type: string
          maxLength: 128
          pattern: ^[a-zA-Z0-9\-_./\\#]+$
          nullable: true
          example: project_1337
        style: form
      - in: query
        name: event_types
        description: Filter response based on the event type
        schema:
          description: Filter response based on the event type
          type: array
          items:
            description: The event type's name
            type: string
            maxLength: 256
            pattern: ^[a-zA-Z0-9\-_.]+$
            example: user.signup
          uniqueItems: true
          nullable: true
        style: form
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResponse_MessageOut_'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
      security:
      - HTTPBearer: []
      x-codeSamples:
      - label: JavaScript
        lang: TypeScript
        source: const response = await svix.message.list("app_1srOrx2ZWZBpBUvZwXKQmoEYga2");
      - label: TypeScript
        lang: TypeScript
        source: const response = await svix.message.list("app_1srOrx2ZWZBpBUvZwXKQmoEYga2");
      - label: Python
        lang: Python
        source: "response = svix.message.list(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n)"
      - label: Python (Async)
        lang: Python
        source: "response = await svix.message.list(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n)"
      - label: Go
        lang: Go
        source: response, err := svix.Message.List(ctx, "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", nil)
      - label: Kotlin
        lang: Kotlin
        source: val response = svix.message.list("app_1srOrx2ZWZBpBUvZwXKQmoEYga2")
      - label: Java
        lang: Java
        source: var response = svix.getMessage().list("app_1srOrx2ZWZBpBUvZwXKQmoEYga2");
      - label: Ruby
        lang: Ruby
        source: response = svix.message.list("app_1srOrx2ZWZBpBUvZwXKQmoEYga2")
      - label: Rust
        lang: Rust
        source: "let response = svix\n    .message()\n    .list(\"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\".to_string(), None)\n    .await?;"
      - label: C#
        lang: C#
        source: var response = svix.Message.List("app_1srOrx2ZWZBpBUvZwXKQmoEYga2");
      - label: PHP
        lang: PHP
        source: "$response = $svix->message->list(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\"\n);"
      - label: CLI
        lang: Shell
        source: svix message list "app_1srOrx2ZWZBpBUvZwXKQmoEYga2"
      - label: cURL
        lang: Shell
        source: "curl -X 'GET' \\\n  'https://api.eu.svix.com/api/v1/app/app_1srOrx2ZWZBpBUvZwXKQmoEYga2/msg' \\\n  -H 'Authorization: Bearer AUTH_TOKEN' \\\n  -H 'Accept: application/json'"
    post:
      tags:
      - Message
      summary: Create Message
      description: 'Creates a new message and dispatches it to all of the application''s endpoints.


        The `eventId` is an optional custom unique ID. It''s verified to be unique only up to a day, after that no verification will be made.

        If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned.


        The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types.

        Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don''t imply a specific message content or schema.


        The `payload` property is the webhook''s body (the actual webhook message). Svix supports payload sizes of up to 1MiB, though it''s generally a good idea to keep webhook payloads small, probably no larger than 40kb.'
      operationId: v1.message.create
      parameters:
      - in: path
        name: app_id
        description: The Application's ID or UID.
        required: true
        schema:
          description: The Application's ID or UID.
          type: string
          maxLength: 256
          minLength: 1
          pattern: ^[a-zA-Z0-9\-_.]+$
          example: unique-identifier
        style: simple
      - in: query
        name: with_content
        description: When `true`, message payloads are included in the response.
        schema:
          description: When `true`, message payloads are included in the response.
          default: true
          type: boolean
        style: form
      - in: header
        name: idempotency-key
        description: The request's idempotency key
        schema:
          type: string
        style: simple
      - in: header
        name: idempotency-key
        description: The request's idempotency key
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageIn'
        required: true
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageOut'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
      security:
      - HTTPBearer: []
      x-codeSamples:
      - label: JavaScript
        lang: TypeScript
        source: "const response = await svix.message.create(\"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\", {\n  application: {\n    metadata: {},\n    name: \"My first application\",\n    throttleRate: 1,\n    uid: \"unique-identifier\",\n  },\n  channels: [\"project_123\", \"group_2\"],\n  deliverAt: new Date(\"2025-10-02T20:28:42+00:00\"),\n  eventId: \"unique-identifier\",\n  eventType: \"user.signup\",\n  payload: { email: \"test@example.com\", type: \"user.created\", username: \"test_user\" },\n  payloadRetentionHours: 1,\n  payloadRetentionPeriod: 90,\n  tags: [\"my_tag\", \"other\"],\n  transformationsParams: {},\n});\n\n// Alternatively, with a raw string payload.\nconst response = await svix.message.create(\n  \"app_id\",\n  messageInRaw(\"user.signup\", \"This is a raw body.\", \"text/plain\")\n);"
      - label: TypeScript
        lang: TypeScript
        source: "const response = await svix.message.create(\"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\", {\n  application: {\n    metadata: {},\n    name: \"My first application\",\n    throttleRate: 1,\n    uid: \"unique-identifier\",\n  },\n  channels: [\"project_123\", \"group_2\"],\n  deliverAt: new Date(\"2025-10-02T20:28:42+00:00\"),\n  eventId: \"unique-identifier\",\n  eventType: \"user.signup\",\n  payload: { email: \"test@example.com\", type: \"user.created\", username: \"test_user\" },\n  payloadRetentionHours: 1,\n  payloadRetentionPeriod: 90,\n  tags: [\"my_tag\", \"other\"],\n  transformationsParams: {},\n});\n\n// Alternatively, with a raw string payload.\nconst response = await svix.message.create(\n  \"app_id\",\n  messageInRaw(\"user.signup\", \"This is a raw body.\", \"text/plain\")\n);"
      - label: Python
        lang: Python
        source: "response = svix.message.create(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n    MessageIn(\n        application=ApplicationIn(\n            metadata={},\n            name=\"My first application\",\n            throttle_rate=1,\n            uid=\"unique-identifier\",\n        ),\n        channels=[\n            \"project_123\",\n            \"group_2\",\n        ],\n        deliver_at=datetime.fromisoformat(\"2025-10-02T20:28:42+00:00\"),\n        event_id=\"unique-identifier\",\n        event_type=\"user.signup\",\n        payload={\n            \"email\": \"test@example.com\",\n            \"type\": \"user.created\",\n            \"username\": \"test_user\",\n        },\n        payload_retention_hours=1,\n        payload_retention_period=90,\n        tags=[\n            \"my_tag\",\n            \"other\",\n        ],\n        transformations_params={},\n    ),\n)\n\n# Alternatively, with a raw string payload.\nresponse = svix.message.create(\n    \"app_id\",\n    message_in_raw(\n        event_type=\"user.signup\",\n        payload=\"This is a raw body.\",\n        content_type=\"text/plain\",\n    ),\n)"
      - label: Python (Async)
        lang: Python
        source: "response = await svix.message.create(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n    MessageIn(\n        application=ApplicationIn(\n            metadata={},\n            name=\"My first application\",\n            throttle_rate=1,\n            uid=\"unique-identifier\",\n        ),\n        channels=[\n            \"project_123\",\n            \"group_2\",\n        ],\n        deliver_at=datetime.fromisoformat(\"2025-10-02T20:28:42+00:00\"),\n        event_id=\"unique-identifier\",\n        event_type=\"user.signup\",\n        payload={\n            \"email\": \"test@example.com\",\n            \"type\": \"user.created\",\n            \"username\": \"test_user\",\n        },\n        payload_retention_hours=1,\n        payload_retention_period=90,\n        tags=[\n            \"my_tag\",\n            \"other\",\n        ],\n        transformations_params={},\n    ),\n)\n\n# Alternatively, with a raw string payload.\nresponse = await svix.message.create(\n    \"app_id\",\n    message_in_raw(\n        event_type=\"user.signup\",\n        payload=\"This is a raw body.\",\n        content_type=\"text/plain\",\n    ),\n)"
      - label: Go
        lang: Go
        source: "response, err := svix.Message.Create(\n\tctx,\n\t\"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n\tMessageIn{\n\t\tApplication: new(\n\t\t\tApplicationIn{\n\t\t\t\tMetadata:     nil,\n\t\t\t\tName:         \"My first application\",\n\t\t\t\tThrottleRate: new(uint16(1)),\n\t\t\t\tUid:          new(\"unique-identifier\"),\n\t\t\t},\n\t\t),\n\t\tChannels:  []string{\"project_123\", \"group_2\"},\n\t\tDeliverAt: new(time.Date(2025, 10, 2, 20, 28, 42, 0, time.UTC)),\n\t\tEventId:   new(\"unique-identifier\"),\n\t\tEventType: \"user.signup\",\n\t\tPayload: map[string]any{\n\t\t\t\"email\":    \"test@example.com\",\n\t\t\t\"type\":     \"user.created\",\n\t\t\t\"username\": \"test_user\",\n\t\t},\n\t\tPayloadRetentionHours:  new(int64(1)),\n\t\tPayloadRetentionPeriod: new(int64(90)),\n\t\tTags:                   []string{\"my_tag\", \"other\"},\n\t\tTransformationsParams:  nil,\n\t},\n\tnil,\n)\n\n// Alternatively, with a raw string payload.\nresponse, err := svix.Message.Create(ctx, \"app_id\", &NewMessageInRaw(\n\t\"user.signup\",\n\t\"This is a raw body.\",\n\t&\"text/plain\",\n))"
      - label: Kotlin
        lang: Kotlin
        source: "val response =\n    svix.message.create(\n        \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n        MessageIn(\n            application =\n                ApplicationIn(\n                    metadata = mapOf(),\n                    name = \"My first application\",\n                    throttleRate = 1u,\n                    uid = \"unique-identifier\",\n                ),\n            channels = setOf(\"project_123\", \"group_2\"),\n            deliverAt = Instant.parse(\"2025-10-02T20:28:42+00:00\"),\n            eventId = \"unique-identifier\",\n            eventType = \"user.signup\",\n            payload =\n                \"{\\\"email\\\": \\\"test@example.com\\\",\\\"type\\\": \\\"user.created\\\",\\\"username\\\": \\\"test_user\\\"}\",\n            payloadRetentionHours = 1,\n            payloadRetentionPeriod = 90,\n            tags = setOf(\"my_tag\", \"other\"),\n            transformationsParams = mapOf(),\n        ),\n    )\n\n// Alternatively, with a raw string payload.\nval response =\n    svix.message.create(\n        \"app_id\",\n        messageInRaw(\n            eventType = \"user.signup\",\n            payload = \"This is a raw body.\",\n            contentType = \"text/plain\",\n        ),\n    )"
      - label: Java
        lang: Java
        source: "var response = svix.getMessage()\n        .create(\n            \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n            new MessageIn()\n                .application(new ApplicationIn()\n                    .metadata(Map.of())\n                    .name(\"My first application\")\n                    .throttleRate(1L)\n                    .uid(\"unique-identifier\"))\n                .channels(Set.of(\"project_123\", \"group_2\"))\n                .deliverAt(OffsetDateTime.parse(\"2025-10-02T20:28:42+00:00\"))\n                .eventId(\"unique-identifier\")\n                .eventType(\"user.signup\")\n                .payload(\"{\\\"email\\\": \\\"test@example.com\\\",\\\"type\\\": \\\"user.created\\\",\\\"username\\\":\"\n                    + \" \\\"test_user\\\"}\")\n                .payloadRetentionHours(1L)\n                .payloadRetentionPeriod(90L)\n                .tags(Set.of(\"my_tag\", \"other\"))\n                .transformationsParams(Map.of()));\n\n    // Alternatively, with a raw string payload.\n    var response = svix.getMessage()\n        .create(\n            \"app_id\",\n            Message.messageInRaw(\"This is a raw body.\", \"text/plain\").eventType(\"user.signup\"));"
      - label: Ruby
        lang: Ruby
        source: "# Alternatively, with a raw string payload.\nresponse = svix\n  .message\n  .create(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n    {\n      application: {metadata: {}, name: \"My first application\", throttleRate: 1, uid: \"unique-identifier\"},\n      channels: [\"project_123\", \"group_2\"],\n      deliverAt: \"2025-10-02T20:28:42+00:00\",\n      eventId: \"unique-identifier\",\n      eventType: \"user.signup\",\n      payload: {\"email\" => \"test@example.com\", \"type\" => \"user.created\", \"username\" => \"test_user\"},\n      payloadRetentionHours: 1,\n      payloadRetentionPeriod: 90,\n      tags: [\"my_tag\", \"other\"],\n      transformationsParams: {}\n    }\n  )\nresponse = svix.message.create(\n  \"app_id\",\n  message_in_raw(\n    payload: \"This is a raw body.\",\n    eventType: \"user.signup\",\n    content_type: \"test/plain\"\n  )\n)"
      - label: Rust
        lang: Rust
        source: "let response = svix\n    .message()\n    .create(\n        \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\".to_string(),\n        MessageIn {\n            application: Some(ApplicationIn {\n                metadata: Some(HashMap::new()),\n                name: \"My first application\".to_string(),\n                throttle_rate: Some(1),\n                uid: Some(\"unique-identifier\".to_string()),\n            }),\n            channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n            deliver_at: Some(\"2025-10-02T20:28:42+00:00\".to_string()),\n            event_id: Some(\"unique-identifier\".to_string()),\n            event_type: \"user.signup\".to_string(),\n            payload: serde_json::json!(\n                { \"email\" : \"test@example.com\", \"type\" : \"user.created\", \"username\" :\n                \"test_user\" }\n            ),\n            payload_retention_hours: Some(1),\n            payload_retention_period: Some(90),\n            tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n            transformations_params: Some(serde_json::json!({})),\n        },\n        None,\n    )\n    .await?;\n/// Alternatively, with a raw string payload.\nlet response = svix\n    .message()\n    .create(\n        \"app_id\",\n        MessageIn::new_raw_payload(\n                \"user.signup\".to_string(),\n                \"This is a raw body.\".to_string(),\n            )\n            .with_content_type(\"text/plain\".to_string()),\n        None,\n    )\n    .await?;"
      - label: C#
        lang: C#
        source: "var response = svix.Message.Create(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n    new MessageIn\n    {\n        Application = new ApplicationIn\n        {\n            Metadata = [],\n            Name = \"My first application\",\n            ThrottleRate = 1,\n            Uid = \"unique-identifier\",\n        },\n        Channels = [\"project_123\", \"group_2\"],\n        DeliverAt = DateTime.Parse(\"2025-10-02T20:28:42+00:00\"),\n        EventId = \"unique-identifier\",\n        EventType = \"user.signup\",\n        Payload = new Dictionary<string, string>\n        {\n            { \"email\", \"test@example.com\" },\n            { \"type\", \"user.created\" },\n            { \"username\", \"test_user\" },\n        },\n        PayloadRetentionHours = 1,\n        PayloadRetentionPeriod = 90,\n        Tags = [\"my_tag\", \"other\"],\n        TransformationsParams = new Dictionary<string, string> { },\n    }\n);\n\n// Alternatively, with a raw string payload.\nvar response = await svix.Message.CreateAsync(\n    \"app_id\",\n    svix.Message.messageInRaw(\n        eventType: \"user.signup\",\n        payload: \"This is a raw body.\",\n        contentType: \"text/plain\"\n    )\n);"
      - label: PHP
        lang: PHP
        source: "$response = $svix->message->create(\n    \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\",\n    MessageIn::create(\n        eventType: \"user.signup\",\n        payload: [\"email\" => \"test@example.com\", \"type\" => \"user.created\", \"username\" => \"test_user\"]\n    )\n    ->withApplication(ApplicationIn::create(\n        name: \"My first application\"\n    )\n    ->withMetadata([])\n    ->withThrottleRate(1)\n    ->withUid(\"unique-identifier\"))\n    ->withChannels([\"project_123\",\"group_2\"])\n    ->withDeliverAt(new DateTimeImmutable(\"2025-10-02T20:28:42+00:00\"))\n    ->withEventId(\"unique-identifier\")\n    ->withPayloadRetentionHours(1)\n    ->withPayloadRetentionPeriod(90)\n    ->withTags([\"my_tag\",\"other\"])\n);\n\n// Alternatively, with a raw string payload.\n$response = $svix->message->create(\n    \"app_id\",\n    MessageIn::createRaw(\n        \"user.signup\",\n        \"This is a raw body.\",\n        \"text/plain\"\n    )\n);"
      - label: CLI
        lang: Shell
        source: "svix message create \"app_1srOrx2ZWZBpBUvZwXKQmoEYga2\" '{\n    \"application\": {\n      \"metadata\": {},\n      \"name\": \"My first application\",\n      \"throttleRate\": 1,\n      \"uid\": \"unique-identifier\"\n    },\n    \"channels\": [\n      \"project_123\",\n      \"group_2\"\n    ],\n    \"deliverAt\": \"2025-10-02T20:28:42+00:00\",\n    \"eventId\": \"unique-identifier\",\n    \"eventType\": \"user.signup\",\n    \"payload\": {\n      \"email\": \"test@example.com\",\n      \"type\": \"user.created\",\n      \"username\": \"test_user\"\n    },\n    \"payloadRetentionHours\": 1,\n    \"payloadRetentionPeriod\": 90,\n    \"tags\": [\n      \"my_tag\",\n      \"other\"\n    ],\n    \"transformationsParams\": {}\n  }'"
      - label: cURL
        lang: Shell
        source: "curl -X 'POST' \\\n  'https://api.eu.svix.com/api/v1/app/app_1srOrx2ZWZBpBUvZwXKQmoEYga2/msg' \\\n  -H 'Authorization: Bearer AUTH_TOKEN' \\\n  -H 'Accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"application\": {\n      \"metadata\": {},\n      \"name\": \"My first application\",\n      \"throttleRate\": 1,\n      \"uid\": \"unique-identifier\"\n    },\n    \"channels\": [\n      \"project_123\",\n      \"group_2\"\n    ],\n    \"deliverAt\": \"2025-10-02T20:28:42+00:00\",\n    \"eventId\": \"unique-identifier\",\n    \"eventType\": \"user.signup\",\n    \"payload\": {\n      \"email\": \"test@example.com\",\n      \"type\": \"user.created\",\n      \"username\": \"test_user\"\n    },\n    \"payloadRetentionHours\": 1,\n    \"payloadRetentionPeriod\": 90,\n    \"tags\": [\n      \"my_tag\",\n      \"other\"\n    ],\n    \"transformationsParams\": {}\n  }'\n\n\n# Alternatively, with a raw string payload.\ncurl -X 'POST' \\\n  'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n  -H 'Authorization: Bearer AUTH_TOKEN' \\\n  -H 'Accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n      \"eventType\": \"user.signup\",\n      \"payload\": {},\n      \"transformationsParams\": {\n          \"rawPayload\": \"This is a raw body.\",\n          \"headers\": { \"content-type\": \"text/plain\" }\n      }\n  }'"
  /api/v1/app/{app_id}/msg/expunge-all-contents:
    post:
      tags:
      - Message
      summary: Expunge all message contents
      description: "Delete all message payloads for the application.\n\nThis operation is only available in the <a href=\"https://svix.com/pricing\" target=\"_blank\">Enterprise</a> plan.\n\nA completed task will return a payload like the following:\n```json\n{\n  \"id\": \"qtask_33qen93MNuelBAq1T9G7eHLJRsF\",\n  \"status\": \"finished\",\n  \"task\": \"application.purge_content\",\n  \"data\": {\n    \"messagesPurged\": 150\n  }\n}\n```"
      operationId: v1.message.expunge-all-contents
      parameters:
      - in: path
        name: app_id
        description: The Application's ID or UID.
        required: true
        schema:
          description: The Application's ID or UID.
          type: string
          maxLength: 256
          minLength: 1
          pattern: ^[a-zA-Z0-9\-_.]+$
          example: unique-identifier
        style: simple
      - in: header
        name: idempotency-key
        description: The request's idempotency key
        schema:
          type: string
        style: simple
      - in: header
        name: idempotency-key
        description: The request's idempotency key
        schema:
          type: string
        style: simple
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpungeAllContentsOut'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
      security:
      - HTTPBearer: []
      x-codeSamples:
      - label: JavaScript
        lang: TypeScript


# --- truncated at 32 KB (96 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/svix/refs/heads/main/openapi/svix-message-api-openapi.yml