Rewalto Staff: audit API

The Staff: audit API from Rewalto — 1 operation(s) for staff: audit.

GitHub OpenAPI

Operations 1

GET /v1/staff/audit Read the audit of privileged calls #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/rewalto-com:rewalto-com-staff-audit-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

rewalto-com-staff-audit-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: 'Rewalto Staff: audit API'
  version: 0.208.0
  summary: India's data layer for AI agents and people
  description: 'One front door for people and agents: the site, the dashboards, the CLI and MCP all call this API. Every route is under `/v1`. Errors always have the same envelope (`ErrorEnvelope`); decide what to do from `error.retry`. Using the tools is free: credits are charged only for data actually delivered (C-012). Requests are rate limited per credential (or, without one, per IP) in one-minute windows: every answer carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`, and over the limit the answer is 429 `rate_limited` with `Retry-After`. A change that removes or alters something ships behind `/v2`.'
servers:
- url: https://api-dev.rewalto.com
  description: Staging, on the shared database (D-1360). API keys and Clerk sessions from the frontend dev issuer (D-1346); /v1/data is not served here until D-1391.
- url: https://api.rewalto.com
  description: Production. API keys and Clerk sessions from the production issuer.
tags:
- name: 'Staff: audit'
paths:
  /v1/staff/audit:
    get:
      operationId: listStaffAudit
      summary: Read the audit of privileged calls
      description: 'One row per privileged call, newest first: every staff route call (done, no change, read, refused, denied or failed, with who, the role it needed, what, on what and the reason) and every staff operation run in the database (partition moves, promotional grants, collector and lane controls). Exact filters narrow it; `before` pages to older rows. Rewalto staff holding the audit_reader role only, with a signed-in session; an API key is always refused (`forbidden`). Reading is itself recorded.'
      tags:
      - 'Staff: audit'
      security:
      - sessionJwt: []
      responses:
        '200':
          description: Success
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                title: StaffAuditPage
                description: A page of the audit of privileged calls, newest first.
                type: object
                additionalProperties: false
                required:
                - entries
                - nextBefore
                properties:
                  entries:
                    type: array
                    items:
                      title: StaffAuditEntry
                      type: object
                      additionalProperties: false
                      required:
                      - id
                      - at
                      - requestId
                      - callerKind
                      - callerId
                      - role
                      - action
                      - target
                      - outcome
                      - refusal
                      - reason
                      - detail
                      properties:
                        id:
                          type: string
                          description: The row id (digits); rows are numbered in the order written.
                        at:
                          type: string
                          format: date-time
                        requestId:
                          type:
                          - 'null'
                          - string
                          description: The API request id; null for a database operation.
                        callerKind:
                          type: string
                          enum:
                          - session
                          - api_key
                          - database
                          - service_key
                        callerId:
                          type: string
                          description: Clerk user id, API key id, service key id (`service_key`), or the name given.
                        role:
                          type:
                          - 'null'
                          - string
                          description: The staff role the call needed; null for a database operation or a service key call.
                        action:
                          type: string
                          pattern: ^[a-z][a-z_]{1,40}\.[a-z][a-z_]{1,40}$
                        target:
                          type:
                          - 'null'
                          - string
                        outcome:
                          type: string
                          enum:
                          - done
                          - no_change
                          - read
                          - refused
                          - denied
                          - failed
                        refusal:
                          type:
                          - 'null'
                          - string
                          description: The error code of a refused, denied or failed call.
                        reason:
                          type:
                          - 'null'
                          - string
                          description: The staff member's reason, where given.
                        detail:
                          type: object
                          additionalProperties: true
                          description: Small facts about the call (status before and after, counts, the database login).
                  nextBefore:
                    type:
                    - 'null'
                    - string
                    description: Pass as `before` for the next (older) page; null when this is the last.
        '400':
          description: 'Error. The `error.code` is one of:

            - `invalid_request`: retry advice `fix_request`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                error:
                  code: invalid_request
                  status: 400
                  retry: fix_request
                  message: The request does not match the schema for this route
                  requestId: req_0b8f6d3a-2c1e-4a79-9e5d-6f4a7c1b2d83
                  details:
                  - path: body/expiresInDays
                    message: must be equal to one of the allowed values
        '401':
          description: 'Error. The `error.code` is one of:

            - `session_expired`: retry advice `refresh_credentials`

            - `unauthenticated`: retry advice `refresh_credentials`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                error:
                  code: session_expired
                  status: 401
                  retry: refresh_credentials
                  message: The session token has expired; sign in again
                  requestId: req_7c1e2a90-4b3d-4f6e-8a15-0d9c2b7e3f41
        '403':
          description: 'Error. The `error.code` is one of:

            - `forbidden`: retry advice `never`

            - `org_missing`: retry advice `never`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: 'Error. The `error.code` is one of:

            - `rate_limited`: retry advice `after_reset`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestIdHeader'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimitHeader'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemainingHeader'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitResetHeader'
            Retry-After:
              $ref: '#/components/headers/RetryAfterHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: 'Error. The `error.code` is one of:

            - `internal`: retry advice `bounded`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          description: 'Error. The `error.code` is one of:

            - `unavailable`: retry advice `bounded`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      parameters:
      - name: action
        in: query
        required: false
        schema:
          type: string
          pattern: ^[a-z][a-z_]{1,40}\.[a-z][a-z_]{1,40}$
          examples:
          - recipe.publish
        description: Only this action, e.g. `recipe.publish`, `promo.grant`, `partition.move`.
      - name: target
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          maxLength: 300
          examples:
          - blinkit@6.0.0
        description: Only this target, exactly, e.g. `blinkit@6.0.0`.
      - name: callerId
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          maxLength: 200
          examples:
          - user_2abc
        description: 'Only this caller: a Clerk user id, an API key id, or the name a database operation gave.'
      - name: outcome
        in: query
        required: false
        schema:
          type: string
          pattern: ^(done|no_change|read|refused|denied|failed)$
          examples:
          - denied
        description: Only this outcome.
      - name: since
        in: query
        required: false
        schema:
          type: string
          format: date-time
          examples:
          - '2026-10-16T00:00:00Z'
        description: Only rows at or after this time.
      - name: before
        in: query
        required: false
        schema:
          type: string
          pattern: ^[1-9][0-9]{0,18}$
        description: The nextBefore of the previous page. Omit for the newest rows.
      - name: limit
        in: query
        required: false
        schema:
          type: string
          pattern: ^[0-9]{1,3}$
          examples:
          - '50'
        description: Rows per page, 1 to 200 (default 50). Sent as digits in the query string.
