Casama AI Mail API
The mail API from Casama AI, for mail.
Operations 13
POST
/v1/bots/{id}/email/messages/delete
Delete several kept mails, or every mail older than a date
#
The mail API from Casama AI, for mail.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/casama-ai:casama-ai-mail-api"
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.
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: 3.2.0
info:
title: Casama Mail API
version: 0.1.0
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://api.casama.ai
tags:
- name: Mail
paths:
/v1/bots/{id}/email:
post:
operationId: claimMailAddress
tags:
- Mail
security:
- bearerAuth: []
summary: Claim a hosted email address for a bot
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ClaimMailAddressRequest'
responses:
'201':
description: MailAddress
content:
application/json:
schema:
$ref: '#/components/schemas/MailAddress'
'400':
description: Validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
get:
operationId: getMailAddress
tags:
- Mail
security:
- bearerAuth: []
summary: A bot's hosted email address
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
responses:
'200':
description: MailAddress
content:
application/json:
schema:
$ref: '#/components/schemas/MailAddress'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
patch:
operationId: updateMailAddress
tags:
- Mail
security:
- bearerAuth: []
summary: Pause or resume a bot's hosted email address
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMailAddressRequest'
responses:
'200':
description: MailAddress
content:
application/json:
schema:
$ref: '#/components/schemas/MailAddress'
'400':
description: Validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
delete:
operationId: releaseMailAddress
tags:
- Mail
security:
- bearerAuth: []
summary: Release a hosted email address for good (its name is never reissued)
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
responses:
'200':
description: MailAddress
content:
application/json:
schema:
$ref: '#/components/schemas/MailAddress'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/bots/{id}/email/availability:
get:
operationId: checkMailName
tags:
- Mail
security:
- bearerAuth: []
summary: Whether a mail name is free, with alternatives
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
minLength: 1
maxLength: 40
required: true
name: name
in: query
responses:
'200':
description: MailNameAvailability
content:
application/json:
schema:
$ref: '#/components/schemas/MailNameAvailability'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/bots/{id}/email/move:
post:
operationId: moveMailAddress
tags:
- Mail
security:
- bearerAuth: []
summary: Move a hosted email address to another bot in the workspace
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MoveMailAddressRequest'
responses:
'200':
description: MailAddress
content:
application/json:
schema:
$ref: '#/components/schemas/MailAddress'
'400':
description: Validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'409':
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/bots/{id}/email/messages:
get:
operationId: listMailMessages
tags:
- Mail
security:
- bearerAuth: []
summary: A bot's kept mail, newest first
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
enum:
- allowed
- stranger
- automatic
required: false
name: verdict
in: query
- schema:
type: string
maxLength: 100
required: false
name: tag
in: query
- schema:
type: string
maxLength: 300
required: false
name: sender
in: query
- schema:
type: string
maxLength: 200
required: false
name: q
in: query
- schema:
type: integer
minimum: 1
maximum: 100
required: false
name: limit
in: query
- schema:
type: string
maxLength: 100
required: false
name: cursor
in: query
responses:
'200':
description: MailMessageList
content:
application/json:
schema:
$ref: '#/components/schemas/MailMessageList'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/bots/{id}/email/messages/{messageId}:
get:
operationId: getMailMessage
tags:
- Mail
security:
- bearerAuth: []
summary: One kept mail with its whole text
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
format: uuid
required: true
name: messageId
in: path
responses:
'200':
description: MailMessageDetail
content:
application/json:
schema:
$ref: '#/components/schemas/MailMessageDetail'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
delete:
operationId: deleteMailMessage
tags:
- Mail
security:
- bearerAuth: []
summary: Delete one kept mail, its text and its files
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
format: uuid
required: true
name: messageId
in: path
responses:
'200':
description: Deleted
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteMailMessagesResult'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/bots/{id}/email/messages/{messageId}/files/{index}:
get:
operationId: downloadMailFile
tags:
- Mail
security:
- bearerAuth: []
summary: A kept mail's attachment
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
format: uuid
required: true
name: messageId
in: path
- schema:
type: string
pattern: ^[0-9]$
required: true
name: index
in: path
responses:
'200':
description: File contents
content:
application/octet-stream:
schema:
type: string
format: binary
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/bots/{id}/email/block:
post:
operationId: blockMailSender
tags:
- Mail
security:
- bearerAuth: []
summary: Refuse a sender's mail at the door
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BlockMailSenderRequest'
responses:
'200':
description: MailAddress
content:
application/json:
schema:
$ref: '#/components/schemas/MailAddress'
'400':
description: Validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
delete:
operationId: unblockMailSender
tags:
- Mail
security:
- bearerAuth: []
summary: Let a blocked sender's mail through again
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
- schema:
type: string
minLength: 1
maxLength: 300
required: true
name: sender
in: query
responses:
'200':
description: MailAddress
content:
application/json:
schema:
$ref: '#/components/schemas/MailAddress'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/bots/{id}/email/messages/delete:
post:
operationId: deleteMailMessages
tags:
- Mail
security:
- bearerAuth: []
summary: Delete several kept mails, or every mail older than a date
parameters:
- schema:
type: string
format: uuid
required: true
name: id
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteMailMessagesRequest'
responses:
'200':
description: Deleted
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteMailMessagesResult'
'400':
description: Validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: Not authenticated
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
components:
schemas:
MailMessage:
type: object
properties:
id:
type: string
format: uuid
direction:
type: string
enum:
- in
- out
from_addr:
type: string
from_name:
type:
- string
- 'null'
to_tag:
type: string
subject:
type: string
snippet:
type: string
verdict:
type: string
enum:
- allowed
- stranger
- automatic
sender_check:
type: string
enum:
- pass
- fail
- none
has_files:
type: boolean
file_count:
type: integer
size:
type: integer
conversation_id:
type:
- string
- 'null'
format: uuid
created_at:
type: string
format: date-time
required:
- id
- direction
- from_addr
- from_name
- to_tag
- subject
- snippet
- verdict
- sender_check
- has_files
- file_count
- size
- conversation_id
- created_at
BlockMailSenderRequest:
type: object
properties:
sender:
type: string
minLength: 1
maxLength: 300
required:
- sender
ClaimMailAddressRequest:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 40
surface:
type: string
enum:
- profile
- tool
- suggestion
required:
- name
MailMessageDetail:
allOf:
- $ref: '#/components/schemas/MailMessage'
- type: object
properties:
text:
type: string
files:
type: array
items:
$ref: '#/components/schemas/MailFile'
required:
- text
- files
DeleteMailMessagesResult:
type: object
properties:
deleted:
type: integer
freed:
type: integer
required:
- deleted
- freed
MailMessageList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/MailMessage'
next_cursor:
type:
- string
- 'null'
required:
- items
- next_cursor
MailAddress:
type: object
properties:
id:
type: string
format: uuid
bot_id:
type: string
format: uuid
channel_id:
type: string
format: uuid
local_part:
type: string
address:
type: string
status:
type: string
enum:
- active
- paused
- retired
blocked_senders:
type: array
items:
type: string
notify_new_senders:
type: boolean
storage_used:
type: integer
storage_limit:
type:
- integer
- 'null'
created_at:
type: string
format: date-time
required:
- id
- bot_id
- channel_id
- local_part
- address
- status
- blocked_senders
- notify_new_senders
- created_at
MailFile:
type: object
properties:
index:
type: integer
name:
type: string
mime:
type: string
size:
type: integer
required:
- index
- name
- mime
- size
MailNameAvailability:
type: object
properties:
name:
type: string
available:
type: boolean
issue:
type:
- string
- 'null'
suggestions:
type: array
items:
type: string
domain:
type: string
required:
- name
- available
- issue
- suggestions
Problem:
type: object
properties:
type:
type: string
example: https://casama.ai/problems/not_found
title:
type: string
status:
type: integer
code:
type: string
description: Stable error code
example: not_found
detail:
type: string
instance:
type: string
errors:
type: array
items:
type: object
properties:
path:
type: string
message:
type: string
required:
- path
- message
description: Field errors for validation_failed
required:
- type
- title
- status
- code
DeleteMailMessagesRequest:
type: object
properties:
ids:
type: array
items:
type: string
format: uuid
minItems: 1
maxItems: 200
before:
type: string
format: date-time
UpdateMailAddressRequest:
type: object
properties:
status:
type: string
enum:
- active
- paused
notify_new_senders:
type: boolean
MoveMailAddressRequest:
type: object
properties:
to_bot_id:
type: string
format: uuid
required:
- to_bot_id
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: Supabase access token