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

# Orders and ad spend per source and campaign

> The attribution tree: source, then campaign, then ad. Spend is what Meta and TikTok report, in the ad account's currency; it is account-wide, so a store filter or a store-limited installation gets no spend (`spendUnavailable: gated`).

Needs the `read_analytics` scope (permission `analytics:read`).



## OpenAPI

````yaml /openapi/openapi.2026-10.json get /apps/2026-10/analytics/marketing
openapi: 3.1.0
info:
  title: Tassyir Admin API
  version: 2026-10
  summary: >-
    The API installed apps call to read and change a Tassyir business, and the
    webhooks they receive.
  description: >-
    Version `2026-10` of the API installed Tassyir apps call. The routes live
    under `/apps/2026-10/`; the token endpoint and the key documents under
    `/apps/`. Guides, and a page for every error code:
    https://developers.tassyir.io.


    **Authentication.** `Authorization: Bearer tsy_at_…` from `POST
    /apps/oauth/token`. An app acts as a team member of the business: it reads
    and writes only what its granted scopes allow, only in the stores the
    merchant gave it, under the merchant's plan. An app on Tassyir Hosting holds
    no token: it calls these routes through `ctx.props.TASSYIR.fetch`, which
    signs each call as its installation (the same scopes, stores and plan;
    Idempotency-Key passes through), and a call that cannot be accepted is 401
    `HOSTED_CALL_REFUSED`.


    **Conventions.** JSON fields are camelCase; ids are strings; times are ISO
    8601 UTC; money is a decimal string (`"2500.00"`) with a `currency` field,
    never a number. A list answers `{ data, nextCursor }`, newest first,
    keyset-paged: `limit` 1 to 100 (default 50), `cursor` = the previous
    `nextCursor`. A single resource answers `{ data }`. `fields` trims a
    resource to the named top-level fields. Fields without
    `read_customer_contact` (buyer name, phones, address, notes) are omitted,
    not nulled. Every answer is `Cache-Control: no-store`.


    **Writes.** Send an `Idempotency-Key` to make a write safe to retry (24
    hours per installation).


    **Errors.** `application/problem+json` with a stable `code`, a `fix`
    sentence, the `docs` page of the code and a `requestId`. Each operation
    lists every code it can answer; `x-tassyir-errors` lists every code a
    problem can carry, with its title, statuses and `fix`. HTTP 460
    `STORE_SCOPE_FORBIDDEN` means a store outside the installation's stores.


    **Rate limits.** A leaky bucket per installation, by default 40 requests
    refilled at 4 a second: every answer carries `RateLimit-Limit`,
    `RateLimit-Remaining` and `RateLimit-Reset`; a refusal is 429 `RATE_LIMITED`
    with `Retry-After`. All the apps of one business also share a ceiling, by
    default 20 requests a second: 429 `BUSINESS_RATE_LIMITED` with
    `Retry-After`. An API process that is already running its maximum of app
    requests answers 503 `API_BUSY` with `Retry-After`, having done nothing.


    **Webhooks.** Signed Standard Webhooks deliveries (`v1a`, Ed25519), one per
    topic below; verify them with `GET /apps/webhook-keys`.
servers:
  - url: https://api.tassyir.io
security:
  - appAccessToken: []
tags:
  - name: Authentication
    description: Tokens and the public keys apps verify with.
  - name: Business
    description: The business the app is installed on.
  - name: Orders
    description: >-
      Orders, their comments, the cancel reasons and custom statuses, the
      open-order counts, and the Tracking and Returns lists.
  - name: Products
    description: Products and their variants.
  - name: Collections
    description: Collections and their members.
  - name: Inventory
    description: Stock levels.
  - name: Customers
    description: The buyers behind the orders.
  - name: Offers
    description: >-
      The merchant's per-store pricing offers (read them with read_offers), and
      the offers an app creates and manages itself, with their codes and
      redemptions (write_offers).
  - name: Stores
    description: The installation's stores.
  - name: Delivery
    description: Delivery agents and fee groups (never credentials).
  - name: Analytics
    description: >-
      Reports over a period: the overview, sales per variant, marketing and UTM
      attribution. One report at a time per business.
  - name: Finance
    description: >-
      The finance summary, money movements, expenses and profit per product
      (read_finance).
  - name: Data
    description: >-
      Typed values the app keeps on the business, its stores, products, orders
      and customers, under keys its manifest declares.
  - name: Images
    description: >-
      Images re-hosted on the Tassyir CDN, for the product and collection
      writes.
  - name: Bulk exports
    description: >-
      A whole list (orders, products, customers) as one JSON Lines file, instead
      of paging through it.
  - name: Webhooks
    description: What Tassyir POSTs to the app.