components:
  headers:
    RateLimitResetHeader:
      description: Seconds until the current window resets.
      schema:
        type: integer
        minimum: 1
    RateLimitLimitHeader:
      description: Requests allowed in the current one-minute window for this credential (or, without one, this IP).
      schema:
        type: integer
        minimum: 1
    RateLimitRemainingHeader:
      description: Requests left in the current window.
      schema:
        type: integer
        minimum: 0
    RetryAfterHeader:
      description: 'On a 429: seconds to wait before retrying (the same as `RateLimit-Reset`).'
      schema:
        type: integer
        minimum: 1
    RequestIdHeader:
      description: The id of this request. Quote it when you report a problem. You may send your own `x-request-id` (8 to 128 plain characters); anything else is replaced.
      schema:
        type: string
  schemas:
    Quote:
      title: Quote
      description: 'What a run would cost at most. mode published: the recipe has a published rate and runs at once. mode approval: no rate is set yet, so the run starts only after the quote is approved. The ceiling is never exceeded; a run is charged for what it delivers, rounded up.'
      type: object
      additionalProperties: false
      required:
      - id
      - mode
      - status
      - recipe
      - unit
      - units
      - rateVersion
      - extras
      - lines
      - ceiling
      - expiresAt
      - createdAt
      - approvedAt
      - recurring
      properties:
        id:
          type: string
          format: uuid
        mode:
          type: string
          enum:
          - published
          - approval
        status:
          type: string
          enum:
          - open
          - approved
          - expired
          description: 'open: can be approved. approved: credits are held. expired: ask for a new quote.'
        recipe:
          type: string
        unit:
          type: string
        units:
          type: integer
          minimum: 1
          description: The units estimate this quote prices.
        rateVersion:
          type: string
          description: The one rate version every line was priced at, for example c1.r2.
        extras:
          type: array
          items:
            title: QuoteExtra
            description: An extra (a tool such as a browser or OCR) applied to the quoted data.
            type: object
            additionalProperties: false
            required:
            - key
            - credits
            - perUnits
            - multiplier
            properties:
              key:
                type: string
                description: The extra’s name, from the rate card.
              credits:
                type: integer
                minimum: 0
                description: Credits per perUnits units.
              perUnits:
                type: integer
                minimum: 1
              multiplier:
                type: integer
                minimum: 1
                description: How many times the extra applies per unit, for example the number of pin codes.
            examples:
            - key: browser
              credits: 1
              perUnits: 1
              multiplier: 1
        lines:
          type: array
          items:
            title: QuoteLine
            description: 'One kind of data in a quote: the units expected and the credits for them.'
            type: object
            additionalProperties: false
            required:
            - recipe
            - unit
            - units
            - base
            - extras
            - credits
            properties:
              recipe:
                type: string
              unit:
                type: string
                description: What one unit is, for example page or record.
              units:
                type: integer
                minimum: 0
              base:
                type: object
                additionalProperties: false
                required:
                - credits
                - perUnits
                properties:
                  credits:
                    type: integer
                    minimum: 0
                  perUnits:
                    type: integer
                    minimum: 1
              extras:
                type: array
                items:
                  title: QuoteExtra
                  description: An extra (a tool such as a browser or OCR) applied to the quoted data.
                  type: object
                  additionalProperties: false
                  required:
                  - key
                  - credits
                  - perUnits
                  - multiplier
                  properties:
                    key:
                      type: string
                      description: The extra’s name, from the rate card.
                    credits:
                      type: integer
                      minimum: 0
                      description: Credits per perUnits units.
                    perUnits:
                      type: integer
                      minimum: 1
                    multiplier:
                      type: integer
                      minimum: 1
                      description: How many times the extra applies per unit, for example the number of pin codes.
                  examples:
                  - key: browser
                    credits: 1
                    perUnits: 1
                    multiplier: 1
              credits:
                type: integer
                minimum: 0
                description: Credits for this line, rounded up.
        ceiling:
          type: integer
          minimum: 0
          description: The most the run can be charged, in credits. This is what approval holds.
        expiresAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        approvedAt:
          type:
          - 'null'
          - string
          format: date-time
        run:
          title: QuoteRun
          description: 'Only for a fresh-read run: what it reads. Its id is this quote’s id (GET /v1/runs/{id} once approved).'
          type:
          - 'null'
          - object
          additionalProperties: false
          required:
          - query
          - pincodes
          properties:
            query:
              type: string
              minLength: 1
              maxLength: 200
              description: A search term, or a product reference for a recipe that reads one product.
            pincodes:
              type: array
              minItems: 1
              maxItems: 20
              uniqueItems: true
              items:
                type: string
                pattern: ^([1-9][0-9]{5}|national)$
              description: Pin codes to read at; `national` for a recipe that is not location scoped. One job each.
        recurring:
          title: QuoteRecurring
          description: 'Only for a recurring report or watch, shown once before the first delivery: the cost of each delivery and of a month, and whether the month fits the credits left.'
          type:
          - 'null'
          - object
          additionalProperties: false
          required:
          - cadence
          - deliveriesPerMonth
          - perDelivery
          - perMonth
          - creditsAvailable
          - fitsPlan
          - notice
          properties:
            cadence:
              type: string
              enum:
              - daily
              - weekly
              - monthly
            deliveriesPerMonth:
              type: integer
              minimum: 1
              description: 'Deliveries counted in a month: the most the cadence can make.'
            perDelivery:
              type: integer
              minimum: 0
              description: Credits for one delivery (at most).
            perMonth:
              type: integer
              minimum: 0
              description: Credits for a month of deliveries (at most).
            creditsAvailable:
              type: integer
              minimum: -1
              description: Credits the organisation has now; -1 when it has unlimited credits (as `available` on GET /v1/credits/balance, contract 0.28.0).
            fitsPlan:
              type: boolean
              description: False when the month costs more than the credits left. Always true with unlimited credits.
            notice:
              type:
              - 'null'
              - string
              description: 'When fitsPlan is false: that it will not fit and a bigger plan is needed.'
      examples:
      - id: 9b1d6e0a-4c3f-4f7e-8a21-5d0c7b9e1f42
        mode: published
        status: open
        recipe: commerce_product_page
        unit: page
        units: 120
        rateVersion: c1.r1
        extras:
        - key: browser
          credits: 1
          perUnits: 1
          multiplier: 1
        lines:
        - recipe: commerce_product_page
          unit: page
          units: 120
          base:
            credits: 1
            perUnits: 1
          extras:
          - key: browser
            credits: 1
            perUnits: 1
            multiplier: 1
          credits: 240
        ceiling: 240
        expiresAt: '2026-10-15T10:30:00.000Z'
        createdAt: '2026-10-15T10:00:00.000Z'
        approvedAt: null
        recurring:
          cadence: weekly
          deliveriesPerMonth: 5
          perDelivery: 240
          perMonth: 1200
          creditsAvailable: 1000
          fitsPlan: false
          notice: 'A month of deliveries can cost up to 1200 credits and 1000 are left: it will not fit. A bigger plan is needed.'
    ErrorEnvelope:
      type: object
      additionalProperties: false
      required:
      - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
          - code
          - status
          - retry
          - message
          - requestId
          properties:
            code:
              type: string
              enum:
              - invalid_request
              - invalid_json
              - unauthenticated
              - session_expired
              - key_expired
              - key_revoked
              - credits_exhausted
              - over_quote
              - plan_required
              - preview_needs_approval
              - price_changed
              - forbidden
              - org_missing
              - scope_missing
              - not_entitled
              - private_data
              - access_control
              - not_found
              - quote_expired
              - quote_already_approved
              - refund_refused
              - catalogue_refused
              - not_for_sale
              - export_not_ready
              - download_expired
              - reopen_expired
              - idempotency_conflict
              - stale_version
              - package_not_ready
              - upload_not_ready
              - cost_changed
              - billing_profile_missing
              - export_not_available
              - already_applied
              - unknown_capability
              - schema_retired
              - payload_too_large
              - unsupported_media_type
              - rate_limited
              - internal
              - evidence_unavailable
              - payment_provider_unavailable
              - payment_provider_retired
              - checkout_unavailable
              - invoicing_unavailable
              - provider_access_pending
              - connection_revoked
              - owner_required
              - provider_quota_exhausted
              - workspace_closed
              - workspace_exists
              - unavailable
            status:
              type: integer
            retry:
              type: string
              enum:
              - fix_request
              - refresh_credentials
              - never
              - after_reset
              - bounded
            message:
              type: string
            requestId:
              type: string
            quote:
              $ref: '#/components/schemas/Quote'
            details:
              type: array
              items:
                type: object
                additionalProperties: false
                required:
                - path
                - message
                properties:
                  path:
                    type: string
                  message:
                    type: string
  securitySchemes:
    sessionJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'A Clerk session token for a signed-in user: `Authorization: Bearer <token>`. Mint it in the frontend with the Clerk JWT template named `rewalto-core`, whose audience is `rewalto-core-api`. It carries `sub`, `org_id` and `org_role`. An expired token is `session_expired`.'
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: rwk_ API key
      description: 'An organisation API key: `Authorization: Bearer rwk_...`. Minted with `createKey`; the secret is shown once. A key carries scopes and an expiry of 7, 30 or 90 days.'
      x-scopes:
      - data:read
      - tools:run
      - usage:read
    serviceKey:
      type: http
      scheme: bearer
      bearerFormat: rws_ service key
      description: 'A Rewalto service key, for Rewalto''s own servers only: `Authorization: Bearer rws_...`. Minted and revoked by staff, never through the API; the secret is shown once. It carries scopes and an expiry, opens only `/v1/service` routes, and every call is audited.'
      x-scopes:
      - notification-preferences:read
      - intake:write
      - site-pages:read
      - evidence:read
      - ad-references:read
      - ad-references:report
      - external-data:connect
      - external-data:read
      - external-data:sync
      - external-data:delete
      - research:read
      - signups:read
