---
title: "POST /resources/{resource_id}/non-human-identities/{non_human_identity_id}"
method: POST
path: "/resources/{resource_id}/non-human-identities/{non_human_identity_id}"
tags: ["resources"]
---

# POST /resources/{resource_id}/non-human-identities/{non_human_identity_id}

`POST /resources/{resource_id}/non-human-identities/{non_human_identity_id}`

## Request

- Base URL: `https://api.opal.dev/v1`
- URL: `https://api.opal.dev/v1/resources/{resource_id}/non-human-identities/{non_human_identity_id}`
- Auth: HTTP bearer

Gives a non-human identity access to this resource.

## Path parameters

- `resource_id` string, uuid, required
- `non_human_identity_id` string, uuid, required

## Request body

- object
  - `duration_minutes` integer, required: The duration for which the resource can be accessed (in minutes). Use 0 to set to indefinite.
  - `access_level_remote_id` string: The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used.

## Response `200`

Details about the access that the non-human identity was granted to the resource.

- ResourceNHI: # Resource Non-Human Identity Direct Access Object ### Description This object is used to represent a non-human identity with direct access to a resource.
  - `resource_id` string, uuid, required: The ID of the resource.
  - `non_human_identity_id` string, uuid, required: The resource ID of the non-human identity.
  - `access_level` ResourceAccessLevel: # Access Level Object ### Description The `AccessLevel` object is used to represent the level of access that a principal has. The "default" access level is a `AccessLevel` object whose fields are all empty strings. ### Usage Example View the `AccessLevel` of a resource/user or resource/group pair to see the level of access granted to the resource.
    - `access_level_name` string, required: The human-readable name of the access level.
    - `access_level_remote_id` string, required: The machine-readable identifier of the access level.
  - `expiration_date` string, date-time, nullable: The day and time the non-human identity's access will expire.

## Changes

- **2026-09-04** `c7469ef15aa4`: 1 info
  - the `duration_minutes` request property's max was increased from `525960.00` to `153722867.00`

[Operation history](https://skmtc.dev/opal/apis/opal-api/changes/resources/:resource_id/non-human-identities/:non_human_identity_id/post.md)

---

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