Secrets
6 calls. Every request needs the Authorization header: see the overview.
secrets.list
Section titled “secrets.list”GET /secretsEvery secret (names only, never values).
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Response: Secret[] (200)
curl -X GET "https://api.maitento.com/secrets" \ -H "Authorization: $MAITENTO_AUTH"const secrets = await mt.secrets.list();mt.secrets.list()secrets.create
Section titled “secrets.create”POST /secretsCreates a secret.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Request body: SecretCreateRequest
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The secret’s name, which definitions use to refer to it. |
value | string | yes | The secret value, kept exactly as sent (whitespace included). It is never returned. |
Response: Secret (200)
curl -X POST "https://api.maitento.com/secrets" \ -H "Authorization: $MAITENTO_AUTH" \ -H "Content-Type: application/json" \ -d '{"name":"...","value":"..."}'const secret = await mt.secrets.create({ name: "orders-api-key", value: process.env.ORDERS_API_KEY! });mt.secrets.create("orders-api-key", os.environ["ORDERS_API_KEY"])secrets.delete
Section titled “secrets.delete”DELETE /secrets/by-id/{id}Deletes a secret.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes |
Response: no body (200)
curl -X DELETE "https://api.maitento.com/secrets/by-id/<id>" \ -H "Authorization: $MAITENTO_AUTH"await mt.secrets.delete("c0ffee00-1234-4abc-9def-0123456789ab");mt.secrets.delete("9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d")secrets.get
Section titled “secrets.get”GET /secrets/by-id/{id}The secret with this id. Throws NotFoundError when there is none.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes |
Response: Secret (200)
curl -X GET "https://api.maitento.com/secrets/by-id/<id>" \ -H "Authorization: $MAITENTO_AUTH"const secret = await mt.secrets.get("c0ffee00-1234-4abc-9def-0123456789ab");mt.secrets.get("9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d")secrets.update
Section titled “secrets.update”PUT /secrets/by-id/{id}Renames a secret and, when value is given, replaces its value.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes |
Request body: SecretUpdateRequest
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The secret’s name. |
value | string | null | A new value, kept exactly as sent. Null or omitted: the stored value is kept. |
Response: Secret (200)
curl -X PUT "https://api.maitento.com/secrets/by-id/<id>" \ -H "Authorization: $MAITENTO_AUTH" \ -H "Content-Type: application/json" \ -d '{"name":"..."}'await mt.secrets.update("c0ffee00-1234-4abc-9def-0123456789ab", { name: "orders-api-key", value: process.env.ORDERS_API_KEY_NEW! });mt.secrets.update("9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d", name="orders-api-key", value=os.environ["ORDERS_API_KEY"])secrets.getByName
Section titled “secrets.getByName”GET /secrets/by-name/{name}The secret with this name. Throws NotFoundError when there is none.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes |
Response: Secret (200)
curl -X GET "https://api.maitento.com/secrets/by-name/<name>" \ -H "Authorization: $MAITENTO_AUTH"const secret = await mt.secrets.getByName("orders-api-key");mt.secrets.get_by_name("orders-api-key")