x-error-codes:
  invalid_request:
    status: 400
    retry: fix_request
  invalid_json:
    status: 400
    retry: fix_request
  unauthenticated:
    status: 401
    retry: refresh_credentials
  session_expired:
    status: 401
    retry: refresh_credentials
  key_expired:
    status: 401
    retry: refresh_credentials
  key_revoked:
    status: 401
    retry: refresh_credentials
  credits_exhausted:
    status: 402
    retry: never
  over_quote:
    status: 402
    retry: never
  plan_required:
    status: 402
    retry: never
  preview_needs_approval:
    status: 402
    retry: never
  price_changed:
    status: 409
    retry: never
  forbidden:
    status: 403
    retry: never
  org_missing:
    status: 403
    retry: never
  scope_missing:
    status: 403
    retry: never
  not_entitled:
    status: 403
    retry: never
  private_data:
    status: 403
    retry: never
  access_control:
    status: 403
    retry: never
  not_found:
    status: 404
    retry: fix_request
  quote_expired:
    status: 410
    retry: fix_request
  quote_already_approved:
    status: 409
    retry: never
  refund_refused:
    status: 409
    retry: never
  catalogue_refused:
    status: 409
    retry: never
  not_for_sale:
    status: 409
    retry: never
  export_not_ready:
    status: 409
    retry: never
  download_expired:
    status: 410
    retry: fix_request
  reopen_expired:
    status: 410
    retry: fix_request
  idempotency_conflict:
    status: 409
    retry: never
  stale_version:
    status: 409
    retry: never
  package_not_ready:
    status: 409
    retry: never
  upload_not_ready:
    status: 409
    retry: never
  cost_changed:
    status: 409
    retry: never
  billing_profile_missing:
    status: 409
    retry: never
  export_not_available:
    status: 409
    retry: never
  already_applied:
    status: 409
    retry: never
  unknown_capability:
    status: 404
    retry: fix_request
  schema_retired:
    status: 410
    retry: fix_request
  payload_too_large:
    status: 413
    retry: fix_request
  unsupported_media_type:
    status: 415
    retry: fix_request
  rate_limited:
    status: 429
    retry: after_reset
  internal:
    status: 500
    retry: bounded
  evidence_unavailable:
    status: 503
    retry: bounded
  payment_provider_unavailable:
    status: 503
    retry: bounded
  payment_provider_retired:
    status: 410
    retry: fix_request
  checkout_unavailable:
    status: 503
    retry: bounded
  invoicing_unavailable:
    status: 409
    retry: never
  provider_access_pending:
    status: 409
    retry: never
  connection_revoked:
    status: 409
    retry: never
  owner_required:
    status: 403
    retry: never
  provider_quota_exhausted:
    status: 429
    retry: after_reset
  workspace_closed:
    status: 409
    retry: never
  workspace_exists:
    status: 409
    retry: never
  unavailable:
    status: 503
    retry: bounded