Functions

create-new-api-key

fn (request: POSTApiKeysRequest): POSTApiKeysResponse
fn (request: POSTApiKeysRequest, opts: Map): POSTApiKeysResponse

Create a new API key with specified name, permission level, and optional domain restriction. The new key is masked in the run's call records.

Example

created ::resend::api::keys/create-new-api-key(::resend::api::keys/POSTApiKeysRequest({
    name: "Production",
    permission: "sending_access"
}))
created.id

remove-existing-api-key

fn (request: DELETEApiKeysApiKeyIdRequest): DELETEApiKeysApiKeyIdResponse
fn (request: DELETEApiKeysApiKeyIdRequest, opts: Map): DELETEApiKeysApiKeyIdResponse

Permanently delete an API key. This cannot be undone.

Example

::resend::api::keys/remove-existing-api-key(::resend::api::keys/DELETEApiKeysApiKeyIdRequest({api-key-id: "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"}))

retrieve-list-api-keys

fn (request: GETApiKeysRequest): GETApiKeysResponse
fn (request: GETApiKeysRequest, opts: Map): GETApiKeysResponse

Retrieve all API keys in your Resend account.

Example

keys ::resend::api::keys/retrieve-list-api-keys(::resend::api::keys/GETApiKeysRequest({}))
keys.data // => [{id: "...", name: "Production Key", created_at: "..."}]

Types

ApiKey

ApiKey type {
    id: Str?,
    name: Str?,
    created_at: Str?
}

CreateApiKeyRequest

CreateApiKeyRequest type {
    name: Str,
    permission: "full_access" | "sending_access"?,
    domain_id: Str?
}

CreateApiKeyResponse

CreateApiKeyResponse type {
    id: Str?,
    token: Str?
}

DELETEApiKeysApiKeyIdRequest

DELETEApiKeysApiKeyIdRequest type {
    api-key-id: Str
}

DELETEApiKeysApiKeyIdResponse

DELETEApiKeysApiKeyIdResponse type Map

GETApiKeysRequest

GETApiKeysRequest type Map

GETApiKeysResponse

GETApiKeysResponse type {
    data: Vec<ApiKey>?
}

ListApiKeysResponse

ListApiKeysResponse type {
    data: Vec<ApiKey>?
}

POSTApiKeysRequest

POSTApiKeysRequest type {
    name: Str,
    permission: "full_access" | "sending_access"?,
    domain_id: Str?
}

POSTApiKeysResponse

POSTApiKeysResponse type {
    id: Str?,
    token: Str?
}