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

# List events

> Without after, the latest events come newest first. With after, the events that followed it come oldest first.



## OpenAPI

````yaml /openapi.json get /agents/{id}/events
openapi: 3.1.0
info:
  title: Artil API
  description: Give AI agents their own email inbox, SMS number and secret storage.
  version: 1.0.0
servers:
  - url: https://app.artil.ai/api
security:
  - token: []
paths:
  /agents/{id}/events:
    get:
      tags:
        - Events
      summary: List events
      description: >-
        Without after, the latest events come newest first. With after, the
        events that followed it come oldest first.
      operationId: listEvents
      parameters:
        - in: path
          name: id
          required: true
          description: The agent's id
          schema:
            type: string
            format: uuid
        - in: query
          name: after
          schema:
            type: integer
            minimum: 0
            maximum: 9007199254740991
      responses:
        '200':
          description: The events
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Event'
        default:
          $ref: '#/components/responses/Failure'
components:
  schemas:
    Event:
      type: object
      properties:
        id:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        type:
          type: string
          const: message.received
        channel:
          type: string
          enum:
            - email
            - sms
            - telegram
            - url
        messageId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: The message's id, to read it with
        text:
          description: The text of a message Artil keeps no copy of, which comes whole
          type:
            - string
            - 'null'
        sender:
          $ref: '#/components/schemas/Teammate'
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - type
        - channel
        - messageId
        - createdAt
    Teammate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: The agent's or member's id
        kind:
          type: string
          enum:
            - agent
            - member
        name:
          type:
            - string
            - 'null'
        email:
          description: The agent's primary email address, or the member's
          type:
            - string
            - 'null'
        phone:
          description: >-
            The agent's primary phone number, or the one a member added to their
            profile
          type:
            - string
            - 'null'
      required:
        - id
        - kind
        - name
        - email
        - phone
  responses:
    Failure:
      description: The request failed; the error says why
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - invalid_input
                      - unauthorized
                      - forbidden
                      - plan_limit
                      - not_found
                      - conflict
                      - rate_limited
                      - internal
                      - unavailable
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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