Skip to main content

kobana inbox emails

Commands of kobana inbox emails. Every global option (Global options) applies here.

CommandHTTPDescription
emails listGET /v1/emailsList emails
emails createPOST /v1/emailsSubmit a raw .eml
emails getGET /v1/emails/{id}Get email
emails deleteDELETE /v1/emails/{id}Delete email
emails emlGET /v1/emails/{id}/emlDownload original .eml
emails reprocessPOST /v1/emails/{id}/reprocessReprocess email

emails list​

List emails

kobana inbox emails list [OPTIONS]

GET /v1/emails

Keyset-paginated. Filters are typed query params (field=value, field[op]=value); unknown filters, unsortable fields and malformed values are rejected with 400 VALIDATION_ERROR.

Query parameters

NameTypeRequiredDescription
limitintegerno
cursorstringnoOpaque cursor returned in meta.next_cursor of the previous page.
sort_bystringnoField to order by. Allowed: created_at, updated_at, from, status. Without it the order is created_at descending. Values: created_at, updated_at, from, status.
sort_orderstringnoasc (default) or desc. Needs sort_by. Values: asc, desc.
statusstringnoEquality. Also status[in]=a,b. Values: received, approved, rejected, processing, processed, failed.
inbox_idstringnoEquality. Also inbox_id[in]=a,b.
agent_idstringnoEquality. Also agent_id[in]=a,b.
message_idstringnoEquality. Also message_id[in]=a,b.
fromstringnoEquality. Also from[in]=a,b.
tostringnoRows whose to contains the value.
created_atstringnoEquality. Also created_at[in]=a,b and created_at[gt|gte|lt|lte].
created_at[gte]stringno
created_at[lte]stringno
updated_atstringnoEquality. Also updated_at[in]=a,b and updated_at[gt|gte|lt|lte].
updated_at[gte]stringno
updated_at[lte]stringno
received_atstringnoEquality. Also received_at[in]=a,b and received_at[gt|gte|lt|lte].
received_at[gte]stringno
received_at[lte]stringno
processed_atstringnoEquality. Also processed_at[in]=a,b and processed_at[gt|gte|lt|lte].
processed_at[gte]stringno
processed_at[lte]stringno

Headers

NameTypeRequiredDescription
x-origin-shared-secretstringnoShared secret between CloudFront and the origin. Required in production; ignored in development unless CF_ORIGIN_SHARED_SECRET is set.

Responses

HTTPDescription
200Page of results.
400Body failed Zod validation. error.details carries formErrors/fieldErrors.
404Resource not found or filtered out by soft-delete.

emails create​

Submit a raw .eml

kobana inbox emails create [OPTIONS]

POST /v1/emails

Stores an RFC 5322 message exactly as SES inbound would: raw object in the raw bucket, Email in received, and a process-email job — filters, agent and webhooks run as for real mail. Send the message either as multipart/form-data (field file, optional inbox_id) or as the request body with Content-Type: message/rfc822 (optional ?inbox_id=). Without inbox_id the inbox is resolved from the To: header among the caller workspace inboxes. A Message-ID already stored in the same inbox is rejected with 409 (error.details.email_id points at the existing email); the same Message-ID in another inbox is a different email.

Query parameters

NameTypeRequiredDescription
inbox_idstringnoTarget inbox. Overridden by the multipart inbox_id field when both are sent.

Headers

NameTypeRequiredDescription
x-origin-shared-secretstringnoShared secret between CloudFront and the origin. Required in production; ignored in development unless CF_ORIGIN_SHARED_SECRET is set.

Request body

The body is not a plain object (or has variants). See kobana schema inbox.emails.create.

Responses

HTTPDescription
201Stored and queued for processing.
400Empty body or missing multipart file field.
404inbox_id does not exist in the caller workspace (INBOX_NOT_FOUND).
409DUPLICATE_MESSAGE_ID: the Message-ID is already stored in the target inbox.
413PAYLOAD_TOO_LARGE: message above 20 MB.
415UNSUPPORTED_MEDIA_TYPE: body is neither multipart nor message/rfc822.
422NO_INBOX_MATCHES_TO_HEADER (no workspace inbox matches the To: recipients), MISSING_RECIPIENT (no usable To: header; pass inbox_id) or INVALID_MESSAGE_ID (control characters or over 998 characters).

emails get​

Get email

kobana inbox emails get [ID] [OPTIONS]

GET /v1/emails/{id}

Path arguments: id

Headers

NameTypeRequiredDescription
x-origin-shared-secretstringnoShared secret between CloudFront and the origin. Required in production; ignored in development unless CF_ORIGIN_SHARED_SECRET is set.

Responses

HTTPDescription
200Success.
404Resource not found or filtered out by soft-delete.

emails delete​

Delete email

kobana inbox emails delete [ID] [OPTIONS]

DELETE /v1/emails/{id}

Soft-deletes the email (sets deleted_at). It stops appearing in lists and detail; the raw object is purged by the retention job.

Path arguments: id

Headers

NameTypeRequiredDescription
x-origin-shared-secretstringnoShared secret between CloudFront and the origin. Required in production; ignored in development unless CF_ORIGIN_SHARED_SECRET is set.

Responses

HTTPDescription
200Deleted (soft delete).
404Resource not found or filtered out by soft-delete.

emails eml​

Download original .eml

kobana inbox emails eml [ID] [OPTIONS]

GET /v1/emails/{id}/eml

Path arguments: id

Headers

NameTypeRequiredDescription
x-origin-shared-secretstringnoShared secret between CloudFront and the origin. Required in production; ignored in development unless CF_ORIGIN_SHARED_SECRET is set.

Responses

HTTPDescription
200Raw RFC 5322 message stream.
404Resource not found or filtered out by soft-delete.

emails reprocess​

Reprocess email

kobana inbox emails reprocess [ID] [OPTIONS]

POST /v1/emails/{id}/reprocess

Sends the email back through processing (filters, agent, webhooks). Only an email in a terminal status — processed, rejected or failed — is eligible; one still received, approved or processing is refused with 409 CONFLICT, so an agent (and its workflow) never runs twice for the same email. Running the agent needs an active plan: without one the call is refused with 403 ENTITLEMENT_REQUIRED (error.details.reason = no_plan) and nothing is queued.

Path arguments: id

Headers

NameTypeRequiredDescription
x-origin-shared-secretstringnoShared secret between CloudFront and the origin. Required in production; ignored in development unless CF_ORIGIN_SHARED_SECRET is set.

Responses

HTTPDescription
202Accepted and queued.
404Resource not found or filtered out by soft-delete.
409CONFLICT: the email is still received, approved or processing.