# Grant

Source: <https://everruns.com/docs/api/operations/grant/>

[Docs](https://everruns.com/docs/)/[API reference](https://everruns.com/docs/api/)/[Identity & access](https://everruns.com/docs/api/groups/identity-access/)/Grant

# Grant

Preview

Manage organizations, members, end users, invitations and connected identities.

Public APIEverruns Cloud and self-hosted Platform

POST`/v1/resources/{id}/grants`

See [authentication](https://everruns.com/docs/sre/runbooks/authentication/) for credentials and permissions.

## Parameters

### Path Parameters

**id**

required

string format: uuid

Resource ID

## Request Bodyrequired

Media typeapplication/json

Explicit bounded use grant. It does not confer management permission or permission to reshare.

object

**constraints**

One of:

* object

  One of:

  * object

    object

    **permissions**

    required

    object

    **_key_**

    additional properties

    string

    **provider**

    required

    string

    Allowed values: github

    **repositories**

    required

    Array\<string>

* null

  object

  **permissions**

  required

  object

  **_key_**

  additional properties

  string

  **provider**

  required

  string

  Allowed values: github

  **repositories**

  required

  Array\<string>

* object

  null

**consumer_id**

Consumer agent, session, or virtual-user ID; omit for organization scope.

string | null

**consumer_scope**

required

Consumer scope; organization grants explicitly opt eligible service agents in.

string

Allowed values: session agent virtual_user organization

**expires_at**

Absolute grant expiry in UTC; omit for a grant that lasts until revoked.

string | null format: date-time

**usage**

required

Invocation identity that must match at every use.

string

Allowed values: user service

## Responses

201Access granted

### 201

Access granted

Media typeapplication/json

Identifier of the newly declared binding or explicit access grant.

object

**id**

required

Stable identifier used by subsequent metadata and management requests.

string format: uuid

### Example generated

```json
{
  "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
```

FetchcURL

Request

```js
const url = 'https://app.everruns.com/api/v1/resources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/grants';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"constraints":{"permissions":{"additionalProperty":"example"},"provider":"github","repositories":["example"]},"consumer_id":"example","consumer_scope":"session","expires_at":"2026-04-15T12:00:00Z","usage":"user"}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

Request

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/resources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/grants \
  --header 'Content-Type: application/json' \
  --data '{ "constraints": { "permissions": { "additionalProperty": "example" }, "provider": "github", "repositories": [ "example" ] }, "consumer_id": "example", "consumer_scope": "session", "expires_at": "2026-04-15T12:00:00Z", "usage": "user" }'
```

Additional language examples require JavaScript. The default request example is available above.

201

201 · Access granted

```json
{
  "id": "string"
}
```

## Matching endpoints