paths:
  /apps/2026-10/analytics/marketing:
    get:
      tags:
        - Analytics
      summary: Orders and ad spend per source and campaign
      description: >-
        The attribution tree: source, then campaign, then ad. Spend is what Meta
        and TikTok report, in the ad account's currency; it is account-wide, so
        a store filter or a store-limited installation gets no spend
        (`spendUnavailable: gated`).


        Needs the `read_analytics` scope (permission `analytics:read`).
      operationId: getMarketingReport
      parameters:
        - name: channel
          in: query
          required: false
          schema:
            type: string
            enum:
              - all
              - meta
              - tiktok
        - name: fields
          in: query
          required: false
          schema:
            maxLength: 1000
            type: string
          description: >-
            Return only these top-level fields, separated by commas; the id is
            always kept. The response schema describes the whole resource. An
            unknown name is 400 `INVALID_FIELDS`. Fields: `period`, `channel`,
            `spendCurrency`, `spendUnavailable`, `totals`, `sources`.
        - name: startDate
          in: query
          required: false
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          description: A calendar day (YYYY-MM-DD).
        - name: endDate
          in: query
          required: false
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          description: A calendar day (YYYY-MM-DD).
        - name: storeId
          in: query
          required: false
          schema:
            type: string
            pattern: ^\d{1,24}$
          description: >-
            Only this store's rows. A store outside the installation's stores is
            460 `STORE_SCOPE_FORBIDDEN`.
      responses:
        '200':
          description: The report.
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            Cache-Control:
              $ref: '#/components/headers/Cache-Control-No-Store'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketingReportResponse'
        '400':
          description: >-
            Bad request: `INVALID_DATE_RANGE`, `INVALID_FIELDS`,
            `VALIDATION_FAILED`.
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - properties:
                      status:
                        const: 400
                      code:
                        enum:
                          - INVALID_DATE_RANGE
                          - INVALID_FIELDS
                          - VALIDATION_FAILED
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: 'Not allowed: `PERMISSION_DENIED`.'
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - properties:
                      status:
                        const: 403
                      code:
                        enum:
                          - PERMISSION_DENIED
        '429':
          $ref: '#/components/responses/RateLimited'
        '460':
          description: 'Store outside the installation: `STORE_SCOPE_FORBIDDEN`.'
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - properties:
                      status:
                        const: 460
                      code:
                        enum:
                          - STORE_SCOPE_FORBIDDEN
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: >-
            Unavailable: `API_BUSY`, `REPORT_BUSY`, `REPORT_QUERY_TIMEOUT`,
            `SERVICE_UNAVAILABLE`.
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - properties:
                      status:
                        const: 503
                      code:
                        enum:
                          - API_BUSY
                          - REPORT_BUSY
                          - REPORT_QUERY_TIMEOUT
                          - SERVICE_UNAVAILABLE
