---
title: "GrantProjectAccess"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: EZGH Cloud organizations and IAM › projects

`POST /v1/organizations/{orgId}/projects/{projectId}/access`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `GrantProjectAccess.path.orgId` (string, required) — The organization's UUID or prefixed ID (org_…).
- `GrantProjectAccess.path.projectId` (string, required) — The project's UUID or prefixed ID (prj_…).

## Header parameters

- `GrantProjectAccess.header.idempotency-key` (string, optional)

## Request body

_Required._

- `GrantProjectAccess.access` (array<object>, required)
  - `GrantProjectAccess.access.principal` (object, required)
    - `GrantProjectAccess.access.principal.type` (string, required)
      - one of `"user"`, `"bot"`, `"group"`, `"ssoUser"`, `"ssoGroup"`
    - `GrantProjectAccess.access.principal.id` (string, required)
      - minLength 1; maxLength 1024
  - `GrantProjectAccess.access.level` (string, required)
    - one of `"full"`, `"readOnly"`

## Example request

```json
{
  "access": [
    {
      "principal": {
        "type": "user",
        "id": "string"
      },
      "level": "full"
    }
  ]
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://orgs.ezghcloud.com/v1/organizations/string/projects/string/access \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "access": [
    {
      "principal": {
        "type": "user",
        "id": "string"
      },
      "level": "full"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://orgs.ezghcloud.com/v1/organizations/string/projects/string/access';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({access: [{principal: {type: 'user', id: 'string'}, level: 'full'}]})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://orgs.ezghcloud.com/v1/organizations/string/projects/string/access"

payload = { "access": [
        {
            "principal": {
                "type": "user",
                "id": "string"
            },
            "level": "full"
        }
    ] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Success

#### Example

```json
{
  "policies": [
    {
      "id": "string",
      "type": "managed",
      "name": "string",
      "slug": "string",
      "resourceName": "string",
      "description": "string",
      "document": {
        "statements": [
          {
            "sid": "string",
            "effect": "allow",
            "actions": [
              "string"
            ],
            "resources": [
              "string"
            ]
          }
        ]
      },
      "status": "active",
      "attachments": 0,
      "managedBy": "string",
      "projectId": "string",
      "projectAccess": "full",
      "createdAt": "string",
      "updatedAt": "string"
    }
  ]
}
```

- `GrantProjectAccess.response.200.policies` (array<object>, required)
  - `GrantProjectAccess.response.200.policies.id` (string, required)
  - `GrantProjectAccess.response.200.policies.type` (string, required)
    - one of `"managed"`, `"custom"`
  - `GrantProjectAccess.response.200.policies.name` (string, required)
  - `GrantProjectAccess.response.200.policies.slug` (any of, required)
    - any of: `string`, `null`
  - `GrantProjectAccess.response.200.policies.resourceName` (any of, required)
    - any of: `string`, `null`
  - `GrantProjectAccess.response.200.policies.description` (string, required)
  - `GrantProjectAccess.response.200.policies.document` (object, required)
    - `GrantProjectAccess.response.200.policies.document.statements` (array<object>, required)
      - `GrantProjectAccess.response.200.policies.document.statements.effect` (string, required)
        - one of `"allow"`, `"deny"`
      - `GrantProjectAccess.response.200.policies.document.statements.actions` (array<string>, required)
      - `GrantProjectAccess.response.200.policies.document.statements.resources` (array<string>, required)
      - `GrantProjectAccess.response.200.policies.document.statements.sid` (string, optional)
  - `GrantProjectAccess.response.200.policies.status` (string, required)
    - one of `"active"`, `"deprecated"`
  - `GrantProjectAccess.response.200.policies.attachments` (any of, required)
    - any of: `number`, `string`
  - `GrantProjectAccess.response.200.policies.managedBy` (any of, required)
    - any of: `string`, `null`
  - `GrantProjectAccess.response.200.policies.projectId` (any of, required)
    - any of: `string`, `null`
  - `GrantProjectAccess.response.200.policies.projectAccess` (any of, required)
    - any of: `string`, `null`
  - `GrantProjectAccess.response.200.policies.createdAt` (any of, required)
    - any of: `string`, `null`
  - `GrantProjectAccess.response.200.policies.updatedAt` (any of, required)
    - any of: `string`, `null`

### 400

InvalidRequest

#### Example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GrantProjectAccess.response.400.error` (object, required)
  - `GrantProjectAccess.response.400.error.code` (string, required)
    - one of `"invalid_request"`
  - `GrantProjectAccess.response.400.error.message` (string, required)
  - `GrantProjectAccess.response.400.error.issues` (array<object>, optional)
    - `GrantProjectAccess.response.400.error.issues.path` (string, required)
    - `GrantProjectAccess.response.400.error.issues.message` (string, required)

