> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cocoondata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# <access-service>/api/v1/objects/{objectId}/keys

## URL structure&#x20;

```text theme={null}
https://access-service.xy-company.com/api/v1/objects/{objectId}/keys
```

where `{objectId}` is the ID of a file object/Secure Object.

## Supported methods and overview&#x20;

* `GET` - retrieves the cryptographic key required to decrypt the active version of a file object/[Secure Object](/3.5/api/working-with-files-and-folders-fundamentals.md#secure-object) (specified by `objectId`).

> [!NOTE]
>
> This method takes no parameters.

## Detailed description&#x20;

This API endpoint retrieves the cryptographic key required to decrypt the active version of a file object, using the file object's ID.

This key is generated by:

1. Calling the [\<access-service>/api/v1/keys](/3.5/api/access-service-api-v1-keys.md) endpoint to obtain a cryptographic key and then
2. Associating this key with a new *Incomplete* or completed file object (by subsequently calling the [\<access-service>/api/v1/organisations/\{orgGroupId}/objects](/3.5/api/access-service-api-v1-organisations-orggroupid-objects.md) endpoint).

A file object's ID can be obtained by calling the [\<access-service>/api/v1/organisations/\{orgId}/items](/3.5/api/access-service-api-v1-organisations-orgid-items.md) API endpoint, which retrieves a list of information associated with file objects that can be filtered using various 'search' criteria.

## Supported roles and conditions&#x20;

This API endpoint supports the following Covata user [roles](/3.5/admin-org/administering-users-within-an-organisation.md#an-organisation-users-roles) (as described in the [Organisation Administrator's Guide](/3.5/admin-org.md)), conditions and [permissions](/3.5/api/access-service-api-v1-permissions-sets.md) (where applicable):

* [Originator](/3.5/admin-org/administering-users-within-an-organisation.md#originator-role) - when this user owns the file object whose ID is specified by `{objectId}` in the request's URL.
* **Originator**, [Collaborator](/3.5/admin-org/administering-users-within-an-organisation.md#collaborator-role) and [Ad hoc](/3.5/admin-org/administering-users-within-an-organisation.md#adhoc-role) - when this user is a collaborator with the **Download** [permission](/3.5/api/access-service-api-v1-permissions-sets.md) on the file object whose ID is specified by `{objectId}` in the URL.

The Covata Platform's resources available to a Covata user meeting the criteria above is determined by the access token submitted in the [header](/3.5/api/access-service-api-v1-objects-objectid-keys.md#access-service-api-v1-objects-objectid-keys-required-headers) of requests to this endpoint.

## Required headers&#x20;

The appropriate access token as the `Bearer` token:

* `Authorisation: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...`

## Returns&#x20;

If the request succeeded, then an HTTP response status `200 OK` is returned.

For successful requests only, a JSON-formatted response containing the following members is also returned:

* **keyValue** - The cryptographic key value itself.
* **cryptographicAlgorithm** - The cryptographic algorithm supported by the Covata Platform. This should be `AES`.
* **keyLength** - The bit length of the cryptographic key value returned above.
* **initializationVector** - The initialization vector required to begin local/client-side decryption using the AES algorithm (in CBC mode). \

  **Example:**

  ```json theme={null}
  {
      "keyValue": "2VCZkPeYPhvL4VkzrEqIVGaW2AGmRM1uwuXiPRbe8NU=",
      "cryptographicAlgorithm": "AES",
      "keyLength": 256,
      "initializationVector": "fpEIYIk+dnMw7rgFA+Bz8g=="
  }
  ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.