# Resolve environment access request

`POST /v1/projects/{project}/environments/{environment}/accessRequests/{request}`, operation `environments.ResolveEnvironmentAccessRequest`

Approves or denies a pending access request on a standalone environment.

Requires environments.environments.update on the environment, plus issue or access permission on the target when approving. Enforces environments.maxGrantTtl and flushes the environment's credential cache immediately when approved.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `environment` | path | Yes | `string` | The environment's ID. |
| `request` | path | Yes | `string (uuid)` | The access request's ID. |

## Request body

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `approve` | `boolean` | Yes | Whether to approve the request. |
| `expireTime` | `string (date-time)` | No | Optional grant expiry time, bounded by the environments.maxGrantTtl policy. |
| `note` | `string` | No | Optional note returned to the environment. |
| `scope` | `map<string, object>` | No | Optional narrowing scope for an access profile grant. |
| `target` | `string` | No | Required when approving: resource name of the project access profile or secret to grant. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createTime` | `string (date-time)` | Yes | When the request was created. |
| `environment` | `string` | Yes | The environment's resource name. |
| `expireTime` | `string (date-time)` | Yes | When a pending request expires if unresolved. |
| `grantId` | `string` | No | ID of the grant created or updated when approved. |
| `id` | `string` | Yes | The access request's ID. |
| `note` | `string` | No | Optional note from the person who resolved the request. |
| `reason` | `string` | Yes | Why the process inside the environment asked for access. |
| `requestedProvider` | `string` | No | Optional provider requested by the environment, such as providers/github. |
| `requestedScope` | `map<string, object>` | No | Optional narrowing scope requested by the environment. |
| `requestedTarget` | `string` | No | Optional alias, ID or resource name requested by the environment. |
| `resolveTime` | `string (date-time)` | No | When the request was approved or denied. |
| `resolvedAlias` | `string` | No | Alias of the access profile or secret granted when approved. |
| `resolvedExpireTime` | `string (date-time)` | No | Grant expiry time set when approved. |
| `resolvedProvider` | `string` | No | Provider of the access profile granted when approved. |
| `resolvedScope` | `map<string, object>` | No | Effective narrowing scope granted when approved. |
| `resolvedTarget` | `string` | No | Resource name of the access profile or secret granted when approved. |
| `resolver` | `string` | No | Who approved or denied the request. |
| `state` | `string` | Yes | Current state of the request. Values: `PENDING`, `APPROVED`, `DENIED`, `EXPIRED`. |
| `targetKind` | `string` | No | Optional target kind requested by the environment. Values: "", `ACCESS_PROFILE`, `SECRET`. |

### 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.