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

# Pedidos de releitura

> O que o seu worker de resolução deve ler de novo: prioridade maior e mais antigo primeiro, cada pedido emprestado por 60 segundos.



## OpenAPI

````yaml openapi/pt/cell.json GET /v1/state/refresh-requests
openapi: 3.1.0
info:
  title: API de dados da Niadra
  version: '1'
  description: >-
    Escrita, contexto, histórico, objetos, identidade, privacidade e governança
    de um espaço. Cada espaço tem um endereço estável, com o espaço e a região
    no nome.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: O espaço, que vem na chave de fonte.
      region:
        default: us-east-2
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/state/refresh-requests:
    get:
      tags:
        - state
      summary: Pedidos de releitura
      description: >-
        O worker de resolução da empresa toma o que buscar de novo: as
        prioridades maiores e os mais antigos primeiro, cada um emprestado a ele
        por 60 segundos; um pedido que ele não responde é oferecido de novo,
        três vezes no máximo.


        **Autenticação.** Chave de fonte: `Authorization: Bearer nia_sk_...`.
        Escopo exigido: `state:push`. Só responde num espaço com a
        funcionalidade `state` ligada (o documento `features`); num espaço sem
        ela, 404.
      operationId: refresh_requests_v1_state_refresh_requests_get
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            default: 50
            maximum: 200
            minimum: 1
            title: Limit
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefreshRequestPage'
          description: Resposta de sucesso.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security:
        - sourceKey: []
      x-codeSamples:
        - lang: python
          label: Python
          source: >-
            # niadra resolver-worker --resolvers app.resolvers:register

            # Or in your own process:

            from niadra.cli.worker import ResolverWorker


            niadra.resolvers.register("item_variant", read_variant)  # reads the
            object fresh, inside your boundary

            ResolverWorker(niadra).run_once()  # leases the waiting requests,
            resolves them and pushes what it read
        - lang: typescript
          label: TypeScript
          source: >-
            // niadra resolver-worker --resolvers ./resolvers.js:register

            // Or in your own process:

            import { ResolverWorker } from "@niadra/sdk";


            niadra.resolvers.register("item_variant", readVariant); // reads the
            object fresh, inside your boundary

            await new ResolverWorker(niadra).runOnce(); // leases the waiting
            requests, resolves them and pushes what it read
components:
  schemas:
    RefreshRequestPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/RefreshRequest'
          title: Items
          type: array
      required:
        - items
      title: RefreshRequestPage
      type: object
    Problem:
      additionalProperties: false
      description: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    RefreshRequest:
      additionalProperties: false
      properties:
        budget_units:
          title: Budget Units
          type: integer
        lease_until:
          format: date-time
          title: Lease Until
          type: string
        priority:
          enum:
            - high
            - normal
            - low
          title: Priority
          type: string
        reason:
          maxLength: 256
          minLength: 1
          title: Reason
          type: string
        ref:
          $ref: '#/components/schemas/StateRef'
        request_id:
          maxLength: 512
          minLength: 1
          title: Request Id
          type: string
      required:
        - request_id
        - ref
        - reason
        - priority
        - budget_units
        - lease_until
      title: RefreshRequest
      type: object
    StateRef:
      additionalProperties: false
      description: >-
        Um objeto do registro de tipos: de um cliente ou compartilhado, cuja
        chave pode nomear uma variante.
      properties:
        id:
          maxLength: 512
          minLength: 1
          title: Id
          type: string
        namespace:
          maxLength: 256
          minLength: 1
          title: Namespace
          type: string
        type:
          maxLength: 256
          minLength: 1
          title: Type
          type: string
        variant:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Variant
      required:
        - type
        - namespace
        - id
      title: StateRef
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````