# Access

Source: https://www.pontive.com/docs/api-reference/platform/access

Base URL: `https://api.pontive.com/v1` (operations that name another server say so).

## The caller's access to an instance

```http
GET https://api.pontive.com/v1/instances/{instance_id}/access
```

The platform permissions the caller holds on the instance, and the roles they hold on it directly

Operation ID: `GetInstanceAccess`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Responses

- `200` OK: GetAccessResponse
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## The caller's access to a project

```http
GET https://api.pontive.com/v1/projects/{project_id}/access
```

The platform permissions the caller holds on the project, and the roles they hold on it directly

Operation ID: `GetProjectAccess`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | string | yes | Project ID |

### Responses

- `200` OK: GetAccessResponse
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## The caller's access to a workspace

```http
GET https://api.pontive.com/v1/workspaces/{workspace_id}/access
```

The platform permissions the caller holds on the workspace, and the roles they hold on it directly

Operation ID: `GetWorkspaceAccess`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

### Responses

- `200` OK: GetAccessResponse
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Schemas

### GetAccessResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `managed_projects` | string[] |  | On a workspace, for a caller who does not manage its members: the ids of its projects whose members they manage (project:members.manage), directly or by inheritance. Absent for whoever manages the workspace's members, who manages every project's. |
| `object` | string |  | The object type |
| `permissions` | string[] |  | The platform permission keys the caller holds, through any role — held on the object or inherited from above it |
| `roles` | string[] |  | The roles the caller holds on the object itself; empty for someone reaching it by inheritance alone |
| `staff_role` | string |  | The staff role the caller reaches it with, if any enum: pontive_support,pontive_admin,pontive_release |

### ErrResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | ErrBody |  |  |

### ErrBody

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string |  | Code is a stable machine-readable identifier for this error: the domain code where one exists (e.g. slug_conflict, instance_not_found, confirmation_required), else the spec's generic code (invalid_request, permission_denied, not_found, conflict, internal_error). |
| `doc_url` | string |  | DocURL links to documentation about this error, when available. |
| `message` | string |  | Message is a human-readable description of what went wrong. |
| `object` | string |  | Object is the discriminator; always "error". |
| `param` | string |  | Param names the request parameter this error refers to, when applicable. |
| `type` | string |  | Type is the error's category, from its HTTP status: validation_error, authentication_error, authorization_error, not_found, conflict_error, rate_limit_error or internal_error. |
