> ## 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.

# Feed de avisos

> Os eventos que os webhooks levam, do mais antigo para o mais novo, por cursor, para quem prefere puxar em vez de receber. Funcionalidade `notifications`.



## OpenAPI

````yaml openapi/pt/cell.json GET /v1/notifications
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/notifications:
    get:
      tags:
        - notifications
      summary: Feed de avisos
      description: >-
        Os eventos que os webhooks levam, do mais antigo para o mais novo, a
        partir de `cursor` (o começo do feed sem um); uma consulta sem nada novo
        responde o mesmo cursor. Os eventos ficam 7 dias.


        **Autenticação.** Qualquer chave de fonte, sejam quais forem os escopos:
        `Authorization: Bearer nia_sk_...`. Só responde num espaço com a
        funcionalidade `notifications` ligada (o documento `features`); num
        espaço sem ela, 404.
      operationId: notifications_v1_notifications_get
      parameters:
        - in: query
          name: cursor
          required: false
          schema:
            anyOf:
              - maxLength: 200
                type: string
              - type: 'null'
            title: Cursor
          description: Cursor opaco, vindo de `next_cursor`.
        - in: query
          name: limit
          required: false
          schema:
            default: 100
            maximum: 200
            minimum: 1
            title: Limit
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPage'
          description: Resposta de sucesso.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            # Pull instead of receiving webhooks: keep the cursor between polls
            page = niadra.api.notifications(cursor=cursor, limit=100)
            for event in page.items:
                handle(event.type, event.data)  # ids and pointers, never content
            cursor = page.next_cursor
        - lang: typescript
          label: TypeScript
          source: >-
            // Pull instead of receiving webhooks: keep the cursor between polls

            const page = await niadra.api.notifications({ cursor, limit: 100 });

            for (const event of page.items) handle(event.type, event.data); //
            ids and pointers, never content

            cursor = page.next_cursor;
components:
  schemas:
    NotificationPage:
      additionalProperties: false
      description: >-
        Do mais antigo para o mais novo. `next_cursor` é onde a próxima consulta
        começa: o mesmo cursor quando não há nada novo.
      properties:
        items:
          items:
            $ref: '#/components/schemas/Notification'
          title: Items
          type: array
        next_cursor:
          title: Next Cursor
          type: string
      required:
        - items
        - next_cursor
      title: NotificationPage
      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
    Notification:
      additionalProperties: false
      description: >-
        O corpo de um webhook, para a empresa que puxa em vez de receber: os
        mesmos campos, só ids e ponteiros. Um evento dirigido a um endpoint, ou
        sobre um item de memória que só algumas fontes podem ler, chega só aos
        webhooks dele.
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        data:
          additionalProperties: true
          title: Data
          type: object
        id:
          description: >-
            O id do evento; uma entrega de webhook do mesmo evento tem o
            próprio.
          maxLength: 512
          minLength: 1
          title: Id
          type: string
        links:
          additionalProperties:
            type: string
          title: Links
          type: object
        subject:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Subject
        tenant:
          maxLength: 512
          minLength: 1
          title: Tenant
          type: string
        type:
          maxLength: 256
          minLength: 1
          title: Type
          type: string
      required:
        - id
        - type
        - created_at
        - tenant
        - data
      title: Notification
      type: object

````