components:
  headers:
    RateLimit-Limit:
      description: >-
        The installation's request bucket (default 40); on a 429
        `BUSINESS_RATE_LIMITED`, the business's ceiling (default 20 a second).
        Absent when a request is refused before the rate limits run (an
        unparsable body, a 503 `API_BUSY`).
      schema:
        minimum: 1
        type: integer
    RateLimit-Remaining:
      description: Requests still accepted right now.
      schema:
        type: integer
        minimum: 0
    RateLimit-Reset:
      description: >-
        Seconds until the bucket is empty again (it drains at 4 requests a
        second by default).
      schema:
        type: integer
        minimum: 0
    X-Request-Id:
      description: The request's id, also in an error's `requestId`.
      schema:
        type: string
    Cache-Control-No-Store:
      description: '`no-store`: never cache an answer.'
      schema:
        type: string
        const: no-store
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        minimum: 0
  schemas:
    MarketingReportResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/MarketingReport'
      required:
        - data
      additionalProperties: false
    Problem:
      type: object
      description: >-
        An Admin API error (RFC 9457 problem details), served as
        `application/problem+json`. Act on `code`, never on `detail`. Other
        members name the subject of the refusal (`permission`, `storeId`,
        `feature`, `limit`, `errors`, …).
      properties:
        type:
          type: string
          format: uri
          description: >-
            `https://developers.tassyir.io/errors/<code in kebab case>`:
            identifies the code, and is the code's page.
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
          description: >-
            For a person. A 5xx never carries an internal message: `requestId`
            names it.
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]{1,63}$
          description: 'Stable: what the app acts on.'
        fix:
          type: string
          description: One sentence an AI agent can act on.
        docs:
          type: string
          format: uri
          description: >-
            The page that explains the code and what to do: the same URL as
            `type`.
        requestId:
          type: string
          description: Also in the `X-Request-Id` header. Quote it to Tassyir.
        errors:
          type: array
          items:
            type: string
          description: 'With `VALIDATION_FAILED`: one entry per invalid parameter.'
      required:
        - type
        - title
        - status
        - detail
        - code
        - docs
    MarketingReport:
      type: object
      properties:
        period:
          type: object
          properties:
            startDate:
              type: string
              description: First Algeria calendar day, YYYY-MM-DD.
            endDate:
              type: string
              description: Last Algeria calendar day, YYYY-MM-DD.
            days:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - startDate
            - endDate
            - days
          additionalProperties: false
        channel:
          type: string
          enum:
            - all
            - meta
            - tiktok
        spendCurrency:
          anyOf:
            - type: string
              pattern: ^[A-Z]{3}$
              description: ISO 4217 currency code of every amount in this resource.
            - type: 'null'
          description: Null with no spend, or when ad accounts mix currencies.
        spendUnavailable:
          anyOf:
            - type: string
              enum:
                - not_connected
                - gated
                - unavailable
            - type: 'null'
          description: >-
            Why there is no spend: `gated` is a store filter or a store-limited
            installation (spend is account-wide and has no store), so retrying
            changes nothing.
        totals:
          type: object
          properties:
            counts:
              type: object
              properties:
                visits:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                orders:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                confirmed:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                delivered:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                canceled:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                returned:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                revenue:
                  type: string
                  pattern: ^-?\d+\.\d{2}$
                  description: Delivered, net of the delivery fee, in DZD.
                orderValue:
                  type: string
                  pattern: ^-?\d+\.\d{2}$
                  description: Total of every order placed, in DZD.
              required:
                - visits
                - orders
                - confirmed
                - delivered
                - canceled
                - returned
                - revenue
                - orderValue
              additionalProperties: false
            ads:
              anyOf:
                - type: object
                  properties:
                    spend:
                      type: string
                      pattern: ^-?\d+\.\d{2}$
                      description: >-
                        A decimal amount with two decimals, as a string
                        ("2500.00").
                    currency:
                      anyOf:
                        - type: string
                          pattern: ^[A-Z]{3}$
                          description: >-
                            ISO 4217 currency code of every amount in this
                            resource.
                        - type: 'null'
                      description: Null on a roll-up whose ad accounts mix currencies.
                    impressions:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    clicks:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    purchases:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: >-
                        What the ad platform counts as a purchase: usually the
                        order form, not a delivered order.
                    purchaseValue:
                      type: string
                      pattern: ^-?\d+\.\d{2}$
                      description: >-
                        A decimal amount with two decimals, as a string
                        ("2500.00").
                  required:
                    - spend
                    - currency
                    - impressions
                    - clicks
                    - purchases
                    - purchaseValue
                  additionalProperties: false
                - type: 'null'
          required:
            - counts
            - ads
          additionalProperties: false
        sources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                anyOf:
                  - type: string
                  - type: 'null'
              counts:
                type: object
                properties:
                  visits:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  orders:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  confirmed:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  delivered:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  canceled:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  returned:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  revenue:
                    type: string
                    pattern: ^-?\d+\.\d{2}$
                    description: Delivered, net of the delivery fee, in DZD.
                  orderValue:
                    type: string
                    pattern: ^-?\d+\.\d{2}$
                    description: Total of every order placed, in DZD.
                required:
                  - visits
                  - orders
                  - confirmed
                  - delivered
                  - canceled
                  - returned
                  - revenue
                  - orderValue
                additionalProperties: false
              ads:
                anyOf:
                  - type: object
                    properties:
                      spend:
                        type: string
                        pattern: ^-?\d+\.\d{2}$
                        description: >-
                          A decimal amount with two decimals, as a string
                          ("2500.00").
                      currency:
                        anyOf:
                          - type: string
                            pattern: ^[A-Z]{3}$
                            description: >-
                              ISO 4217 currency code of every amount in this
                              resource.
                          - type: 'null'
                        description: Null on a roll-up whose ad accounts mix currencies.
                      impressions:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      clicks:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      purchases:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: >-
                          What the ad platform counts as a purchase: usually the
                          order form, not a delivered order.
                      purchaseValue:
                        type: string
                        pattern: ^-?\d+\.\d{2}$
                        description: >-
                          A decimal amount with two decimals, as a string
                          ("2500.00").
                    required:
                      - spend
                      - currency
                      - impressions
                      - clicks
                      - purchases
                      - purchaseValue
                    additionalProperties: false
                  - type: 'null'
              organic:
                type: boolean
              children:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      anyOf:
                        - type: string
                        - type: 'null'
                    counts:
                      type: object
                      properties:
                        visits:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        orders:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        confirmed:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        delivered:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        canceled:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        returned:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        revenue:
                          type: string
                          pattern: ^-?\d+\.\d{2}$
                          description: Delivered, net of the delivery fee, in DZD.
                        orderValue:
                          type: string
                          pattern: ^-?\d+\.\d{2}$
                          description: Total of every order placed, in DZD.
                      required:
                        - visits
                        - orders
                        - confirmed
                        - delivered
                        - canceled
                        - returned
                        - revenue
                        - orderValue
                      additionalProperties: false
                    ads:
                      anyOf:
                        - type: object
                          properties:
                            spend:
                              type: string
                              pattern: ^-?\d+\.\d{2}$
                              description: >-
                                A decimal amount with two decimals, as a string
                                ("2500.00").
                            currency:
                              anyOf:
                                - type: string
                                  pattern: ^[A-Z]{3}$
                                  description: >-
                                    ISO 4217 currency code of every amount in
                                    this resource.
                                - type: 'null'
                              description: >-
                                Null on a roll-up whose ad accounts mix
                                currencies.
                            impressions:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            clicks:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            purchases:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                              description: >-
                                What the ad platform counts as a purchase:
                                usually the order form, not a delivered order.
                            purchaseValue:
                              type: string
                              pattern: ^-?\d+\.\d{2}$
                              description: >-
                                A decimal amount with two decimals, as a string
                                ("2500.00").
                          required:
                            - spend
                            - currency
                            - impressions
                            - clicks
                            - purchases
                            - purchaseValue
                          additionalProperties: false
                        - type: 'null'
                    status:
                      anyOf:
                        - type: string
                        - type: 'null'
                      description: Delivery state on the ad platform. Null means unknown.
                    spendMissing:
                      anyOf:
                        - type: string
                          enum:
                            - unread_account
                            - untagged
                        - type: 'null'
                      description: >-
                        Why this campaign has no spend although the report has
                        some: leave its counts out of every cost per order.
                    children:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            anyOf:
                              - type: string
                              - type: 'null'
                          counts:
                            type: object
                            properties:
                              visits:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              orders:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              confirmed:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              delivered:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              canceled:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              returned:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              revenue:
                                type: string
                                pattern: ^-?\d+\.\d{2}$
                                description: Delivered, net of the delivery fee, in DZD.
                              orderValue:
                                type: string
                                pattern: ^-?\d+\.\d{2}$
                                description: Total of every order placed, in DZD.
                            required:
                              - visits
                              - orders
                              - confirmed
                              - delivered
                              - canceled
                              - returned
                              - revenue
                              - orderValue
                            additionalProperties: false
                          ads:
                            anyOf:
                              - type: object
                                properties:
                                  spend:
                                    type: string
                                    pattern: ^-?\d+\.\d{2}$
                                    description: >-
                                      A decimal amount with two decimals, as a
                                      string ("2500.00").
                                  currency:
                                    anyOf:
                                      - type: string
                                        pattern: ^[A-Z]{3}$
                                        description: >-
                                          ISO 4217 currency code of every amount
                                          in this resource.
                                      - type: 'null'
                                    description: >-
                                      Null on a roll-up whose ad accounts mix
                                      currencies.
                                  impressions:
                                    type: integer
                                    minimum: -9007199254740991
                                    maximum: 9007199254740991
                                  clicks:
                                    type: integer
                                    minimum: -9007199254740991
                                    maximum: 9007199254740991
                                  purchases:
                                    type: integer
                                    minimum: -9007199254740991
                                    maximum: 9007199254740991
                                    description: >-
                                      What the ad platform counts as a purchase:
                                      usually the order form, not a delivered
                                      order.
                                  purchaseValue:
                                    type: string
                                    pattern: ^-?\d+\.\d{2}$
                                    description: >-
                                      A decimal amount with two decimals, as a
                                      string ("2500.00").
                                required:
                                  - spend
                                  - currency
                                  - impressions
                                  - clicks
                                  - purchases
                                  - purchaseValue
                                additionalProperties: false
                              - type: 'null'
                          thumbnailUrl:
                            anyOf:
                              - type: string
                              - type: 'null'
                        required:
                          - id
                          - name
                          - counts
                          - ads
                          - thumbnailUrl
                        additionalProperties: false
                  required:
                    - id
                    - name
                    - counts
                    - ads
                    - status
                    - spendMissing
                    - children
                  additionalProperties: false
            required:
              - id
              - name
              - counts
              - ads
              - organic
              - children
            additionalProperties: false
          description: Traffic sources, each with its campaigns and their ads.
      required:
        - period
        - channel
        - spendCurrency
        - spendUnavailable
        - totals
        - sources
      additionalProperties: false
      description: Orders and ad spend per source and campaign (API 2026-10).
  responses:
    Unauthorized:
      description: >-
        No usable credential: `APP_TOKEN_INVALID`, `APP_TOKEN_REQUIRED`,
        `HOSTED_CALL_REFUSED`.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        WWW-Authenticate:
          description: >-
            The challenge: `Bearer` (RFC 6750) for an access token,
            `Tassyir-Hosted` for a hosted app's call through
            `ctx.props.TASSYIR`.
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 401
                  code:
                    enum:
                      - APP_TOKEN_INVALID
                      - APP_TOKEN_REQUIRED
                      - HOSTED_CALL_REFUSED
    RateLimited:
      description: 'Rate limited: `BUSINESS_RATE_LIMITED`, `RATE_LIMITED`.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 429
                  code:
                    enum:
                      - BUSINESS_RATE_LIMITED
                      - RATE_LIMITED
    InternalError:
      description: 'Internal error: `INTERNAL_ERROR`.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 500
                  code:
                    enum:
                      - INTERNAL_ERROR
  securitySchemes:
    appAccessToken:
      type: http
      scheme: bearer
      bearerFormat: tsy_at_<43 base62>
      description: >-
        An app access token from `POST /apps/oauth/token`, valid 1 hour. An
        offline token acts as the app; an online token acts as the app on behalf
        of one dashboard user (the intersection of both permission sets).

````

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