---
title: "Set the managed key access level"
method: PUT
path: "/_api/key/{keyid}/database/{geofabric}/managedkey/{managed-key-name}"
tags: ["API Keys"]
---

# Set the managed key access level

`PUT /_api/key/{keyid}/database/{geofabric}/managedkey/{managed-key-name}`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_api/key/:keyid/database/:geofabric/managedkey/:managed-key-name/put.ts> (a function with typed inputs; its response is checked against the schema)

Sets the access level for the *managed key name* in the GeoFabric *geofabric* for an API key with *keyid*.

Requires a JSON object with these properties:

  - **grant**: Use "rw" to set the managed key level access to *Read/Write*. Use "ro" to set the managed key level access to  *Read Only*. Use "none" to set the managed key worker level access to *No access*.

 - **managed keyr**: Use "&#42;" to set default access level for all managed keys.

If access level for the managed key is not set, then the default("&#42;") access level is used. If the default("&#42;") access level is also not set, then the GeoFabric access level is used.

**Note**: Requires *administrator* permissions.

## Path parameters

- `keyid` string, string, required
- `geofabric` string, string, required
- `managed-key-name` string, string, required

## Request body

- UserGrantManagedkey
  - `grant` string, required: - Use "rw" to set the managed key level access to *Read/Write*. - Use "ro" to set the managed key level access to *Read Only*. - Use "none" to set the managed key level access to *No access*.

## Response `200`

Successfully changed access permissions.

- unknown

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed to validate because you do not have access to the GeoFabric.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find specified GeoFabric, API key, or managed key.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
