Kalo te dokumentacioni
SDK

openemail.suppressions

Çdo metodë në këtë hapësirë emrash: nënshkrimi, parametrat, çfarë kthen dhe një shembull.

Metodat

The addresses this workspace will not send to: hard bounces, complaints and the ones you block by hand.

suppressions.list()

List one page of the suppression list

Lejetsettings:readKalon nëpër rezultate faqe pas faqeje
Nënshkrimi
list(options?: SuppressionListOptions): Promise<Page<SuppressionResource>>

Resolves one page of the addresses this workspace will not send to, newest first: every address that bounced hard, complained, or was added by hand. listAll collects every page and iterate walks them lazily.

A send to a suppressed address is refused for that recipient before anything leaves, and a message whose recipients are all suppressed fails outright. The list belongs to the whole workspace, so a key limited to some addresses reads all of it, and a row names the recipient, never which of your addresses sent to it.

removable says whether remove will take the address off. A hard bounce is permanent here, because the address could not take mail. A complaint or a manual entry can be removed.

Parametrat

options.qstring

Searches the address, the reason and the detail. Words match loosely, and a close spelling is tried when nothing matches exactly.

options.reasonSuppressionReason

Keeps one kind: bounce, complaint or manual.

options.limitnumber

Page size, from 1 to 100. The server defaults to 25.

options.cursorstring

The nextCursor of the previous page. Leave it out for the first page.

options.signalAbortSignal

Cancels the request.

options.apiKeystring

Overrides the client API key for this call only.

Kthen

Page<SuppressionResource> with items, hasMore and nextCursor. Each item has id, email, reason, detail, removable and createdAt.

Shembull

const page = await openemail.suppressions.list({ reason: 'complaint' }) console.log(page.items.map((row) => [row.email, row.createdAt]))

Shënime

  • Needs settings:read, the scope the Blocked addresses screen in Settings is gated on.

  • The cursor is opaque and holds where the last row sat, so an address removed between pages never breaks the walk. A cursor this list did not hand out is a 400 invalid_cursor.

E disponueshme edhe në

API
GET /suppressions
CLI
openemail suppressions list

suppressions.listAll()

Collect the whole suppression list into one array

Lejetsettings:readKalon nëpër rezultate faqe pas faqeje
Nënshkrimi
listAll(options?: SuppressionListOptions): Promise<Array<SuppressionResource>>

Walks every page of list and resolves with every suppressed address, newest first. One request per page, with the same filters on each.

Parametrat

options.qstring

Searches the address, the reason and the detail. Words match loosely, and a close spelling is tried when nothing matches exactly.

options.reasonSuppressionReason

Keeps one kind: bounce, complaint or manual.

options.limitnumber

Page size for each request, from 1 to 100. The server defaults to 25.

options.cursorstring

Starts the walk after this cursor instead of the first page.

options.signalAbortSignal

Cancels the request in flight and the walk with it.

options.apiKeystring

Overrides the client API key for every page of this walk.

Kthen

Array<SuppressionResource> holding every suppressed address.

Shembull

const all = await openemail.suppressions.listAll({ limit: 100 }) const blocked = new Set(all.map((row) => row.email))

Shënime

  • If any page fails the promise rejects and the rows already fetched are discarded.

E disponueshme edhe në

API
GET /suppressions

suppressions.iterate()

Stream the suppression list one address at a time

Lejetsettings:readKalon nëpër rezultate faqe pas faqeje
Nënshkrimi
iterate(options?: SuppressionListOptions): AsyncGenerator<SuppressionResource, void, undefined>

Returns an async generator that yields one suppressed address at a time, newest first, and requests the next page only once the current one is drained. Nothing is fetched until you consume it, and breaking out of the loop stops the requests.

Parametrat

options.qstring

Searches the address, the reason and the detail. Words match loosely, and a close spelling is tried when nothing matches exactly.

options.reasonSuppressionReason

Keeps one kind: bounce, complaint or manual.

