> ## Documentation Index
> Fetch the complete documentation index at: https://docs.photon.codes/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use Stable documentation by default. Honor an explicit Beta request or a URL under /docs/beta/. If the requested version conflicts with the installed CLI package or API origin, clarify the target before writing integration code.
> Pages under /docs/beta/ document Beta; other product pages document Stable. Keep the CLI package, commands, API origin, and credentials within the selected version. State the documentation version in your answer.
> For MCP search, always pass version: Stable or version: Beta. Unfiltered search mixes both versions. For filesystem reads, keep Beta queries under /beta/ and exclude /beta/ from Stable queries; discover paths before reading them.
> The public docs base is https://photon.codes/docs. Convert MCP page paths to public URLs under that base, preserving /beta/ when present. Read https://photon.codes/docs/skill.md for version selection and https://photon.codes/docs/llms.txt for the version indexes.

# Mark a Message as read

> Persists a request to mark one incoming Message as read using its receiving account. A 202 means accepted for asynchronous execution, not handled by the provider. Requires Idempotency-Key. The returned action Message tracks its outcome; privacy settings may suppress remote visibility.



## OpenAPI

````yaml https://api.photon.codes/openapi.json post /v1/projects/{id}/messages/{messageId}/read
openapi: 3.1.0
info:
  title: Photon API
  version: 1.0.0
servers:
  - url: https://api.photon.codes