### 401

Unauthenticated

#### Example

```json
{
  "error": {
    "code": "unauthenticated",
    "message": "string"
  }
}
```

- `GrantProjectAccess.response.401.error` (object, required)
  - `GrantProjectAccess.response.401.error.code` (string, required)
    - one of `"unauthenticated"`
  - `GrantProjectAccess.response.401.error.message` (string, required)

### 403

Forbidden | AccessDenied | BoundaryViolation | ForbiddenOrigin

#### Example

```json
{
  "error": {
    "code": "forbidden",
    "message": "string"
  }
}
```

Any of:

- [ForbiddenEncoded](/orgs-api/schemas/ForbiddenEncoded/)
- [AccessDeniedEncoded](/orgs-api/schemas/AccessDeniedEncoded/)
- [BoundaryViolationEncoded](/orgs-api/schemas/BoundaryViolationEncoded/)
- [ForbiddenOriginEncoded](/orgs-api/schemas/ForbiddenOriginEncoded/)

### 404

NotFound

#### Example

```json
{
  "error": {
    "code": "not_found",
    "message": "string"
  }
}
```

- `GrantProjectAccess.response.404.error` (object, required)
  - `GrantProjectAccess.response.404.error.code` (string, required)
    - one of `"not_found"`
  - `GrantProjectAccess.response.404.error.message` (string, required)

### 409

IdempotencyConflict | IdempotencyInProgress

#### Example

```json
{
  "error": {
    "code": "idempotency_conflict",
    "message": "string"
  }
}
```

Any of:

- [IdempotencyConflictEncoded](/orgs-api/schemas/IdempotencyConflictEncoded/)
- [IdempotencyInProgressEncoded](/orgs-api/schemas/IdempotencyInProgressEncoded/)

### 429

TooManyRequests

#### Example

```json
{
  "error": {
    "code": "too_many_requests",
    "message": "string"
  }
}
```

- `GrantProjectAccess.response.429.error` (object, required)
  - `GrantProjectAccess.response.429.error.code` (string, required)
    - one of `"too_many_requests"`
  - `GrantProjectAccess.response.429.error.message` (string, required)

### 500

InternalError

#### Example

```json
{
  "error": {
    "code": "internal_error",
    "message": "string"
  }
}
```

- `GrantProjectAccess.response.500.error` (object, required)
  - `GrantProjectAccess.response.500.error.code` (string, required)
    - one of `"internal_error"`
  - `GrantProjectAccess.response.500.error.message` (string, required)

### 503

Unavailable

#### Example

```json
{
  "error": {
    "code": "unavailable",
    "message": "string"
  }
}
```

- `GrantProjectAccess.response.503.error` (object, required)
  - `GrantProjectAccess.response.503.error.code` (string, required)
    - one of `"unavailable"`
  - `GrantProjectAccess.response.503.error.message` (string, required)


Source: https://docs.ezghcloud.com/orgs-api/projects/GrantProjectAccess/index.md
