{"note":"OpenAPI conversion -- returning structured metadata","name":"resend","description":"Resend","version":"1.5.0","base_url":"https://api.resend.com","endpoints":69,"raw":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Resend\n@base https://api.resend.com\n@version 1.5.0\n@auth Bearer bearer\n@endpoints 69\n@hint download_for_search\n@toc emails(12), domains(6), api-keys(3), templates(7), audiences(4), contacts(10), broadcasts(6), webhooks(5), segments(4), topics(5), contact-properties(5), logs(2)\n\n@group emails\n@endpoint POST /emails\n@desc Send an email\n@required {from: str # Sender email address. To include a friendly name, use the format \"Your Name \"., to: any # Recipient email address. For multiple addresses, send as an array of strings. Max 50., subject: str # Email subject.}\n@optional {Idempotency-Key: str # A unique identifier for the request to ensure emails are only sent once. [Learn more](https://resend.com/docs/dashboard/emails/idempotency-keys), bcc: any # Bcc recipient email address. For multiple addresses, send as an array of strings., cc: any # Cc recipient email address. For multiple addresses, send as an array of strings., reply_to: any # Reply-to email address. For multiple addresses, send as an array of strings., html: str # The HTML version of the message., text: str # The plain text version of the message., template: any, headers: map # Custom headers to add to the email., scheduled_at: str # Schedule email to be sent later. The date should be in ISO 8601 format., attachments: [map{content: str(binary), filename: str, path: str, content_type: str, content_id: str}], tags: [map{name: str, value: str}], topic_id: str # The topic ID to scope the email to. If the recipient is a contact and opted-in to the topic, the email is sent. If opted-out, the email is not sent. If the recipient is not a contact, the email is sent if the topic's default subscription is opt_in.}\n@returns(200) {id: str} # OK\n\n@endpoint GET /emails\n@desc Retrieve a list of emails\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /emails/{email_id}\n@desc Retrieve a single email\n@required {email_id: str # The ID of the email.}\n@returns(200) {object: str, id: str, to: [str], from: str, created_at: str(date-time), subject: str, html: str, text: str, bcc: [str], cc: [str], reply_to: [str], last_event: str} # OK\n\n@endpoint PATCH /emails/{email_id}\n@desc Update a single email\n@required {email_id: str # The ID of the email.}\n@returns(200) {scheduled_at: str} # OK\n\n@endpoint POST /emails/{email_id}/cancel\n@desc Cancel the schedule of the e-mail.\n@required {email_id: str # The ID of the email.}\n@returns(200) {object: str, id: str, to: [str], from: str, created_at: str(date-time), subject: str, html: str, text: str, bcc: [str], cc: [str], reply_to: [str], last_event: str} # OK\n\n@endpoint POST /emails/batch\n@desc Trigger up to 100 batch emails at once.\n@optional {Idempotency-Key: str # A unique identifier for the request to ensure emails are only sent once. [Learn more](https://resend.com/docs/dashboard/emails/idempotency-keys)}\n@returns(200) {data: [map]} # OK\n\n@endpoint GET /emails/{email_id}/attachments\n@desc Retrieve a list of attachments for a sent email\n@required {email_id: str(uuid) # The ID of the email.}\n@optional {limit: int # Maximum number of attachments to return., after: str(uuid) # Pagination cursor to fetch results after this attachment ID. Cannot be used with 'before'., before: str(uuid) # Pagination cursor to fetch results before this attachment ID. Cannot be used with 'after'.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /emails/{email_id}/attachments/{attachment_id}\n@desc Retrieve a single attachment for a sent email\n@required {email_id: str(uuid) # The ID of the email., attachment_id: str(uuid) # The ID of the attachment.}\n@returns(200) {object: str, id: str(uuid), filename: str, content_type: str, content_id: str, content_disposition: str, download_url: str, expires_at: str(date-time), size: int} # OK\n\n@endpoint GET /emails/receiving\n@desc Retrieve a list of received emails\n@optional {limit: int # Maximum number of received emails to return., after: str(uuid) # Pagination cursor to fetch results after this email ID. Cannot be used with 'before'., before: str(uuid) # Pagination cursor to fetch results before this email ID. Cannot be used with 'after'.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /emails/receiving/{email_id}\n@desc Retrieve a single received email\n@required {email_id: str(uuid) # The ID of the received email.}\n@returns(200) {object: str, id: str(uuid), to: [str], from: str, subject: str, message_id: str, bcc: [str]?, cc: [str]?, reply_to: [str]?, html: str?, text: str?, headers: map?, created_at: str(date-time), attachments: [map]} # OK\n\n@endpoint GET /emails/receiving/{email_id}/attachments\n@desc Retrieve a list of attachments for a received email\n@required {email_id: str(uuid) # The ID of the received email.}\n@optional {limit: int # Maximum number of attachments to return., after: str(uuid) # Pagination cursor to fetch results after this attachment ID. Cannot be used with 'before'., before: str(uuid) # Pagination cursor to fetch results before this attachment ID. Cannot be used with 'after'.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /emails/receiving/{email_id}/attachments/{attachment_id}\n@desc Retrieve a single attachment for a received email\n@required {email_id: str(uuid) # The ID of the received email., attachment_id: str(uuid) # The ID of the attachment.}\n@returns(200) {object: str, id: str(uuid), filename: str, content_type: str, content_id: str, content_disposition: str, download_url: str, expires_at: str(date-time), size: int} # OK\n\n@endgroup\n\n@group domains\n@endpoint POST /domains\n@desc Create a new domain\n@required {name: str # The name of the domain you want to create.}\n@optional {region: str(us-east-1/eu-west-1/sa-east-1/ap-northeast-1)=us-east-1 # The region where emails will be sent from. Possible values are us-east-1 | eu-west-1 | sa-east-1 | ap-northeast-1, custom_return_path: str # For advanced use cases, choose a subdomain for the Return-Path address. Defaults to 'send' (i.e., send.yourdomain.tld)., open_tracking: bool # Track the open rate of each email., click_tracking: bool # Track clicks within the body of each HTML email., tls: str(opportunistic/enforced)=opportunistic # TLS mode. Opportunistic attempts secure connection but falls back to unencrypted. Enforced requires TLS or email won't be sent., capabilities: map{sending: str, receiving: str} # Configure the domain capabilities for sending and receiving emails. At least one capability must be enabled.}\n@returns(201) {id: str, name: str, created_at: str(date-time), status: str, capabilities: map{sending: str, receiving: str}, records: [map], region: str} # OK\n\n@endpoint GET /domains\n@desc Retrieve a list of domains\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /domains/{domain_id}\n@desc Retrieve a single domain\n@required {domain_id: str # The ID of the domain.}\n@returns(200) {object: str, id: str, name: str, status: str, created_at: str(date-time), region: str, capabilities: map{sending: str, receiving: str}, records: [map]} # OK\n\n@endpoint PATCH /domains/{domain_id}\n@desc Update an existing domain\n@required {domain_id: str # The ID of the domain.}\n@optional {open_tracking: bool # Track the open rate of each email., click_tracking: bool # Track clicks within the body of each HTML email., tls: str=opportunistic # enforced | opportunistic., capabilities: map{sending: str, receiving: str} # Configure the domain capabilities for sending and receiving emails. At least one capability must be enabled.}\n@returns(200) {id: str, object: str} # OK\n\n@endpoint DELETE /domains/{domain_id}\n@desc Remove an existing domain\n@required {domain_id: str # The ID of the domain.}\n@returns(200) {object: str, id: str, deleted: bool} # OK\n\n@endpoint POST /domains/{domain_id}/verify\n@desc Verify an existing domain\n@required {domain_id: str # The ID of the domain.}\n@returns(200) {object: str, id: str} # OK\n\n@endgroup\n\n@group api-keys\n@endpoint POST /api-keys\n@desc Create a new API key\n@required {name: str # The API key name.}\n@optional {permission: str(full_access/sending_access) # The API key can have full access to Resend’s API or be only restricted to send emails. * full_access - Can create, delete, get, and update any resource. * sending_access - Can only send emails., domain_id: str # Restrict an API key to send emails only from a specific domain. Only used when the permission is sending_access.}\n@returns(201) {id: str, token: str} # OK\n\n@endpoint GET /api-keys\n@desc Retrieve a list of API keys\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint DELETE /api-keys/{api_key_id}\n@desc Remove an existing API key\n@required {api_key_id: str # The API key ID.}\n@returns(200) {object: str, id: str, deleted: bool} # OK\n\n@endgroup\n\n@group templates\n@endpoint POST /templates\n@desc Create a template\n@required {name: str # The name of the template., html: str # The HTML version of the template.}\n@optional {alias: str # The alias of the template., from: str # Sender email address. To include a friendly name, use the format \"Your Name \"., subject: str # Email subject., reply_to: [str] # Reply-to email addresses., text: str # The plain text version of the template., variables: [map{key!: str, type!: str, fallback_value: any}]}\n@returns(201) {id: str, object: str} # OK\n\n@endpoint GET /templates\n@desc Retrieve a list of templates\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, data: [map], has_more: bool} # OK\n\n@endpoint GET /templates/{id}\n@desc Retrieve a single template\n@required {id: str # The Template ID or alias.}\n@returns(200) {object: str, id: str, current_version_id: str, name: str, alias: str, from: str, subject: str, reply_to: [str]?, html: str, text: str, variables: [map], created_at: str(date-time), updated_at: str(date-time), status: str, published_at: str(date-time)?, has_unpublished_versions: bool} # OK\n\n@endpoint PATCH /templates/{id}\n@desc Update an existing template\n@required {id: str # The Template ID or alias.}\n@optional {name: str # The name of the template., alias: str # The alias of the template., from: str # Sender email address. To include a friendly name, use the format \"Your Name \"., subject: str # Email subject., reply_to: [str] # Reply-to email addresses., html: str # The HTML version of the template., text: str # The plain text version of the template., variables: [map{key!: str, type!: str, fallback_value: any}]}\n@returns(200) {id: str, object: str} # OK\n\n@endpoint DELETE /templates/{id}\n@desc Remove an existing template\n@required {id: str # The Template ID or alias.}\n@returns(200) {object: str, id: str, deleted: bool} # OK\n\n@endpoint POST /templates/{id}/publish\n@desc Publish a template\n@required {id: str # The Template ID or alias.}\n@returns(200) {id: str, object: str} # OK\n\n@endpoint POST /templates/{id}/duplicate\n@desc Duplicate a template\n@required {id: str # The Template ID or alias.}\n@returns(200) {id: str, object: str} # OK\n\n@endgroup\n\n@group audiences\n@endpoint POST /audiences\n@desc Create a list of contacts\n@required {name: str # The name of the audience you want to create.}\n@returns(201) {id: str, object: str, name: str} # OK\n\n@endpoint GET /audiences\n@desc Retrieve a list of audiences\n@returns(200) {object: str, data: [map]} # OK\n\n@endpoint DELETE /audiences/{id}\n@desc Remove an existing audience\n@required {id: str # The Audience ID.}\n@returns(200) {id: str, object: str, deleted: bool} # OK\n\n@endpoint GET /audiences/{id}\n@desc Retrieve a single audience\n@required {id: str # The Audience ID.}\n@returns(200) {id: str, object: str, name: str, created_at: str} # OK\n\n@endgroup\n\n@group contacts\n@endpoint POST /contacts\n@desc Create a new contact\n@required {email: str # Email address of the contact.}\n@optional {first_name: str # First name of the contact., last_name: str # Last name of the contact., unsubscribed: bool # The Contact's global subscription status. If set to true, the contact will be unsubscribed from all Broadcasts., properties: map # A map of custom property keys and values to create., segments: [str] # Array of segment IDs to add the contact to., topics: [map{id: str, subscription: str}] # Array of topic subscriptions for the contact., audience_id: str # Unique identifier of the audience to which the contact belongs.}\n@returns(201) {object: str, id: str} # OK\n\n@endpoint GET /contacts\n@desc Retrieve a list of contacts\n@optional {segment_id: str # Filter contacts by segment ID., limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, data: [map]} # OK\n\n@endpoint GET /contacts/{id}\n@desc Retrieve a single contact by ID or email\n@required {id: str # The Contact ID or email address.}\n@returns(200) {object: str, id: str, email: str, first_name: str, last_name: str, created_at: str(date-time), unsubscribed: bool, properties: map} # OK\n\n@endpoint PATCH /contacts/{id}\n@desc Update a single contact by ID or email\n@required {id: str # The Contact ID or email address.}\n@optional {email: str # Email address of the contact., first_name: str # First name of the contact., last_name: str # Last name of the contact., unsubscribed: bool # The Contact's global subscription status. If set to true, the contact will be unsubscribed from all Broadcasts., properties: map # A map of custom property keys and values to update.}\n@returns(200) {object: str, id: str} # OK\n\n@endpoint DELETE /contacts/{id}\n@desc Remove an existing contact by ID or email\n@required {id: str # The Contact ID or email address.}\n@returns(200) {object: str, id: str, deleted: bool} # OK\n\n@endgroup\n\n@group broadcasts\n@endpoint POST /broadcasts\n@desc Create a broadcast\n@required {segment_id: str # Unique identifier of the segment this broadcast will be sent to., from: str # The email address of the sender., subject: str # The subject line of the email.}\n@optional {name: str # Name of the broadcast., audience_id: str # Use `segment_id` instead. Unique identifier of the segment this broadcast will be sent to., reply_to: [str] # The email addresses to which replies should be sent., preview_text: str # The preview text of the email., html: str # The HTML version of the message., text: str # The plain text version of the message., topic_id: str # The topic ID that the broadcast will be scoped to., send: bool # Whether to send the broadcast immediately or keep it as a draft., scheduled_at: str # Schedule time to send the broadcast. Can only be used if `send` is true.}\n@returns(201) {id: str, object: str} # OK\n\n@endpoint GET /broadcasts\n@desc Retrieve a list of broadcasts\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint DELETE /broadcasts/{id}\n@desc Remove an existing broadcast that is in the draft status\n@required {id: str # The Broadcast ID.}\n@returns(200) {id: str, object: str, deleted: bool} # OK\n\n@endpoint GET /broadcasts/{id}\n@desc Retrieve a single broadcast\n@required {id: str # The Broadcast ID.}\n@returns(200) {id: str, name: str, audience_id: str?, segment_id: str?, from: str, subject: str, reply_to: [str], preview_text: str, status: str, created_at: str(date-time), scheduled_at: str(date-time), sent_at: str(date-time), text: str?, html: str?, topic_id: str?} # OK\n\n@endpoint PATCH /broadcasts/{id}\n@desc Update an existing broadcast\n@required {id: str # The Broadcast ID.}\n@optional {name: str # Name of the broadcast., audience_id: str # Use `segment_id` instead. Unique identifier of the audience this broadcast will be sent to., segment_id: str # Unique identifier of the segment this broadcast will be sent to., from: str # The email address of the sender., subject: str # The subject line of the email., reply_to: [str] # The email addresses to which replies should be sent., preview_text: str # The preview text of the email., html: str # The HTML version of the message., text: str # The plain text version of the message., topic_id: str # The topic ID that the broadcast will be scoped to.}\n@returns(200) {id: str, object: str} # OK\n\n@endpoint POST /broadcasts/{id}/send\n@desc Send or schedule a broadcast\n@required {id: str # The Broadcast ID.}\n@optional {scheduled_at: str # Schedule email to be sent later. The date should be in ISO 8601 format.}\n@returns(200) {id: str} # OK\n\n@endgroup\n\n@group webhooks\n@endpoint POST /webhooks\n@desc Create a new webhook\n@required {endpoint: str # The URL where webhook events will be sent., events: [str] # Array of event types to subscribe to.}\n@returns(201) {object: str, id: str(uuid), signing_secret: str} # Created\n\n@endpoint GET /webhooks\n@desc Retrieve a list of webhooks\n@optional {limit: int # Maximum number of webhooks to return., after: str(uuid) # Pagination cursor to fetch results after this webhook ID. Cannot be used with 'before'., before: str(uuid) # Pagination cursor to fetch results before this webhook ID. Cannot be used with 'after'.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /webhooks/{webhook_id}\n@desc Retrieve a single webhook\n@required {webhook_id: str(uuid) # The Webhook ID.}\n@returns(200) {object: str, id: str(uuid), endpoint: str, events: [str]?, status: str, created_at: str(date-time), signing_secret: str} # OK\n\n@endpoint PATCH /webhooks/{webhook_id}\n@desc Update an existing webhook\n@required {webhook_id: str(uuid) # The Webhook ID.}\n@optional {endpoint: str # The URL where webhook events will be sent., events: [str] # Array of event types to subscribe to., status: str(enabled/disabled) # The status of the webhook.}\n@returns(200) {object: str, id: str(uuid)} # OK\n\n@endpoint DELETE /webhooks/{webhook_id}\n@desc Remove an existing webhook\n@required {webhook_id: str(uuid) # The Webhook ID.}\n@returns(200) {object: str, id: str(uuid), deleted: bool} # OK\n\n@endgroup\n\n@group segments\n@endpoint POST /segments\n@desc Create a new segment\n@required {name: str # The name of the segment.}\n@optional {audience_id: str # The ID of the audience this segment belongs to., filter: map # Filter conditions for the segment.}\n@returns(201) {id: str, object: str} # OK\n\n@endpoint GET /segments\n@desc Retrieve a list of segments\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /segments/{id}\n@desc Retrieve a single segment\n@required {id: str # The Segment ID.}\n@returns(200) {id: str, object: str, name: str, audience_id: str, filter: map, created_at: str(date-time)} # OK\n\n@endpoint DELETE /segments/{id}\n@desc Remove an existing segment\n@required {id: str # The Segment ID.}\n@returns(200) {id: str, object: str, deleted: bool} # OK\n\n@endgroup\n\n@group topics\n@endpoint POST /topics\n@desc Create a new topic\n@required {name: str # The name of the topic. Max 50 characters., default_subscription: str(opt_in/opt_out) # The default subscription status for the topic. Cannot be changed after creation.}\n@optional {description: str # A description of the topic. Max 200 characters., visibility: str(public/private)=private # The visibility of the topic. Public topics are visible to all contacts on the unsubscribe page. Private topics are only visible to opted-in contacts.}\n@returns(201) {id: str, object: str} # OK\n\n@endpoint GET /topics\n@desc Retrieve a list of topics\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /topics/{id}\n@desc Retrieve a single topic\n@required {id: str # The Topic ID.}\n@returns(200) {id: str, object: str, name: str, description: str, default_subscription: str, visibility: str, created_at: str(date-time)} # OK\n\n@endpoint PATCH /topics/{id}\n@desc Update an existing topic\n@required {id: str # The Topic ID.}\n@optional {name: str # The name of the topic. Max 50 characters., description: str # A description of the topic. Max 200 characters., visibility: str(public/private) # The visibility of the topic.}\n@returns(200) {id: str, object: str} # OK\n\n@endpoint DELETE /topics/{id}\n@desc Remove an existing topic\n@required {id: str # The Topic ID.}\n@returns(200) {id: str, object: str, deleted: bool} # OK\n\n@endgroup\n\n@group contact-properties\n@endpoint POST /contact-properties\n@desc Create a new contact property\n@required {key: str # The property key. Max length is 50 characters. Only alphanumeric characters and underscores are allowed., type: str(string/number) # The property type.}\n@optional {fallback_value: any # The default value to use when the property is not set for a contact. Must match the type specified in the type field.}\n@returns(201) {id: str, object: str} # OK\n\n@endpoint GET /contact-properties\n@desc Retrieve a list of contact properties\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /contact-properties/{id}\n@desc Retrieve a single contact property\n@required {id: str # The Contact Property ID.}\n@returns(200) {object: str, id: str, key: str, type: str, fallback_value: any, created_at: str(date-time)} # OK\n\n@endpoint PATCH /contact-properties/{id}\n@desc Update an existing contact property\n@required {id: str # The Contact Property ID.}\n@optional {fallback_value: any # The default value to use when the property is not set for a contact. Must match the type of the property.}\n@returns(200) {id: str, object: str} # OK\n\n@endpoint DELETE /contact-properties/{id}\n@desc Remove an existing contact property\n@required {id: str # The Contact Property ID.}\n@returns(200) {id: str, object: str, deleted: bool} # OK\n\n@endgroup\n\n@group contacts\n@endpoint GET /contacts/{contact_id}/segments\n@desc Retrieve a list of segments for a contact\n@required {contact_id: str # The Contact ID or email address.}\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint POST /contacts/{contact_id}/segments/{segment_id}\n@desc Add a contact to a segment\n@required {contact_id: str # The Contact ID or email address., segment_id: str # The Segment ID.}\n@returns(200) {object: str, contact_id: str, segment_id: str} # OK\n\n@endpoint DELETE /contacts/{contact_id}/segments/{segment_id}\n@desc Remove a contact from a segment\n@required {contact_id: str # The Contact ID or email address., segment_id: str # The Segment ID.}\n@returns(200) {object: str, contact_id: str, segment_id: str, deleted: bool} # OK\n\n@endpoint GET /contacts/{contact_id}/topics\n@desc Retrieve topics for a contact\n@required {contact_id: str # The Contact ID or email address.}\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint PATCH /contacts/{contact_id}/topics\n@desc Update topics for a contact\n@required {contact_id: str # The Contact ID or email address., topics: [map{id: str, subscription: str}]}\n@returns(200) {object: str, contact_id: str, topics: [map]} # OK\n\n@endgroup\n\n@group logs\n@endpoint GET /logs\n@desc Retrieve a list of logs\n@optional {limit: int # Number of items to return., after: str # Return items after this cursor., before: str # Return items before this cursor.}\n@returns(200) {object: str, has_more: bool, data: [map]} # OK\n\n@endpoint GET /logs/{log_id}\n@desc Retrieve a single log\n@required {log_id: str(uuid) # The ID of the log.}\n@returns(200) {object: str, id: str(uuid), created_at: str(date-time), endpoint: str, method: str, response_status: int, user_agent: str?, request_body: any?, response_body: any?} # OK\n\n@endgroup\n\n@end\n"}