AgentMail inboxes > lists API
The inboxes > lists API from AgentMail — 2 operation(s) for inboxes > lists.
The inboxes > lists API from AgentMail — 2 operation(s) for inboxes > lists.
openapi: 3.1.0
info:
title: API Reference agent inboxes > lists API
version: 1.0.0
servers:
- url: https://api.agentmail.to
description: prod
- url: https://x402.api.agentmail.to
description: prod-x402
- url: https://mpp.api.agentmail.to
description: prod-mpp
- url: https://api.agentmail.eu
description: eu-prod
tags:
- name: inboxes > lists
paths:
/v0/inboxes/{inbox_id}/lists/{direction}/{type}:
get:
operationId: list
summary: List Entries
description: '**CLI:**
```bash
agentmail inboxes:lists list --inbox-id <inbox_id> --direction <direction> --type <type>
```'
tags:
- inboxes > lists
parameters:
- name: inbox_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_inboxes:InboxId'
- name: direction
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:Direction'
- name: type
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:ListType'
- name: limit
in: query
required: false
schema:
$ref: '#/components/schemas/type_:Limit'
- name: page_token
in: query
required: false
schema:
$ref: '#/components/schemas/type_:PageToken'
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/type_lists:PodListListEntriesResponse'
post:
operationId: create
summary: Create List Entry
description: '**CLI:**
```bash
agentmail inboxes:lists create --inbox-id <inbox_id> --direction <direction> --type <type> --entry user@example.com
```'
tags:
- inboxes > lists
parameters:
- name: inbox_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_inboxes:InboxId'
- name: direction
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:Direction'
- name: type
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:ListType'
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/type_lists:PodListEntry'
'400':
description: Error response with status 400
content:
application/json:
schema:
$ref: '#/components/schemas/type_:ValidationErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/type_lists:CreateListEntryRequest'
/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}:
get:
operationId: get
summary: Get List Entry
description: '**CLI:**
```bash
agentmail inboxes:lists get --inbox-id <inbox_id> --direction <direction> --type <type> --entry <entry>
```'
tags:
- inboxes > lists
parameters:
- name: inbox_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_inboxes:InboxId'
- name: direction
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:Direction'
- name: type
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:ListType'
- name: entry
in: path
description: Email address or domain.
required: true
schema:
type: string
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: Response with status 200
content:
application/json:
schema:
$ref: '#/components/schemas/type_lists:PodListEntry'
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/type_:ErrorResponse'
delete:
operationId: delete
summary: Delete List Entry
description: '**CLI:**
```bash
agentmail inboxes:lists delete --inbox-id <inbox_id> --direction <direction> --type <type> --entry <entry>
```'
tags:
- inboxes > lists
parameters:
- name: inbox_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_inboxes:InboxId'
- name: direction
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:Direction'
- name: type
in: path
required: true
schema:
$ref: '#/components/schemas/type_lists:ListType'
- name: entry
in: path
description: Email address or domain.
required: true
schema:
type: string
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: Successful response
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/type_:ErrorResponse'
components:
schemas:
type_:Count:
type: integer
description: Number of items returned.
title: Count
type_:ErrorFix:
type: string
description: The concrete next action that resolves the error.
title: ErrorFix
type_:ErrorMessage:
type: string
description: Error message.
title: ErrorMessage
type_lists:ListType:
type: string
enum:
- allow
- block
description: Type of list entry.
title: ListType
type_lists:PodListListEntriesResponse:
type: object
properties:
count:
$ref: '#/components/schemas/type_:Count'
limit:
$ref: '#/components/schemas/type_:Limit'
next_page_token:
$ref: '#/components/schemas/type_:PageToken'
entries:
type: array
items:
$ref: '#/components/schemas/type_lists:PodListEntry'
description: Ordered by entry ascending.
required:
- count
- entries
title: PodListListEntriesResponse
type_:ErrorDocs:
type: string
description: Link to the error reference entry for this code.
title: ErrorDocs
type_inboxes:InboxId:
type: string
description: The ID of the inbox.
title: InboxId
type_lists:EntryType:
type: string
enum:
- email
- domain
description: Whether the entry is an email address or domain.
title: EntryType
type_:ErrorCode:
type: string
description: Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
title: ErrorCode
type_:ErrorResponse:
type: object
properties:
name:
$ref: '#/components/schemas/type_:ErrorName'
code:
$ref: '#/components/schemas/type_:ErrorCode'
message:
$ref: '#/components/schemas/type_:ErrorMessage'
fix:
$ref: '#/components/schemas/type_:ErrorFix'
docs:
$ref: '#/components/schemas/type_:ErrorDocs'
required:
- name
- message
title: ErrorResponse
type_lists:PodListEntry:
type: object
properties:
entry:
type: string
description: Email address or domain of list entry.
organization_id:
$ref: '#/components/schemas/type_:OrganizationId'
reason:
type: string
description: Reason for adding the entry.
direction:
$ref: '#/components/schemas/type_lists:Direction'
list_type:
$ref: '#/components/schemas/type_lists:ListType'
entry_type:
$ref: '#/components/schemas/type_lists:EntryType'
created_at:
type: string
format: date-time
description: Time at which entry was created.
read_only:
type: boolean
description: Whether the entry is read-only and cannot be deleted via the API.
pod_id:
type: string
description: ID of pod.
inbox_id:
type: string
description: ID of inbox, if entry is inbox-scoped.
required:
- entry
- organization_id
- direction
- list_type
- entry_type
- created_at
- pod_id
title: PodListEntry
type_:Limit:
type: integer
description: Limit of number of items returned.
title: Limit
type_lists:Direction:
type: string
enum:
- send
- receive
- reply
description: Direction of list entry.
title: Direction
type_lists:CreateListEntryRequest:
type: object
properties:
entry:
type: string
description: Email address or domain to add.
reason:
type: string
description: Reason for adding the entry.
required:
- entry
title: CreateListEntryRequest
type_:ValidationErrorResponse:
type: object
properties:
name:
$ref: '#/components/schemas/type_:ErrorName'
code:
$ref: '#/components/schemas/type_:ErrorCode'
message:
$ref: '#/components/schemas/type_:ErrorMessage'
errors:
description: Validation errors. Each entry has a path and a message identifying the invalid field.
fix:
$ref: '#/components/schemas/type_:ErrorFix'
docs:
$ref: '#/components/schemas/type_:ErrorDocs'
required:
- name
- errors
title: ValidationErrorResponse
type_:PageToken:
type: string
description: Page token for pagination.
title: PageToken
type_:ErrorName:
type: string
description: Name of error.
title: ErrorName
type_:OrganizationId:
type: string
description: ID of organization.
title: OrganizationId
securitySchemes:
Bearer:
type: http
scheme: bearer