تخطَّ إلى المستندات
API

الحساب

كل عملية في هذه المجموعة: ما تقبله وما تُرجعه والأخطاء التي قد تردّ بها.

العمليات

What this key is and may do.

GET/addresses

What this key may send as

الصلاحياتemails:sendيقرأ

The answer to an unexplained 403 or 409. unrestricted is true only on a key with neither allowlist set, and it means any local-part on a verified domain is accepted, including ones nobody has created. A key holding whole domains reads as unrestricted: false and still takes any local-part on those domains, so GET /keys/self is where you read which ones. canSend on an address is false when the address is disabled, when neither allowlist on the key covers it, or when the domain cannot sign yet, and sendingVerified on each domain is that last fact on its own.

Requires the emails:send scope.

معلمات الاستعلام

limitinteger

Rows per page, 1 to 100.

على الأقل 1على الأكثر 100الافتراضي25
cursorstring

The previous page's nextCursor, passed back as it came. It is opaque: it holds where the last row sat in this list's order, so a row deleted or edited between pages never breaks the walk, and the next page starts at the first row that sorts after it. A value this list did not hand out is a 400 invalid_cursor.

يُرجع

200

A page of addresses, alphabetically, with hasMore and nextCursor, plus unrestricted and every sendable domain on each page.

الأخطاء

الأخطاء التي يمكن أن تُرجعها أي عملية400401403404422500دليل الأخطاء

متاح أيضًا في

SDK
addresses.list()addresses.listAll()addresses.iterate()
CLI
openemail addresses list
MCP
whoAmI

GET/keys/self

What this key is

بلا نطاقيقرأ

Needs no scope: a key may always describe itself.

scopes is the EFFECTIVE list and the only one that authorises anything: the scopes on the key itself, intersected with the permissions of the role it was issued under. grantedScopes is what the key was created holding, and roleId names the ceiling that narrowed it, so anything in the first list and missing from the second was removed by that role.

That difference is the answer to the confusing 403. A key created with emails:send and capped by a viewer role is refused for lacking emails:send, which reads as a lie against the key the console is displaying; the fix is to change the role rather than to mint another key. roleId is null on a key with no ceiling, which is what every key issued before roles existed still has.

Two independent lists narrow what the key may send as. domainAllowlist holds whole domains, and the key may send as any address on one of them, including addresses created after the key was. addressAllowlist holds individual addresses. Both null or both empty means the key may send as any address the workspace owns. With either one set the key is narrowed, and reads of sent mail, tracking and calendar narrow to the same set. An address whose domain is already in domainAllowlist is dropped from addressAllowlist when the lists are written, so the two never overlap.

يُرجع

200

Id, mode, effective scopes, the role capping them, and both allowlists.

الأخطاء

الأخطاء التي يمكن أن تُرجعها أي عملية400401403404422500دليل الأخطاء

متاح أيضًا في

SDK
me.get()
CLI
openemail me get
MCP
whoAmI

POST/keys/self/rotate

Replace this key's secret

الصلاحياتkeys:writeيحذف

Mints a new secret for the key making the call and returns it once. There is no body and no way to name another key here: this call rotates the caller and nothing else, and POST /keys/{id}/rotate is the one that reaches other keys, behind keys:manage.

The old secret stops working the instant this returns. There is no overlap window and no grace period, and the response is the only place the new secret ever appears, so a caller that drops it has locked itself out until somebody in the console rotates the key again.

Everything else about the key is unchanged: same id, same name, same mode, same scopes, same role, same allowlists and same expiry. Only the last four characters move, because they are part of the secret. The request history hangs off the id rather than off the secret, so it runs straight through a rotation and reads as one key on both sides of it rather than as two.

Weigh that before granting keys:write. A stolen key holding it can rotate itself and take the secret away from the person who owns the key. It cannot hide while doing so, because the id does not move and revoking it from the console still works.

Requires the keys:write scope.

يُرجع

200

The body of GET /keys/self, plus token, the new secret in full and for the only time, rotationCount, an integer counting every rotation this key has had, and rotatedAt, when this one landed, ISO-8601.

الأخطاء

403

insufficient_scope: the key lacks keys:write. api_key_only: the request carried an OAuth access token, which has no secret to rotate.

404

resource_not_found: the key is gone. It authenticated this request and was deleted before the rotation landed, which is the only way to reach this.

409

revoked: the key was revoked between authenticating this request and rotating it. expired: it passed its expiry in the same gap. Neither is rotatable, and a key in either state authenticates nothing afterwards, so the answer is a new key from the console.

الأخطاء التي يمكن أن تُرجعها أي عملية400401422500دليل الأخطاء

متاح أيضًا في

SDK
me.rotate()
CLI
openemail me rotate

GET/ping

Auth smoke test

بلا نطاقيقرأ

يُرجع

200

ok, with the effective scopes and the role that capped them.

الأخطاء

الأخطاء التي يمكن أن تُرجعها أي عملية400401403404422500دليل الأخطاء

متاح أيضًا في

SDK
me.ping()
CLI
openemail me ping