security: []
paths:
  /v1/projects/{id}/messages/{messageId}/read:
    post:
      tags:
        - Messages
      summary: Mark a Message as read
      description: >-
        Persists a request to mark one incoming Message as read using its
        receiving account. A 202 means accepted for asynchronous execution, not
        handled by the provider. Requires Idempotency-Key. The returned action
        Message tracks its outcome; privacy settings may suppress remote
        visibility.
      operationId: markMessageRead
      parameters:
        - in: path
          name: id
          required: true
          schema:
            pattern: ^pho_prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
            type: string
        - in: path
          name: messageId
          required: true
          schema:
            pattern: ^pho_msg_[0-7][0-9a-hjkmnp-tv-z]{25}$
            type: string
        - in: header
          name: idempotency-key
          required: true
          schema:
            pattern: ^[\x21-\x7e]{1,255}$
            type: string
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarkMessageReadResponse'
          description: The read request was persisted for execution.
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/InvalidRequestProblem'
          description: 'INVALID_REQUEST: Invalid Request'
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/NotAuthenticatedProblem'
          description: 'NOT_AUTHENTICATED: Not Authenticated'
          headers:
            Link:
              description: Optional related resources.
              schema:
                type: string
            RateLimit:
              description: Optional rate limit information.
              schema:
                type: string
            RateLimit-Policy:
              description: Optional rate limit policy.
              schema:
                type: string
            Retry-After:
              description: Optional retry delay or HTTP date.
              schema:
                type: string
            WWW-Authenticate:
              required: true
              schema:
                type: string
            X-Request-ID:
              description: Application request identifier.
              schema:
                type: string
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/MarkMessageReadForbiddenProblem'
          description: >-
            FORBIDDEN: Forbidden; RESOURCE_MISMATCH: Resource Mismatch


            FORBIDDEN: Forbidden; INSUFFICIENT_SCOPE: Insufficient Scope;
            ORGANIZATION_SSO_REQUIRED: Organization SSO Required
          headers:
            Deprecation:
              description: >-
                RFC 9745 structured-field Date at which the operation was or
                will be deprecated: `@` followed by Unix seconds, for example
                `@1767225599`.
              schema:
                pattern: ^@-?[0-9]+$
                type: string
            Idempotent-Replayed:
              description: True when this response was replayed from an earlier attempt.
              schema:
                type: boolean
            Link:
              description: |-
                Links related to lifecycle or remediation documentation.

                Optional related resources.
              schema:
                type: string
            RateLimit:
              description: |-
                Current rate-limit state.

                Optional rate limit information.
              schema:
                type: string
            RateLimit-Policy:
              description: |-
                Rate-limit policy applied by the gateway.

                Optional rate limit policy.
              schema:
                type: string
            Retry-After:
              description: |-
                Delay before retrying, in seconds or as an HTTP date.

                Optional retry delay or HTTP date.
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594 HTTP-date (IMF-fixdate) after which the operation may
                become unavailable, for example `Thu, 31 Dec 2026 23:59:59 GMT`.
              schema:
                pattern: >-
                  ^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-9]{2}
                  (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{4}
                  [0-9]{2}:[0-9]{2}:[0-9]{2} GMT$
                type: string
            X-Request-ID:
              description: |-
                Identifier for this HTTP attempt.

                Application request identifier.
              schema:
                type: string
            X-Trace-ID:
              description: >-
                Trace ID of this request. Sent alongside X-Request-ID when a
                middleware published a trace ID for the request.
              schema:
                pattern: ^(?!0{32}$)[0-9a-f]{32}$
                type: string
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/MarkMessageReadNotFoundProblem'
          description: >-
            SENDER_NOT_FOUND: Sender Not Found; SPACE_NOT_FOUND: Space Not
            Found; MESSAGE_NOT_FOUND: Message Not Found
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/MarkMessageReadConflictProblem'
          description: >-
            SENDER_NOT_SENDABLE: Sender Not Sendable; SPACE_NOT_SENDABLE: Space
            Not Sendable; MESSAGE_NOT_READABLE: Message Not Readable
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
        '413':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PayloadTooLargeProblem'
          description: 'PAYLOAD_TOO_LARGE: Payload Too Large'
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/MarkMessageReadUnprocessableEntityProblem'
          description: >-
            IDEMPOTENCY_KEY_REUSED: Idempotency Key Reused;
            OPERATION_UNAVAILABLE: Operation Unavailable; VALIDATION_FAILED:
            Request Validation Failed
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/MarkMessageReadInternalServerErrorProblem'
          description: |-
            INVALID_AUTH_CONTEXT: Invalid Authentication Context

            INTERNAL_ERROR: Internal Server Error
          headers:
            Deprecation:
              description: >-
                RFC 9745 structured-field Date at which the operation was or
                will be deprecated: `@` followed by Unix seconds, for example
                `@1767225599`.
              schema:
                pattern: ^@-?[0-9]+$
                type: string
            Idempotent-Replayed:
              description: True when this response was replayed from an earlier attempt.
              schema:
                type: boolean
            Link:
              description: |-
                Links related to lifecycle or remediation documentation.

                Optional related resources.
              schema:
                type: string
            RateLimit:
              description: |-
                Current rate-limit state.

                Optional rate limit information.
              schema:
                type: string
            RateLimit-Policy:
              description: |-
                Rate-limit policy applied by the gateway.

                Optional rate limit policy.
              schema:
                type: string
            Retry-After:
              description: |-
                Delay before retrying, in seconds or as an HTTP date.

                Optional retry delay or HTTP date.
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594 HTTP-date (IMF-fixdate) after which the operation may
                become unavailable, for example `Thu, 31 Dec 2026 23:59:59 GMT`.
              schema:
                pattern: >-
                  ^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-9]{2}
                  (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{4}
                  [0-9]{2}:[0-9]{2}:[0-9]{2} GMT$
                type: string
            X-Request-ID:
              description: |-
                Identifier for this HTTP attempt.

                Application request identifier.
              schema:
                type: string
            X-Trace-ID:
              description: >-
                Trace ID of this request. Sent alongside X-Request-ID when a
                middleware published a trace ID for the request.
              schema:
                pattern: ^(?!0{32}$)[0-9a-f]{32}$
                type: string
        '502':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/UpstreamFailureProblem'
          description: 'UPSTREAM_FAILURE: Upstream Service Failure'
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/UpstreamUnavailableProblem'
          description: 'UPSTREAM_UNAVAILABLE: Upstream Service Unavailable'
          headers:
            Deprecation:
              description: >-
                RFC 9745 structured-field Date at which the operation was or
                will be deprecated: `@` followed by Unix seconds, for example
                `@1767225599`.
              schema:
                pattern: ^@-?[0-9]+$
                type: string
            Idempotent-Replayed:
              description: True when this response was replayed from an earlier attempt.
              schema:
                type: boolean
            Link:
              description: |-
                Links related to lifecycle or remediation documentation.

                Optional related resources.
              schema:
                type: string
            RateLimit:
              description: |-
                Current rate-limit state.

                Optional rate limit information.
              schema:
                type: string
            RateLimit-Policy:
              description: |-
                Rate-limit policy applied by the gateway.

                Optional rate limit policy.
              schema:
                type: string
            Retry-After:
              description: |-
                Delay before retrying, in seconds or as an HTTP date.

                Optional retry delay or HTTP date.
              schema:
                type: string
            Sunset:
              description: >-
                RFC 8594 HTTP-date (IMF-fixdate) after which the operation may
                become unavailable, for example `Thu, 31 Dec 2026 23:59:59 GMT`.
              schema:
                pattern: >-
                  ^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-9]{2}
                  (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{4}
                  [0-9]{2}:[0-9]{2}:[0-9]{2} GMT$
                type: string
            X-Request-ID:
              description: |-
                Identifier for this HTTP attempt.

                Application request identifier.
              schema:
                type: string
            X-Trace-ID:
              description: >-
                Trace ID of this request. Sent alongside X-Request-ID when a
                middleware published a trace ID for the request.
              schema:
                pattern: ^(?!0{32}$)[0-9a-f]{32}$
                type: string
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/MarkMessageReadGatewayTimeoutProblem'
          description: >-
            REQUEST_TIMEOUT: Request Timeout; UPSTREAM_TIMEOUT: Upstream Service
            Timeout
          headers:
            Deprecation:
              $ref: '#/components/headers/Deprecation'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Link:
              $ref: '#/components/headers/Link'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            Sunset:
              $ref: '#/components/headers/Sunset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
      security:
        - accountServiceKey: []
        - projectApiKey: []
        - oauth2:
            - project:write
components:
  schemas:
    MarkMessageReadResponse:
      allOf:
        - $ref: '#/components/schemas/Message'
        - $ref: '#/components/schemas/SupportedPlatformConstraint'
        - $ref: '#/components/schemas/SentMessageConstraint'
      example:
        content:
          type: message.read
        createdAt: '2026-01-01T00:00:00.000Z'
        id: pho_msg_00000000000000000000000001
        metadata: {}
        parentMessageId: pho_msg_00000000000000000000000002
        platform: whatsapp
        projectId: pho_prj_00000000000000000000000001
        sentBy:
          details:
            resourceId: pho_res_00000000000000000000000001
            type: dedicated
          handle: '+14155550123'
          id: pho_usr_00000000000000000000000001
          kind: agent
          metadata: {}
          platform: whatsapp
          projectId: pho_prj_00000000000000000000000001
        space:
          details: {}
          id: pho_spc_00000000000000000000000001
          kind: direct
          metadata: {}
          participantIds:
            - pho_usr_00000000000000000000000001
            - pho_usr_00000000000000000000000002
          platform: whatsapp
          projectId: pho_prj_00000000000000000000000001
        status: dispatched
        timestamps:
          dispatchedAt: '2026-01-01T00:00:00.000Z'
        updatedAt: '2026-01-01T00:00:00.000Z'
    InvalidRequestProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: INVALID_REQUEST
        status: 400
        title: Invalid Request
        type: https://photon.codes/docs/problems/invalid-request
      properties:
        code:
          const: INVALID_REQUEST
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 400
          type: number
        title:
          const: Invalid Request
          type: string
        type:
          const: https://photon.codes/docs/problems/invalid-request
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    NotAuthenticatedProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: NOT_AUTHENTICATED
        status: 401
        title: Not Authenticated
        type: https://photon.codes/docs/problems/not-authenticated
      properties:
        code:
          const: NOT_AUTHENTICATED
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 401
          type: number
        title:
          const: Not Authenticated
          type: string
        type:
          const: https://photon.codes/docs/problems/not-authenticated
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    MarkMessageReadForbiddenProblem:
      oneOf:
        - $ref: '#/components/schemas/ForbiddenProblem'
        - $ref: '#/components/schemas/InsufficientScopeProblem'
        - $ref: '#/components/schemas/OrganizationSsoRequiredProblem'
        - $ref: '#/components/schemas/ResourceMismatchProblem'
    MarkMessageReadNotFoundProblem:
      oneOf:
        - $ref: '#/components/schemas/SenderNotFoundProblem'
        - $ref: '#/components/schemas/SpaceNotFoundProblem'
        - $ref: '#/components/schemas/MessageNotFoundProblem'
    MarkMessageReadConflictProblem:
      oneOf:
        - $ref: '#/components/schemas/SenderNotSendableProblem'
        - $ref: '#/components/schemas/SpaceNotSendableProblem'
        - $ref: '#/components/schemas/MessageNotReadableProblem'
    PayloadTooLargeProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: PAYLOAD_TOO_LARGE
        status: 413
        title: Payload Too Large
        type: https://photon.codes/docs/problems/payload-too-large
      properties:
        code:
          const: PAYLOAD_TOO_LARGE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 413
          type: number
        title:
          const: Payload Too Large
          type: string
        type:
          const: https://photon.codes/docs/problems/payload-too-large
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    MarkMessageReadUnprocessableEntityProblem:
      oneOf:
        - $ref: '#/components/schemas/IdempotencyKeyReusedProblem'
        - $ref: '#/components/schemas/OperationUnavailableProblem'
        - $ref: '#/components/schemas/ValidationFailedProblem'
    MarkMessageReadInternalServerErrorProblem:
      oneOf:
        - $ref: '#/components/schemas/InternalErrorProblem'
        - $ref: '#/components/schemas/InvalidAuthContextProblem'
    UpstreamFailureProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: UPSTREAM_FAILURE
        status: 502
        title: Upstream Service Failure
        type: https://photon.codes/docs/problems/upstream-failure
      properties:
        code:
          const: UPSTREAM_FAILURE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 502
          type: number
        title:
          const: Upstream Service Failure
          type: string
        type:
          const: https://photon.codes/docs/problems/upstream-failure
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    UpstreamUnavailableProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: UPSTREAM_UNAVAILABLE
        status: 503
        title: Upstream Service Unavailable
        type: https://photon.codes/docs/problems/upstream-unavailable
      properties:
        code:
          const: UPSTREAM_UNAVAILABLE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 503
          type: number
        title:
          const: Upstream Service Unavailable
          type: string
        type:
          const: https://photon.codes/docs/problems/upstream-unavailable
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    MarkMessageReadGatewayTimeoutProblem:
      oneOf:
        - $ref: '#/components/schemas/RequestTimeoutProblem'
        - $ref: '#/components/schemas/UpstreamTimeoutProblem'
    Message:
      anyOf:
        - $ref: '#/components/schemas/SmsMessage'
        - $ref: '#/components/schemas/WhatsappMessage'
        - $ref: '#/components/schemas/WhatsappBusinessMessage'
        - $ref: '#/components/schemas/EmailMessage'
        - $ref: '#/components/schemas/ImessageMessage'
        - $ref: '#/components/schemas/TelegramMessage'
      x-photon-extension:
        discriminator: platform
        fallback: '#/$defs/UnknownMessage'
        reserved:
          - sms
          - whatsapp
          - whatsapp_business
          - email
          - voice
          - imessage
          - telegram
    SupportedPlatformConstraint:
      additionalProperties: true
      properties:
        platform:
          $ref: '#/components/schemas/Platform'
      required:
        - platform
      type: object
    SentMessageConstraint:
      additionalProperties: true
      properties:
        status:
          $ref: '#/components/schemas/SentMessageStatus'
      required:
        - status
      type: object
    JsonValue:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - items:
            $ref: '#/components/schemas/JsonValue'
          type: array
        - additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          propertyNames:
            type: string
          type: object
    ForbiddenProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: FORBIDDEN
        status: 403
        title: Forbidden
        type: https://photon.codes/docs/problems/forbidden
      properties:
        code:
          const: FORBIDDEN
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 403
          type: number
        title:
          const: Forbidden
          type: string
        type:
          const: https://photon.codes/docs/problems/forbidden
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    InsufficientScopeProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: INSUFFICIENT_SCOPE
        status: 403
        title: Insufficient Scope
        type: https://photon.codes/docs/problems/insufficient-scope
      properties:
        code:
          const: INSUFFICIENT_SCOPE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 403
          type: number
        title:
          const: Insufficient Scope
          type: string
        type:
          const: https://photon.codes/docs/problems/insufficient-scope
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    OrganizationSsoRequiredProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: ORGANIZATION_SSO_REQUIRED
        status: 403
        title: Organization SSO Required
        type: https://photon.codes/docs/problems/organization-sso-required
      properties:
        code:
          const: ORGANIZATION_SSO_REQUIRED
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 403
          type: number
        title:
          const: Organization SSO Required
          type: string
        type:
          const: https://photon.codes/docs/problems/organization-sso-required
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    ResourceMismatchProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: RESOURCE_MISMATCH
        status: 403
        title: Resource Mismatch
        type: https://photon.codes/docs/problems/resource-mismatch
      properties:
        code:
          const: RESOURCE_MISMATCH
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 403
          type: number
        title:
          const: Resource Mismatch
          type: string
        type:
          const: https://photon.codes/docs/problems/resource-mismatch
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    SenderNotFoundProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: SENDER_NOT_FOUND
        status: 404
        title: Sender Not Found
        type: https://photon.codes/docs/problems/sender-not-found
      properties:
        code:
          const: SENDER_NOT_FOUND
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 404
          type: number
        title:
          const: Sender Not Found
          type: string
        type:
          const: https://photon.codes/docs/problems/sender-not-found
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    SpaceNotFoundProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: SPACE_NOT_FOUND
        status: 404
        title: Space Not Found
        type: https://photon.codes/docs/problems/space-not-found
      properties:
        code:
          const: SPACE_NOT_FOUND
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 404
          type: number
        title:
          const: Space Not Found
          type: string
        type:
          const: https://photon.codes/docs/problems/space-not-found
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    MessageNotFoundProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: MESSAGE_NOT_FOUND
        status: 404
        title: Message Not Found
        type: https://photon.codes/docs/problems/message-not-found
      properties:
        code:
          const: MESSAGE_NOT_FOUND
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 404
          type: number
        title:
          const: Message Not Found
          type: string
        type:
          const: https://photon.codes/docs/problems/message-not-found
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    SenderNotSendableProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: SENDER_NOT_SENDABLE
        status: 409
        title: Sender Not Sendable
        type: https://photon.codes/docs/problems/sender-not-sendable
      properties:
        code:
          const: SENDER_NOT_SENDABLE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 409
          type: number
        title:
          const: Sender Not Sendable
          type: string
        type:
          const: https://photon.codes/docs/problems/sender-not-sendable
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    SpaceNotSendableProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: SPACE_NOT_SENDABLE
        status: 409
        title: Space Not Sendable
        type: https://photon.codes/docs/problems/space-not-sendable
      properties:
        code:
          const: SPACE_NOT_SENDABLE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 409
          type: number
        title:
          const: Space Not Sendable
          type: string
        type:
          const: https://photon.codes/docs/problems/space-not-sendable
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    MessageNotReadableProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: MESSAGE_NOT_READABLE
        status: 409
        title: Message Not Readable
        type: https://photon.codes/docs/problems/message-not-readable
      properties:
        code:
          const: MESSAGE_NOT_READABLE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 409
          type: number
        title:
          const: Message Not Readable
          type: string
        type:
          const: https://photon.codes/docs/problems/message-not-readable
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    IdempotencyKeyReusedProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: IDEMPOTENCY_KEY_REUSED
        status: 422
        title: Idempotency Key Reused
        type: https://photon.codes/docs/problems/idempotency-key-reused
      properties:
        code:
          const: IDEMPOTENCY_KEY_REUSED
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 422
          type: number
        title:
          const: Idempotency Key Reused
          type: string
        type:
          const: https://photon.codes/docs/problems/idempotency-key-reused
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    OperationUnavailableProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: OPERATION_UNAVAILABLE
        status: 422
        title: Operation Unavailable
        type: https://photon.codes/docs/problems/operation-unavailable
      properties:
        code:
          const: OPERATION_UNAVAILABLE
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 422
          type: number
        title:
          const: Operation Unavailable
          type: string
        type:
          const: https://photon.codes/docs/problems/operation-unavailable
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    ValidationFailedProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: VALIDATION_FAILED
        issues:
          - code: invalid_type
            location: json
            message: Expected a string.
            path: /name
        status: 422
        title: Request Validation Failed
        type: https://photon.codes/docs/problems/validation-failed
      properties:
        code:
          const: VALIDATION_FAILED
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        issues:
          items:
            $ref: '#/components/schemas/ValidationIssue'
          type: array
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 422
          type: number
        title:
          const: Request Validation Failed
          type: string
        type:
          const: https://photon.codes/docs/problems/validation-failed
          type: string
      required:
        - issues
        - code
        - status
        - title
        - type
      type: object
    InternalErrorProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: INTERNAL_ERROR
        status: 500
        title: Internal Server Error
        type: https://photon.codes/docs/problems/internal-error
      properties:
        code:
          const: INTERNAL_ERROR
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 500
          type: number
        title:
          const: Internal Server Error
          type: string
        type:
          const: https://photon.codes/docs/problems/internal-error
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    InvalidAuthContextProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: INVALID_AUTH_CONTEXT
        status: 500
        title: Invalid Authentication Context
        type: https://photon.codes/docs/problems/invalid-auth-context
      properties:
        code:
          const: INVALID_AUTH_CONTEXT
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 500
          type: number
        title:
          const: Invalid Authentication Context
          type: string
        type:
          const: https://photon.codes/docs/problems/invalid-auth-context
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    RequestTimeoutProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: REQUEST_TIMEOUT
        status: 504
        title: Request Timeout
        type: https://photon.codes/docs/problems/request-timeout
      properties:
        code:
          const: REQUEST_TIMEOUT
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 504
          type: number
        title:
          const: Request Timeout
          type: string
        type:
          const: https://photon.codes/docs/problems/request-timeout
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    UpstreamTimeoutProblem:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      example:
        code: UPSTREAM_TIMEOUT
        status: 504
        title: Upstream Service Timeout
        type: https://photon.codes/docs/problems/upstream-timeout
      properties:
        code:
          const: UPSTREAM_TIMEOUT
          type: string
        detail:
          minLength: 1
          type: string
        instance:
          minLength: 1
          type: string
        remediation:
          not: {}
        requestId:
          minLength: 1
          type: string
        status:
          const: 504
          type: number
        title:
          const: Upstream Service Timeout
          type: string
        type:
          const: https://photon.codes/docs/problems/upstream-timeout
          type: string
      required:
        - code
        - status
        - title
        - type
      type: object
    SmsMessage:
      oneOf:
        - $ref: '#/components/schemas/ReceivedSmsMessage'
        - $ref: '#/components/schemas/DispatchedSmsMessage'
        - $ref: '#/components/schemas/AcceptedSmsMessage'
        - $ref: '#/components/schemas/DeliveredSmsMessage'
        - $ref: '#/components/schemas/FailedSmsMessage'
    WhatsappMessage:
      oneOf:
        - $ref: '#/components/schemas/ReceivedWhatsappMessage'
        - $ref: '#/components/schemas/DispatchedWhatsappMessage'
        - $ref: '#/components/schemas/AcceptedWhatsappMessage'
        - $ref: '#/components/schemas/DeliveredWhatsappMessage'
        - $ref: '#/components/schemas/FailedWhatsappMessage'
    WhatsappBusinessMessage:
      oneOf:
        - $ref: '#/components/schemas/ReceivedWhatsappBusinessMessage'
        - $ref: '#/components/schemas/DispatchedWhatsappBusinessMessage'
        - $ref: '#/components/schemas/AcceptedWhatsappBusinessMessage'
        - $ref: '#/components/schemas/DeliveredWhatsappBusinessMessage'
        - $ref: '#/components/schemas/FailedWhatsappBusinessMessage'
    EmailMessage:
      oneOf:
        - $ref: '#/components/schemas/ReceivedEmailMessage'
        - $ref: '#/components/schemas/DispatchedEmailMessage'
        - $ref: '#/components/schemas/AcceptedEmailMessage'
        - $ref: '#/components/schemas/DeliveredEmailMessage'
        - $ref: '#/components/schemas/FailedEmailMessage'
    ImessageMessage:
      oneOf:
        - $ref: '#/components/schemas/ReceivedImessageMessage'
        - $ref: '#/components/schemas/DispatchedImessageMessage'
        - $ref: '#/components/schemas/AcceptedImessageMessage'
        - $ref: '#/components/schemas/DeliveredImessageMessage'
        - $ref: '#/components/schemas/FailedImessageMessage'
    TelegramMessage:
      oneOf:
        - $ref: '#/components/schemas/ReceivedTelegramMessage'
        - $ref: '#/components/schemas/DispatchedTelegramMessage'
        - $ref: '#/components/schemas/AcceptedTelegramMessage'
        - $ref: '#/components/schemas/DeliveredTelegramMessage'
        - $ref: '#/components/schemas/FailedTelegramMessage'
    Platform:
      enum:
        - sms
        - email
        - whatsapp
        - whatsapp_business
        - imessage
        - telegram
      type: string
    SentMessageStatus:
      enum:
        - dispatched
        - accepted
        - delivered
        - failed
      type: string
    ValidationIssue:
      additionalProperties: false
      properties:
        code:
          minLength: 1
          type: string
        location:
          $ref: '#/components/schemas/ValidationLocation'
        message:
          minLength: 1
          type: string
        path:
          type: string
      required:
        - code
        - location
        - message
        - path
      type: object
    ReceivedSmsMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/SmsMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: sms
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: received
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/ReceivedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    DispatchedSmsMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/SmsMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: sms
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: dispatched
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DispatchedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    AcceptedSmsMessage:
      additionalProperties: false
      properties:
        acceptance:
          $ref: '#/components/schemas/MessageAcceptance'
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/SmsMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: sms
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: accepted
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/AcceptedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - acceptance
        - status
        - timestamps
      type: object
    DeliveredSmsMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/SmsMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: sms
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: delivered
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DeliveredMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    FailedSmsMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/SmsMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          $ref: '#/components/schemas/MessageFailure'
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: sms
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: failed
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/FailedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - failure
        - status
        - timestamps
      type: object
    ReceivedWhatsappMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: received
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/ReceivedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    DispatchedWhatsappMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: dispatched
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DispatchedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    AcceptedWhatsappMessage:
      additionalProperties: false
      properties:
        acceptance:
          $ref: '#/components/schemas/MessageAcceptance'
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: accepted
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/AcceptedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - acceptance
        - status
        - timestamps
      type: object
    DeliveredWhatsappMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: delivered
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DeliveredMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    FailedWhatsappMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          $ref: '#/components/schemas/MessageFailure'
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: failed
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/FailedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - failure
        - status
        - timestamps
      type: object
    ReceivedWhatsappBusinessMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappBusinessMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp_business
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: received
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/ReceivedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    DispatchedWhatsappBusinessMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappBusinessMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp_business
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: dispatched
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DispatchedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    AcceptedWhatsappBusinessMessage:
      additionalProperties: false
      properties:
        acceptance:
          $ref: '#/components/schemas/MessageAcceptance'
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappBusinessMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp_business
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: accepted
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/AcceptedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - acceptance
        - status
        - timestamps
      type: object
    DeliveredWhatsappBusinessMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappBusinessMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp_business
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: delivered
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DeliveredMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    FailedWhatsappBusinessMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/WhatsappBusinessMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          $ref: '#/components/schemas/MessageFailure'
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: whatsapp_business
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: failed
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/FailedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - failure
        - status
        - timestamps
      type: object
    ReceivedEmailMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/EmailMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: email
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: received
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/ReceivedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    DispatchedEmailMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/EmailMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: email
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: dispatched
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DispatchedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    AcceptedEmailMessage:
      additionalProperties: false
      properties:
        acceptance:
          $ref: '#/components/schemas/MessageAcceptance'
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/EmailMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: email
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: accepted
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/AcceptedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - acceptance
        - status
        - timestamps
      type: object
    DeliveredEmailMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/EmailMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: email
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: delivered
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DeliveredMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    FailedEmailMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/EmailMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          $ref: '#/components/schemas/MessageFailure'
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: email
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: failed
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/FailedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - failure
        - status
        - timestamps
      type: object
    ReceivedImessageMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/ImessageMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: imessage
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: received
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/ReceivedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    DispatchedImessageMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/ImessageMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: imessage
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: dispatched
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DispatchedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    AcceptedImessageMessage:
      additionalProperties: false
      properties:
        acceptance:
          $ref: '#/components/schemas/MessageAcceptance'
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/ImessageMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: imessage
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: accepted
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/AcceptedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - acceptance
        - status
        - timestamps
      type: object
    DeliveredImessageMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/ImessageMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: imessage
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: delivered
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DeliveredMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    FailedImessageMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/ImessageMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          $ref: '#/components/schemas/MessageFailure'
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: imessage
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: failed
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/FailedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - failure
        - status
        - timestamps
      type: object
    ReceivedTelegramMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/TelegramMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: telegram
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: received
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/ReceivedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    DispatchedTelegramMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/TelegramMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: telegram
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: dispatched
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DispatchedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    AcceptedTelegramMessage:
      additionalProperties: false
      properties:
        acceptance:
          $ref: '#/components/schemas/MessageAcceptance'
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/TelegramMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: telegram
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: accepted
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/AcceptedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - acceptance
        - status
        - timestamps
      type: object
    DeliveredTelegramMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/TelegramMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          not: {}
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: telegram
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: delivered
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/DeliveredMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - status
        - timestamps
      type: object
    FailedTelegramMessage:
      additionalProperties: false
      properties:
        acceptance:
          not: {}
        addressedTo:
          $ref: '#/components/schemas/UserSnapshot'
        content:
          $ref: '#/components/schemas/TelegramMessageContent'
        createdAt:
          description: When Photon first persisted this resource.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failure:
          $ref: '#/components/schemas/MessageFailure'
        id:
          $ref: '#/components/schemas/MessageId'
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        parentMessageId:
          $ref: '#/components/schemas/MessageId'
        platform:
          const: telegram
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        receivedBy:
          $ref: '#/components/schemas/UserSnapshot'
        sentBy:
          $ref: '#/components/schemas/UserSnapshot'
        space:
          $ref: '#/components/schemas/SpaceSnapshot'
        status:
          const: failed
          type: string
        timestamp:
          not: {}
        timestamps:
          $ref: '#/components/schemas/FailedMessageTimestamps'
        updatedAt:
          description: When Photon last persisted a change to this resource's public state.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - id
        - projectId
        - platform
        - space
        - sentBy
        - content
        - metadata
        - createdAt
        - updatedAt
        - failure
        - status
        - timestamps
      type: object
    ValidationLocation:
      enum:
        - body
        - cookie
        - form
        - header
        - json
        - param
        - query
      type: string
    UserSnapshot:
      anyOf:
        - $ref: '#/components/schemas/SmsUserSnapshot'
        - $ref: '#/components/schemas/WhatsappUserSnapshot'
        - $ref: '#/components/schemas/WhatsappBusinessUserSnapshot'
        - $ref: '#/components/schemas/EmailUserSnapshot'
        - $ref: '#/components/schemas/VoiceUserSnapshot'
        - $ref: '#/components/schemas/ImessageUserSnapshot'
        - $ref: '#/components/schemas/TelegramUserSnapshot'
      x-photon-extension:
        discriminator: platform
        fallback: '#/$defs/UnknownUserSnapshot'
        reserved:
          - sms
          - whatsapp
          - whatsapp_business
          - email
          - voice
          - imessage
          - telegram
    SmsMessageContent:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
        - $ref: '#/components/schemas/SmsGroupContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    MessageId:
      pattern: ^pho_msg_[0-7][0-9a-hjkmnp-tv-z]{25}$
      type: string
    ResourceMetadata:
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
      properties:
        displayName:
          minLength: 1
          type: string
        email:
          $ref: '#/components/schemas/EmailMetadata'
        spam:
          $ref: '#/components/schemas/SpamClassification'
      type: object
    ProjectId:
      pattern: ^pho_prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
      type: string
    SpaceSnapshot:
      anyOf:
        - $ref: '#/components/schemas/SmsSpaceSnapshot'
        - $ref: '#/components/schemas/WhatsappSpaceSnapshot'
        - $ref: '#/components/schemas/WhatsappBusinessSpaceSnapshot'
        - $ref: '#/components/schemas/EmailSpaceSnapshot'
        - $ref: '#/components/schemas/VoiceSpaceSnapshot'
        - $ref: '#/components/schemas/ImessageSpaceSnapshot'
        - $ref: '#/components/schemas/TelegramSpaceSnapshot'
      x-photon-extension:
        discriminator: platform
        fallback: '#/$defs/UnknownSpaceSnapshot'
        reserved:
          - sms
          - whatsapp
          - whatsapp_business
          - email
          - voice
          - imessage
          - telegram
    ReceivedMessageTimestamps:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        deliveredAt:
          not: {}
        dispatchedAt:
          not: {}
        failedAt:
          not: {}
        receivedAt:
          description: >-
            Authoritative source receipt or observation time, preserved across
            replay.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
      required:
        - receivedAt
      type: object
    DispatchedMessageTimestamps:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        deliveredAt:
          not: {}
        dispatchedAt:
          description: >-
            When the emitting service established the public dispatch/send
            milestone.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failedAt:
          not: {}
        receivedAt:
          not: {}
      required:
        - dispatchedAt
      type: object
    MessageAcceptance:
      oneOf:
        - $ref: '#/components/schemas/DeliveryConfirmationUnavailableAcceptance'
        - $ref: '#/components/schemas/DeliveryConfirmationNotApplicableAcceptance'
        - $ref: '#/components/schemas/DeliveryConfirmationTimedOutAcceptance'
        - $ref: '#/components/schemas/DeliveryPartiallyConfirmedAcceptance'
    AcceptedMessageTimestamps:
      additionalProperties: false
      properties:
        acceptedAt:
          description: When Photon finalized terminal acceptance.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        deliveredAt:
          not: {}
        dispatchedAt:
          description: >-
            When the emitting service established the public dispatch/send
            milestone.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failedAt:
          not: {}
        receivedAt:
          not: {}
      required:
        - dispatchedAt
        - acceptedAt
      type: object
    DeliveredMessageTimestamps:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        deliveredAt:
          description: When Photon finalized delivery based on authoritative confirmation.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        dispatchedAt:
          description: >-
            When the emitting service established the public dispatch/send
            milestone.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failedAt:
          not: {}
        receivedAt:
          not: {}
      required:
        - dispatchedAt
        - deliveredAt
      type: object
    MessageFailure:
      oneOf:
        - $ref: '#/components/schemas/SenderNotAuthorizedFailure'
        - $ref: '#/components/schemas/SenderUnavailableFailure'
        - $ref: '#/components/schemas/SenderRegistrationRequiredFailure'
        - $ref: '#/components/schemas/RecipientInvalidFailure'
        - $ref: '#/components/schemas/RecipientUnreachableFailure'
        - $ref: '#/components/schemas/RecipientOptedOutFailure'
        - $ref: '#/components/schemas/MessageTypeUnsupportedFailure'
        - $ref: '#/components/schemas/MessageContentInvalidFailure'
        - $ref: '#/components/schemas/MessageTooLargeFailure'
        - $ref: '#/components/schemas/MessageBlockedFailure'
        - $ref: '#/components/schemas/MessageBlockedByCarrierFailure'
        - $ref: '#/components/schemas/MessageRateLimitedFailure'
        - $ref: '#/components/schemas/MessageRejectedFailure'
        - $ref: '#/components/schemas/MessageExpiredFailure'
        - $ref: '#/components/schemas/MessageDeliveryFailedFailure'
        - $ref: '#/components/schemas/MessageSubmissionUnknownFailure'
        - $ref: '#/components/schemas/MessagingUnavailableFailure'
        - $ref: '#/components/schemas/MessageFailedFailure'
    FailedMessageTimestamps:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        deliveredAt:
          not: {}
        dispatchedAt:
          description: >-
            When the emitting service established the public dispatch/send
            milestone.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        failedAt:
          description: When Photon finalized terminal failure.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        receivedAt:
          not: {}
      required:
        - failedAt
      type: object
    WhatsappMessageContent:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
        - $ref: '#/components/schemas/WhatsappGroupContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    WhatsappBusinessMessageContent:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
        - $ref: '#/components/schemas/WhatsappBusinessGroupContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    EmailMessageContent:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
        - $ref: '#/components/schemas/EmailGroupContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    ImessageMessageContent:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/ImessageGroupContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    TelegramMessageContent:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/TelegramGroupContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    SmsUserSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/SmsUserDetails'
        handle:
          minLength: 1
          type: string
        id:
          $ref: '#/components/schemas/UserId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        platform:
          const: sms
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - handle
        - kind
        - details
        - metadata
      type: object
    WhatsappUserSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/WhatsappUserDetails'
        handle:
          minLength: 1
          type: string
        id:
          $ref: '#/components/schemas/UserId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        platform:
          const: whatsapp
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - handle
        - kind
        - details
        - metadata
      type: object
    WhatsappBusinessUserSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/WhatsappBusinessUserDetails'
        handle:
          minLength: 1
          type: string
        id:
          $ref: '#/components/schemas/UserId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        platform:
          const: whatsapp_business
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - handle
        - kind
        - details
        - metadata
      type: object
    EmailUserSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/EmailUserDetails'
        handle:
          minLength: 1
          type: string
        id:
          $ref: '#/components/schemas/UserId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        platform:
          const: email
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - handle
        - kind
        - details
        - metadata
      type: object
    VoiceUserSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/VoiceUserDetails'
        handle:
          pattern: ^\+[1-9][0-9]{1,14}$
          type: string
        id:
          $ref: '#/components/schemas/UserId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        platform:
          const: voice
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - handle
        - kind
        - details
        - metadata
      type: object
    ImessageUserSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/ImessageUserDetails'
        handle:
          minLength: 1
          type: string
        id:
          $ref: '#/components/schemas/UserId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        platform:
          const: imessage
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - handle
        - kind
        - details
        - metadata
      type: object
    TelegramUserSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/TelegramUserDetails'
        handle:
          pattern: ^([1-9][0-9]{0,15}|chat:-?[1-9][0-9]{0,15})$
          type: string
        id:
          $ref: '#/components/schemas/UserId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        platform:
          const: telegram
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - handle
        - kind
        - details
        - metadata
      type: object
    TextContent:
      additionalProperties: false
      properties:
        format:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        text:
          minLength: 1
          type: string
        type:
          const: text
          type: string
      required:
        - type
        - format
        - text
      type: object
    TextUpdateContent:
      additionalProperties: false
      properties:
        format:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        text:
          minLength: 1
          type: string
        type:
          const: text.update
          type: string
      required:
        - type
        - format
        - text
      type: object
    AttachmentContent:
      additionalProperties: false
      properties:
        attachmentId:
          $ref: '#/components/schemas/AttachmentId'
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        type:
          const: attachment
          type: string
      required:
        - type
        - attachmentId
      type: object
    VoiceContent:
      additionalProperties: false
      properties:
        attachmentId:
          $ref: '#/components/schemas/AttachmentId'
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        type:
          const: voice
          type: string
      required:
        - type
        - attachmentId
      type: object
    ReactionContent:
      additionalProperties: false
      properties:
        action:
          $ref: '#/components/schemas/ReactionAction'
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        reaction:
          minLength: 1
          type: string
        type:
          const: reaction
          type: string
      required:
        - type
        - reaction
        - action
      type: object
    MessageDeleteContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        reason:
          minLength: 1
          type: string
        scope:
          minLength: 1
          type: string
        type:
          const: message.delete
          type: string
      required:
        - type
      type: object
    MessageReadContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        type:
          const: message.read
          type: string
      required:
        - type
      type: object
    SpaceParticipantsUpdateContent:
      additionalProperties: false
      properties:
        added:
          items:
            $ref: '#/components/schemas/UserSnapshot'
          type: array
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        removed:
          items:
            $ref: '#/components/schemas/UserSnapshot'
          type: array
        type:
          const: space.participants.update
          type: string
      required:
        - type
        - added
        - removed
      type: object
    SpaceTypingUpdateContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        type:
          const: space.typing.update
          type: string
        typing:
          description: True starts or refreshes typing; false stops it or reports a stop.
          type: boolean
      required:
        - type
        - typing
      type: object
    PollContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        options:
          items:
            $ref: '#/components/schemas/PollOption'
          minItems: 1
          type: array
        question:
          minLength: 1
          type: string
        selectionMode:
          $ref: '#/components/schemas/PollSelectionMode'
        type:
          const: poll
          type: string
      required:
        - type
        - question
        - options
        - selectionMode
      type: object
    PollVoteContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        selectedOptions:
          items:
            $ref: '#/components/schemas/PollOption'
          type: array
        type:
          const: poll.vote
          type: string
      required:
        - type
        - selectedOptions
      type: object
    PollUpdateContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        options:
          items:
            $ref: '#/components/schemas/PollOption'
          minItems: 1
          type: array
        question:
          minLength: 1
          type: string
        selectionMode:
          $ref: '#/components/schemas/PollSelectionMode'
        type:
          const: poll.update
          type: string
      required:
        - type
        - question
        - options
        - selectionMode
      type: object
    SmsGroupContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        parts:
          items:
            $ref: '#/components/schemas/SmsGroupContentPart'
          minItems: 1
          type: array
        type:
          const: group
          type: string
      required:
        - type
        - parts
      type: object
    EmailMetadata:
      additionalProperties: false
      properties:
        contentDisposition:
          $ref: '#/components/schemas/EmailContentDisposition'
        contentId:
          minLength: 1
          type: string
        originalHtml:
          type: string
        related:
          type: boolean
        sourceMediaType:
          minLength: 1
          type: string
        subject:
          type: string
      type: object
    SpamClassification:
      additionalProperties: false
      properties:
        classifiedAt:
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          type: string
        confidence:
          maximum: 1
          minimum: 0
          type: number
        source:
          minLength: 1
          type: string
        status:
          minLength: 1
          type: string
      required:
        - status
        - source
      type: object
    SmsSpaceSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/SmsSpaceDetails'
        id:
          $ref: '#/components/schemas/SpaceId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        participantIds:
          items:
            $ref: '#/components/schemas/UserId'
          type: array
          uniqueItems: true
        platform:
          const: sms
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - kind
        - participantIds
        - details
        - metadata
      type: object
    WhatsappSpaceSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/WhatsappSpaceDetails'
        id:
          $ref: '#/components/schemas/SpaceId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        participantIds:
          items:
            $ref: '#/components/schemas/UserId'
          type: array
          uniqueItems: true
        platform:
          const: whatsapp
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - kind
        - participantIds
        - details
        - metadata
      type: object
    WhatsappBusinessSpaceSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/WhatsappBusinessSpaceDetails'
        id:
          $ref: '#/components/schemas/SpaceId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        participantIds:
          items:
            $ref: '#/components/schemas/UserId'
          type: array
          uniqueItems: true
        platform:
          const: whatsapp_business
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - kind
        - participantIds
        - details
        - metadata
      type: object
    EmailSpaceSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/EmailSpaceDetails'
        id:
          $ref: '#/components/schemas/SpaceId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        participantIds:
          items:
            $ref: '#/components/schemas/UserId'
          type: array
          uniqueItems: true
        platform:
          const: email
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - kind
        - participantIds
        - details
        - metadata
      type: object
    VoiceSpaceSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/VoiceSpaceDetails'
        id:
          $ref: '#/components/schemas/SpaceId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        participantIds:
          items:
            $ref: '#/components/schemas/UserId'
          type: array
          uniqueItems: true
        platform:
          const: voice
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - kind
        - participantIds
        - details
        - metadata
      type: object
    ImessageSpaceSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/ImessageSpaceDetails'
        id:
          $ref: '#/components/schemas/SpaceId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        participantIds:
          items:
            $ref: '#/components/schemas/UserId'
          type: array
          uniqueItems: true
        platform:
          const: imessage
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - kind
        - participantIds
        - details
        - metadata
      type: object
    TelegramSpaceSnapshot:
      additionalProperties: false
      properties:
        createdAt:
          not: {}
        details:
          $ref: '#/components/schemas/TelegramSpaceDetails'
        id:
          $ref: '#/components/schemas/SpaceId'
        kind:
          minLength: 1
          type: string
        metadata:
          $ref: '#/components/schemas/ResourceMetadata'
        participantIds:
          items:
            $ref: '#/components/schemas/UserId'
          type: array
          uniqueItems: true
        platform:
          const: telegram
          type: string
        projectId:
          $ref: '#/components/schemas/ProjectId'
        updatedAt:
          not: {}
      required:
        - id
        - projectId
        - platform
        - kind
        - participantIds
        - details
        - metadata
      type: object
    DeliveryConfirmationUnavailableAcceptance:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: delivery_confirmation_unavailable
          type: string
        confirmedRecipientCount:
          not: {}
        confirmedRecipients:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    DeliveryConfirmationNotApplicableAcceptance:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: delivery_confirmation_not_applicable
          type: string
        confirmedRecipientCount:
          not: {}
        confirmedRecipients:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    DeliveryConfirmationTimedOutAcceptance:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: delivery_confirmation_timed_out
          type: string
        confirmedRecipientCount:
          not: {}
        confirmedRecipients:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    DeliveryPartiallyConfirmedAcceptance:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: delivery_partially_confirmed
          type: string
        confirmedRecipientCount:
          description: >-
            Unique recipients with authoritative delivery confirmation for the
            original send.
          maximum: 9007199254740991
          minimum: 1
          type: integer
        confirmedRecipients:
          description: >-
            Optional complete list of confirmed recipient snapshots, each with a
            Photon userId and the handle used for the original send. User IDs
            must be unique, and both fields must be visible to the caller. The
            list length must equal confirmedRecipientCount. Persist the
            snapshots with the terminal outcome. Omit when the full confirmed
            set cannot be identified or disclosed; omission does not mean zero
            deliveries.
          items:
            $ref: '#/components/schemas/ConfirmedRecipient'
          minItems: 1
          type: array
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
        - confirmedRecipientCount
      type: object
    SenderNotAuthorizedFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: sender_not_authorized
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    SenderUnavailableFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: sender_unavailable
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    SenderRegistrationRequiredFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: sender_registration_required
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    RecipientInvalidFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: recipient_invalid
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    RecipientUnreachableFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: recipient_unreachable
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    RecipientOptedOutFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: recipient_opted_out
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageTypeUnsupportedFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_type_unsupported
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageContentInvalidFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_content_invalid
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageTooLargeFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_too_large
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageBlockedFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_blocked
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageBlockedByCarrierFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_blocked_by_carrier
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageRateLimitedFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_rate_limited
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageRejectedFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_rejected
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageExpiredFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_expired
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageDeliveryFailedFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_delivery_failed
          type: string
        confirmedRecipientCount:
          description: >-
            Unique recipients with authoritative delivery confirmation for the
            original send; omission means evidence is not supplied.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageSubmissionUnknownFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_submission_unknown
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessagingUnavailableFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: messaging_unavailable
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    MessageFailedFailure:
      additionalProperties: false
      properties:
        acceptedAt:
          not: {}
        code:
          const: message_failed
          type: string
        confirmedRecipientCount:
          not: {}
        failedAt:
          not: {}
        message:
          minLength: 1
          type: string
      required:
        - code
        - message
      type: object
    WhatsappGroupContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        parts:
          items:
            $ref: '#/components/schemas/WhatsappGroupContentPart'
          minItems: 1
          type: array
        type:
          const: group
          type: string
      required:
        - type
        - parts
      type: object
    WhatsappBusinessGroupContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        parts:
          items:
            $ref: '#/components/schemas/WhatsappBusinessGroupContentPart'
          minItems: 1
          type: array
        type:
          const: group
          type: string
      required:
        - type
        - parts
      type: object
    EmailGroupContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        parts:
          items:
            $ref: '#/components/schemas/EmailGroupContentPart'
          minItems: 1
          type: array
        type:
          const: group
          type: string
      required:
        - type
        - parts
      type: object
    ImessageGroupContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        parts:
          items:
            $ref: '#/components/schemas/ImessageGroupContentPart'
          minItems: 1
          type: array
        type:
          const: group
          type: string
      required:
        - type
        - parts
      type: object
    TelegramGroupContent:
      additionalProperties: false
      properties:
        metadata:
          $ref: '#/components/schemas/ContentMetadata'
        parts:
          items:
            $ref: '#/components/schemas/TelegramGroupContentPart'
          minItems: 1
          type: array
        type:
          const: group
          type: string
      required:
        - type
        - parts
      type: object
    SmsUserDetails:
      additionalProperties: false
      properties:
        carrier:
          $ref: '#/components/schemas/PhoneCarrier'
        countryCode:
          pattern: ^[A-Z]{2}$
          type: string
        managedBy:
          $ref: '#/components/schemas/ManagerId'
        nationalFormat:
          minLength: 1
          type: string
        resourceId:
          $ref: '#/components/schemas/ResourceId'
      type: object
    UserId:
      pattern: ^pho_usr_[0-7][0-9a-hjkmnp-tv-z]{25}$
      type: string
    WhatsappUserDetails:
      additionalProperties: false
      properties:
        managedBy:
          $ref: '#/components/schemas/ManagerId'
        phoneNumber:
          pattern: ^\+[1-9][0-9]{1,14}$
          type: string
        resourceId:
          $ref: '#/components/schemas/ResourceId'
        type:
          $ref: '#/components/schemas/UserLineType'
      type: object
    WhatsappBusinessUserDetails:
      additionalProperties: false
      properties:
        managedBy:
          $ref: '#/components/schemas/ManagerId'
        phoneNumber:
          pattern: ^\+[1-9][0-9]{1,14}$
          type: string
        resourceId:
          $ref: '#/components/schemas/ResourceId'
      type: object
    EmailUserDetails:
      additionalProperties: false
      properties:
        managedBy:
          $ref: '#/components/schemas/ManagerId'
        resourceId:
          $ref: '#/components/schemas/ResourceId'
      type: object
    VoiceUserDetails:
      additionalProperties: false
      properties:
        managedBy:
          $ref: '#/components/schemas/ManagerId'
        resourceId:
          $ref: '#/components/schemas/ResourceId'
      type: object
    ImessageUserDetails:
      additionalProperties: false
      properties:
        managedBy:
          $ref: '#/components/schemas/ManagerId'
        resourceId:
          $ref: '#/components/schemas/ResourceId'
        type:
          $ref: '#/components/schemas/UserLineType'
      type: object
    TelegramUserDetails:
      additionalProperties: false
      properties:
        resourceId:
          $ref: '#/components/schemas/ResourceId'
      type: object
    ContentMetadata:
      additionalProperties:
        additionalProperties:
          $ref: '#/components/schemas/JsonValue'
        propertyNames:
          type: string
        type: object
      properties:
        email:
          $ref: '#/components/schemas/EmailMetadata'
        voice:
          $ref: '#/components/schemas/VoiceMetadata'
      type: object
    AttachmentId:
      pattern: ^pho_att_[0-7][0-9a-hjkmnp-tv-z]{25}$
      type: string
    ReactionAction:
      enum:
        - add
        - remove
      type: string
    PollOption:
      additionalProperties: false
      properties:
        id:
          minLength: 1
          type: string
        text:
          minLength: 1
          type: string
      required:
        - id
        - text
      type: object
    PollSelectionMode:
      enum:
        - single
        - multiple
      type: string
    SmsGroupContentPart:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    EmailContentDisposition:
      enum:
        - inline
        - attachment
      type: string
    SmsSpaceDetails:
      additionalProperties: false
      properties: {}
      type: object
    SpaceId:
      pattern: ^pho_spc_[0-7][0-9a-hjkmnp-tv-z]{25}$
      type: string
    WhatsappSpaceDetails:
      additionalProperties: false
      properties: {}
      type: object
    WhatsappBusinessSpaceDetails:
      additionalProperties: false
      properties: {}
      type: object
    EmailSpaceDetails:
      additionalProperties: false
      properties:
        latestAddressing:
          $ref: '#/components/schemas/EmailAddressing'
          description: >-
            The latest eligible whole observation on a canonical Space, or this
            Message's immutable capture in an embedded Space. Absent when no
            observation is available.
      type: object
    VoiceSpaceDetails:
      additionalProperties: false
      properties: {}
      type: object
    ImessageSpaceDetails:
      additionalProperties: false
      properties: {}
      type: object
    TelegramSpaceDetails:
      additionalProperties: false
      properties: {}
      type: object
    ConfirmedRecipient:
      additionalProperties: false
      properties:
        handle:
          description: >-
            Recipient handle from the original send: an email address for email,
            or the corresponding address on another platform.
          minLength: 1
          type: string
        userId:
          $ref: '#/components/schemas/UserId'
          description: Photon User ID of the confirmed recipient.
      required:
        - userId
        - handle
      type: object
    WhatsappGroupContentPart:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    WhatsappBusinessGroupContentPart:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    EmailGroupContentPart:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/TextUpdateContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
        - $ref: '#/components/schemas/ReactionContent'
        - $ref: '#/components/schemas/MessageDeleteContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceParticipantsUpdateContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
        - $ref: '#/components/schemas/PollContent'
        - $ref: '#/components/schemas/PollVoteContent'
        - $ref: '#/components/schemas/PollUpdateContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    ImessageGroupContentPart:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/MessageReadContent'
        - $ref: '#/components/schemas/SpaceTypingUpdateContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    TelegramGroupContentPart:
      anyOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/AttachmentContent'
        - $ref: '#/components/schemas/VoiceContent'
      x-photon-extension:
        discriminator: type
        fallback: '#/$defs/UnknownContent'
        reserved:
          - text
          - text.update
          - attachment
          - voice
          - reaction
          - message.delete
          - message.read
          - space.participants.update
          - space.typing.update
          - poll
          - poll.vote
          - poll.update
          - group
          - message
    PhoneCarrier:
      additionalProperties: false
      minProperties: 1
      properties:
        lineType:
          minLength: 1
          type: string
        mobileCountryCode:
          pattern: ^[0-9]{3}$
          type: string
        mobileNetworkCode:
          pattern: ^[0-9]{2,3}$
          type: string
        name:
          minLength: 1
          type: string
        normalizedName:
          minLength: 1
          type: string
      type: object
    ManagerId:
      pattern: ^pho_mgr_[0-7][0-9a-hjkmnp-tv-z]{25}$
      type: string
    ResourceId:
      pattern: ^pho_res_[0-7][0-9a-hjkmnp-tv-z]{25}$
      type: string
    UserLineType:
      enum:
        - shared
        - dedicated
      type: string
    VoiceMetadata:
      additionalProperties: false
      properties:
        durationMs:
          description: Server-observed recording duration in milliseconds, when known.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        waveform:
          description: Server-provided normalized waveform samples for optional display.
          items:
            maximum: 1
            minimum: 0
            type: number
          type: array
      type: object
    EmailAddressing:
      additionalProperties: false
      properties:
        bcc:
          description: >-
            Omitted means unavailable or undisclosed; an empty array means known
            empty. Never infer hidden recipients from another observation.
          items:
            $ref: '#/components/schemas/EmailMailbox'
          type: array
        cc:
          description: >-
            Omitted means unavailable or undisclosed; an empty array means known
            empty. Never infer hidden recipients from another observation.
          items:
            $ref: '#/components/schemas/EmailMailbox'
          type: array
        from:
          $ref: '#/components/schemas/EmailMailbox'
          description: >-
            The captured sender mailbox. Its address and resolved User ID must
            agree with the source Message's sentBy.
        replyTo:
          description: >-
            Omitted means unavailable or undisclosed; an empty array means known
            empty. Never infer hidden recipients from another observation.
          items:
            $ref: '#/components/schemas/EmailMailbox'
          type: array
        sourceMessageId:
          $ref: '#/components/schemas/MessageId'
          description: >-
            The Message that supplied this observation. In a Message Space
            snapshot this is the containing Message's own ID, not its parent ID.
        to:
          description: >-
            Omitted means unavailable or undisclosed; an empty array means known
            empty. Never infer hidden recipients from another observation.
          items:
            $ref: '#/components/schemas/EmailMailbox'
          type: array
      required:
        - sourceMessageId
        - from
      type: object
    EmailMailbox:
      additionalProperties: false
      properties:
        address:
          $ref: '#/components/schemas/EmailMailboxAddress'
        name:
          description: The captured display name, when known.
          minLength: 1
          type: string
        userId:
          $ref: '#/components/schemas/UserId'
          description: >-
            The resolved Photon User ID, when available. Outbound admission must
            resolve every mailbox before capture.
      required:
        - address
      type: object
    EmailMailboxAddress:
      description: >-
        The captured mailbox address. Preserve local-part case; admission
        services own normalization and sending restrictions.
      minLength: 1
      oneOf:
        - type: string
        - pattern: '[\s\x00-\x1f\x7f]'
          type: string
      pattern: >-
        ^[^\s@\x00-\x1f\x7f]+@[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)*$
      type: string
  headers:
    Deprecation:
      description: >-
        RFC 9745 structured-field Date at which the operation was or will be
        deprecated: `@` followed by Unix seconds, for example `@1767225599`.
      schema:
        pattern: ^@-?[0-9]+$
        type: string
    Idempotent-Replayed:
      description: True when this response was replayed from an earlier attempt.
      schema:
        type: boolean
    Link:
      description: Links related to lifecycle or remediation documentation.
      schema:
        type: string
    RateLimit:
      description: Current rate-limit state.
      schema:
        type: string
    RateLimit-Policy:
      description: Rate-limit policy applied by the gateway.
      schema:
        type: string
    Retry-After:
      description: Delay before retrying, in seconds or as an HTTP date.
      schema:
        type: string
    Sunset:
      description: >-
        RFC 8594 HTTP-date (IMF-fixdate) after which the operation may become
        unavailable, for example `Thu, 31 Dec 2026 23:59:59 GMT`.
      schema:
        pattern: >-
          ^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-9]{2}
          (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{4}
          [0-9]{2}:[0-9]{2}:[0-9]{2} GMT$
        type: string
    X-Request-ID:
      description: Identifier for this HTTP attempt.
      schema:
        type: string
    X-Trace-ID:
      description: >-
        Trace ID of this request. Sent alongside X-Request-ID when a middleware
        published a trace ID for the request.
      schema:
        pattern: ^(?!0{32}$)[0-9a-f]{32}$
        type: string
  securitySchemes:
    accountServiceKey:
      description: >-
        Account Service Key, prefixed with `pho_ask_`, sent as `Authorization:
        Bearer <key>`. Acts on behalf of its owning account, subject to the
        permissions and credential restrictions of each operation. Account
        access tokens and OAuth grants also use the Bearer header. In
        organizations that require SSO, Account Service Keys are not accepted
        for managing the organization's SSO settings, deleting the organization,
        or checking whether it can be deleted.
      scheme: bearer
      type: http
    projectApiKey:
      description: >-
        Project API key, `pho_sk_` prefixed, sent as `Authorization: Bearer
        <key>`. Bound to one project, so it is accepted only under
        `/v1/projects/{projectId}` and refused everywhere else.
      scheme: bearer
      type: http
    oauth2:
      description: >-
        OAuth grant issued by the Photon authorization server. The token is a
        bearer JWT whose consented scope is intersected with the permissions the
        route grants; an empty intersection is `403 insufficient_scope`.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.photon.codes/oauth2/authorize
          scopes:
            account:create_project: Create a project owned by the account.
            account:read: View account profile.
            account:read_projects: >-
              List projects associated with the account; does not grant access
              to project contents.
            account:write: Update account name and profile.
            billing:read: View invoices, usage, payment status.
            events:read: >-
              Query stored Events and discover their SQL schema within a
              project.
            organization:create_project: Create a project in the organization.
            organization:read: View organization name and avatar.
            organization:read_projects: List projects in the organization.
            platforms:read: View project platform configuration.
            platforms:write: Change project platform configuration.
            project:delete: Permanently delete the project.
            project:read: View non-sensitive project settings.
            project:read_usage: View project usage and costs.
            project:write: >-
              Change agent profiles, webhook settings, and other project
              configuration.
            ten_dlc:read: View organization 10DLC Brand and Campaign registration records.
            ten_dlc:write: >-
              Register and update organization 10DLC Brands and Campaigns,
              including OTP operations.
          tokenUrl: https://auth.photon.codes/oauth2/token
      type: oauth2

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.