options.limitnumber

Page size for each request, from 1 to 100. The server defaults to 25.

options.cursorstring

Starts the walk after this cursor instead of the first page.

options.signalAbortSignal

Cancels the request in flight and the walk with it.

options.apiKeystring

Overrides the client API key for every page of this walk.

Kthen

AsyncGenerator<SuppressionResource, void, undefined> yielding one suppressed address per step.

Shembull

for await (const row of openemail.suppressions.iterate({ q: 'example.com' })) {    console.log(row.email, row.reason)}

Shënime

  • The generator is lazy, so an abandoned loop costs only the pages you consumed.

E disponueshme edhe në

API
GET /suppressions

suppressions.get()

Read one suppressed address by id

Lejetsettings:read
Nënshkrimi
get(id: string, options?: RequestScope): Promise<SuppressionResource>

Resolves one row of the suppression list: the address, why it is there, the detail the bounce or complaint carried, whether it can be removed and when it was added.

Parametrat

idstringE detyrueshme

The id from list.

options.signalAbortSignal

Cancels the request.

options.apiKeystring

Overrides the client API key for this call only.

Kthen

SuppressionResource with id, email, reason, detail, removable and createdAt.

Shembull

const row = await openemail.suppressions.get('7b1e2c3d-4f5a-4b6c-8d7e-9f0a1b2c3d4e') console.log(row.email, row.removable)

Shënime

E disponueshme edhe në

API
GET /suppressions/{id}
CLI
openemail suppressions get

suppressions.add()

Stop sending to an address

Lejetsettings:write
Nënshkrimi
add(body: SuppressionAdd, options?: RequestScope): Promise<SuppressionResource>

Puts an address on the suppression list by hand, with reason: 'manual', so no address in the workspace sends to it again until it is removed. It is the Block an address control on the Blocked addresses screen.

Adding an address that is already there changes nothing: the server answers 200 with the row it already holds, whatever its reason, where a new entry answers 201. Either way you get the row back. A new entry fires suppression.added to the webhooks that asked for it.

Parametrat

body.emailstringE detyrueshme

The address to stop sending to. It is trimmed and lower cased.

options.signalAbortSignal

Cancels the request.

options.apiKeystring

Overrides the client API key for this call only.

Kthen

SuppressionResource for the address, new or already there.

Shembull

const row = await openemail.suppressions.add({ email: '[email protected]' }) console.log(row.reason, row.createdAt)

Shënime

  • Safe to repeat: a second add finds the first entry, so the SDK retries it after a network failure.

  • A key limited to particular addresses or domains is refused with 422 capability_unsupported, because the list stops mail from every address in the workspace. So is an app connected by anybody but the owner.

E disponueshme edhe në

API
POST /suppressions
CLI
openemail suppressions add

suppressions.remove()

Allow mail to an address again

Lejetsettings:write
Nënshkrimi
remove(id: string, options?: RequestScope): Promise<RemovedSuppressionResource>

Takes an address off the suppression list, so mail may go to it again. It is Allow again on the Blocked addresses screen, and it fires suppression.removed.

Only a complaint or a manual entry can be removed. A hard bounce answers 409 suppression_not_removable and stays, because the address could not take mail: check it is spelled right and send to the corrected one instead.

Parametrat

idstringE detyrueshme

The id from list.

options.signalAbortSignal

Cancels the request.

options.apiKeystring

Overrides the client API key for this call only.

Kthen

RemovedSuppressionResource, { object: 'suppression', id, email, deleted: true }.

Shembull

const page = await openemail.suppressions.list({ q: '[email protected]' })const row = page.items.find((item) => item.removable) if (row) await openemail.suppressions.remove(row.id)

Shënime

  • The SDK does not retry a delete. A 404 on your own second attempt after a lost response means the first one worked.

  • A key limited to particular addresses or domains is refused with 422 capability_unsupported.

E disponueshme edhe në

API
DELETE /suppressions/{id}
CLI
openemail suppressions remove