> ## 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/view

## URL structure&#x20;

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

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 *read-only view* of the active version of a file object/[Secure Object](/3.4/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 *read-only view* of the active version of a file object (specified by `objectId`).

This key is automatically generated after uploading a file object's data to storage (via the [\<content-service>/api/v1/objects/\{objectId}/contents](/3.4/api/content-service-api-v1-objects-objectid-contents.md) API endpoint) *and* both of the following criteria have been met:

* The file object's file name (i.e. its **name** value) contains an [extension](/3.4/user/accessing-secure-content.md#file-formats-supported-by-the-content-viewer) which is supported by the Safe Share [content viewer](/3.4/user/accessing-secure-content.md#content-viewer).
* The size of the file in its unencrypted form (i.e. its **contentSize** value) is less than the default of 20,000,000 bytes.

A file object's ID can be obtained by calling the [\<access-service>/api/v1/organisations/\{orgId}/items](/3.4/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 requests utilizing Covata user accounts with the following [roles](/3.4/admin-org/administering-users-within-an-organisation.md#an-organisation-users-roles) (as described in the [Organization Administrator's Guide](/3.4/admin-org.md)) and conditions:

* [Originator](/3.4/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.4/admin-org/administering-users-within-an-organisation.md#collaborator-role) and [Ad hoc](/3.4/admin-org/administering-users-within-an-organisation.md#adhoc-role) - when this user is a collaborator with the **View** [permission](/3.4/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.4/api/access-service-api-v1-objects-objectid-keys-view.md#access-service-api-v1-objects-objectid-keys-view-required-headers) of requests to this endpoint.

## Required headers&#x20;

The appropriate access token as the `Bearer` token:

* `Authorization: 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 encryption 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.