Examples
Edit on GitHubCode samples and example responses.
Preview
curl 'https://api.resend.com/emails/string' \
-H 'Authorization: Bearer <TOKEN>'Response
{
"object": "email",
"id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"message_id": "<202301010000.4ef9a417@email.example.com>",
"to": [
"delivered@resend.dev"
],
"from": "Acme <onboarding@resend.dev>",
"created_at": "2023-04-03 22:13:42.674981+00",
"subject": "Hello World",
"html": "Congrats on sending your <strong>first email</strong>!",
"text": "string",
"bcc": [
"string"
],
"cc": [
"string"
],
"reply_to": [
"string"
],
"last_event": "delivered"
}<OpenAPI.Operation id="emails-get">
<OpenAPI.Operation.RequestExample languages={["curl", "javascript", "go"]} />
<OpenAPI.Operation.ResponseExample />
</OpenAPI.Operation>
RequestExample builds a request from the spec, with an auth placeholder, and shows it in cURL, JavaScript, Python, Go, Rust, Java, Kotlin or C#. A menu in the header switches language. Use languages to offer only some of them. ResponseExample shows an example body for each status code. If the spec has no example, one is generated from the schema.
The code comes from createCodeSample in @ariadocs/openapi.