# Grant environment access

`POST /v1/projects/{project}/environments/{environment}/grants`, operation `environments.GrantEnvironmentAccess`

Grants or updates access profiles (with optional narrowing scope and expiry) and secrets on a standalone environment.

Requires environments.environments.update on the environment plus issue or access permission on each target. Owned environments (such as agent environments) manage grants through their owner.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `environment` | path | Yes | `string` | The environment's ID. |

## Request body

Content-Type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `grants` | `NewEnvironmentGrant[]` | Yes | Access profiles or secrets to grant or update on the environment. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `grants` | `EnvironmentGrant[]` | Yes | Grants assigned to the environment, oldest first. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.