API keys
3 calls. Every request needs the Authorization header: see the overview.
apiKeys.list
Section titled “apiKeys.list”GET /users/self/api-keysThe caller’s API keys (never their secrets).
Who can call it: Admins and members, with a portal session (an API key is refused). Try it in the API playground.
Response: UserApiKey[] (200)
curl -X GET "https://api.maitento.com/users/self/api-keys" \ -H "Authorization: $MAITENTO_AUTH"const keys = await mt.apiKeys.list();mt.api_keys.list()apiKeys.create
Section titled “apiKeys.create”POST /users/self/api-keysCreates an API key. The secret is in the response and never shown again. NOTE: id in the response is the KEY’s id; authenticate with your USER id (users.self()): "<userId>:<secret>".
Who can call it: Admins and members, with a portal session (an API key is refused). Try it in the API playground.
Request body: UserApiKeyCreateRequest
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | A name for the key, 5 to 100 characters, unique among your active keys. |
dateExpires | datetime | null | When the key stops working, in UTC; must be in the future. Null: it never expires. |
Response: UserApiCreateResponse (200)
curl -X POST "https://api.maitento.com/users/self/api-keys" \ -H "Authorization: $MAITENTO_AUTH" \ -H "Content-Type: application/json" \ -d '{"name":"..."}'const { secret } = await mt.apiKeys.create({ name: "ci-deploys" });mt.api_keys.create("ci-deploys")apiKeys.delete
Section titled “apiKeys.delete”DELETE /users/self/api-keys/by-id/{id}Disables an API key.
Who can call it: Admins and members, with a portal session (an API key is refused). Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes |
Response: no body (204)
curl -X DELETE "https://api.maitento.com/users/self/api-keys/by-id/<id>" \ -H "Authorization: $MAITENTO_AUTH"await mt.apiKeys.delete("8d7c6b5a-4f3e-4d2c-9b1a-0f9e8d7c6b5a");mt.api_keys.delete("6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c")