# Me

Source: https://www.pontive.com/docs/api-reference/management/me

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

Authentication: send `Authorization: Bearer <token>` with a secret key (`pontive_sk_…`, which implies its instance) or an access token issued for this API. A token that can reach several instances also names one with `X-Pontive-Instance-ID: inst_…`. Secret keys are for servers only.

## Get current user

```http
GET https://{auth_domain}/v1/me
```

Get the currently authenticated user's profile An instance user's token must be issued for the instance's me audience, https://{auth domain}/me/, with pontive:me:read; the app's own access token is refused 403 (D48).

Operation ID: `GetCurrentUser`

### Responses

- `200` OK: CurrentUser
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## Update current user

```http
PATCH https://{auth_domain}/v1/me
```

Update the currently authenticated user's profile (partial update) An instance user's token must be issued for the instance's me audience, https://{auth domain}/me/, with pontive:me:manage; the app's own access token is refused 403 (D48).

Operation ID: `UpdateCurrentUser`

### Request body (`application/json`, required): UpdateCurrentUserRequest

Update User Request

### Responses

- `200` OK: CurrentUser
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete current user

```http
DELETE https://{auth_domain}/v1/me
```

Delete the currently authenticated user An instance user's token must be issued for the instance's me audience, https://{auth domain}/me/, with pontive:me:manage; the app's own access token is refused 403 (D48).

Operation ID: `DeleteCurrentUser`

### Responses

- `204` User deleted successfully
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## List my delegations

```http
GET https://{auth_domain}/v1/me/delegations
```

The signed-in user's own delegation grants (D31): which agents they let act for them, in which organization, with which scopes and until when. Filter by agent_id or organization_id. Needs no permission: identity-svc answers a user for their own grants. An instance user's token must be issued for the instance's me audience, https://{auth domain}/me/, with pontive:me:read; the app's own access token is refused 403 (D48).

Operation ID: `ListMyDelegations`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  | The agent delegated to (agt_) |
| `organization_id` | string |  | The organization the grant is bounded to |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListDelegationsResponse
- `401` Unauthorized: ErrResponse
- `500` Internal Server Error: ErrResponse

## Revoke my delegation

```http
DELETE https://{auth_domain}/v1/me/delegations/{delegation_id}
```

The signed-in user revokes one of their own delegation grants (D31): the agent's next exchange on it is refused, and a token it already exchanged stops being answered on Pontive's checks and listings at once. Another user's grant is 404, the same as none. A token acting for the user (an agent's) is refused (actor_refused): a delegation is the user's own to take back. An instance user's token must be issued for the instance's me audience, https://{auth domain}/me/, with pontive:me:manage; the app's own access token is refused 403 (D48).

Operation ID: `DeleteMyDelegation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `delegation_id` | string | yes | Delegation ID (dlg_) |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` actor_refused: a token acting for the user cannot revoke: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List my memberships

```http
GET https://{auth_domain}/v1/me/memberships
```

The signed-in user's own memberships across every container kind — the instance root, organizations and resources (D4, D31) — each left with POST /me/memberships/{container_id}/leave. resource_type narrows them to one kind of container (root, org or a custom type key, D44). Each carries its container's name and, when the caller may read the container, its external_id. An instance user's token must be issued for the instance's me audience, https://{auth domain}/me/, with pontive:me:read; the app's own access token is refused 403 (D48).

Operation ID: `ListMyMemberships`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_type` | string |  | Only the memberships on containers of this type: root, org or a custom type key (D44) |
| `organization_id` | string |  | Only the memberships on this organization's resources, at any depth |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListUserMembershipsResponse
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## Leave a membership

```http
POST https://{auth_domain}/v1/me/memberships/{container_id}/leave
```

Remove the current (authenticated) user's own membership of a container (api-route-review D38): the prefixed id names it — an organization (org_), or a resource (res_) whose type lets members leave. Refused 403 leave_disabled when the organization's settings or the resource's type do not let members leave. An instance user's token must be issued for the instance's me audience, https://{auth domain}/me/, with pontive:me:manage; the app's own access token is refused 403 (D48).

Operation ID: `LeaveMembership`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `container_id` | string | yes | The organization (org_) or resource (res_) left |

### Responses

- `200` LeaveOrganizationResponse or LeaveResourceResponse: object
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse

## Schemas

### CurrentUser

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `address` | Address |  |  |
| `birthdate` | string |  |  |
| `created_at` | string |  |  |
| `email` | string |  |  |
| `email_verified` | boolean |  |  |
| `external_id` | string |  | ExternalID is your own id for this user, unique per project environment; the access-token claims template reads it as user.external_id. |
| `family_name` | string |  |  |
| `gender` | string |  |  |
| `given_name` | string |  |  |
| `id` | string |  |  |
| `instance_id` | string |  |  |
| `legacy_identities` | LegacyIdentity[] |  | LegacyIdentities are the user's ids in the systems they were imported from. Read-only. |
| `locale` | string |  |  |
| `metadata` | Metadata |  |  |
| `middle_name` | string |  |  |
| `name` | string |  |  |
| `nickname` | string |  |  |
| `object` | string |  |  |
| `password_change_required` | boolean |  |  |
| `password_status` | "none" \| "active" \| "imported" |  | PasswordStatus is none, active (a password set in Pontive) or imported (a hash imported from another system, replaced at the user's first sign-in; pontive-spec 46 §4.6). Read-only. |
| `phone` | string |  |  |
| `phone_verified` | boolean |  |  |
| `picture` | string |  |  |
| `private_metadata` | Metadata |  |  |
| `profile` | string |  |  |
| `status` | "active" \| "deleted" \| "deactivated" |  |  |
| `updated_at` | string |  |  |
| `username` | string |  |  |
| `website` | string |  |  |
| `zoneinfo` | string |  |  |

### ErrResponse

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

### UpdateCurrentUserRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `family_name` | string |  |  |
| `given_name` | string |  |  |
| `metadata` | Record<string, string> |  |  |
| `name` | string |  |  |
| `picture` | string |  |  |

### ListDelegationsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Delegation[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### ListUserMembershipsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | UserMembership[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### Address

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `country` | string |  |  |
| `formatted` | string |  |  |
| `locality` | string |  |  |
| `postal_code` | string |  |  |
| `region` | string |  |  |
| `street_address` | string |  |  |

### LegacyIdentity

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string |  |  |
| `migration_source_id` | string |  |  |
| `subject` | string |  |  |

### Metadata

Type: Record<string, string>

### ErrBody

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string |  | Code is the spec's machine-readable code for this error, in snake case: a domain code such as seat_limit_reached where the refusal has one, otherwise a generic one such as permission_denied, not_found, conflict, invalid_request or service_unavailable. |
| `details` | ErrDetail[] |  | Details are per-field findings, present only on a refusal that has them, e.g. a 422 invalid_theme names each invalid value by its path, a 422 package_invalid each problem, and a 409 capability_in_use each count by its name. |
| `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` | "validation_error" \| "authentication_error" \| "authorization_error" \| "not_found" \| "conflict_error" \| "rate_limit_error" \| "internal_error" |  | Type is the error's category, set by its HTTP status: one of validation_error, authentication_error, authorization_error, not_found, conflict_error, rate_limit_error, internal_error. |

### Delegation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  |  |
| `created_at` | string |  |  |
| `created_by` | Actor |  | CreatedBy is who created the grant, or last replaced it. |
| `expires_at` | string |  |  |
| `id` | string |  |  |
| `instance_id` | string |  |  |
| `last_used_at` | string |  |  |
| `object` | string |  |  |
| `organization_id` | string |  | OrganizationID is the organization the agent may act for the user in; empty for the instance root. |
| `scopes` | string[] |  |  |
| `updated_at` | string |  |  |
| `user_id` | string |  | UserID is the delegator. |

### Pagination

Pagination is the page answered (api-route-review D9).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer |  | Limit is the maximum number of items per page. |
| `page` | integer |  | Page is the 1-based index of the returned page. |
| `total` | integer |  | Total is the total number of items across all pages. |
| `total_pages` | integer |  | TotalPages is the total number of pages available. |

### UserMembership

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string |  |  |
| `instance_id` | string |  |  |
| `joined_at` | string |  |  |
| `last_active_at` | string |  |  |
| `object` | string |  |  |
| `resource_external_id` | string |  | ResourceExternalID is the container's external_id, the caller's own id for the organization or resource, when it has one. |
| `resource_id` | string |  |  |
| `resource_name` | string |  |  |
| `resource_type` | string |  |  |
| `roles` | RoleRef[] |  |  |
| `updated_at` | string |  |  |
| `user_id` | string |  |  |

### ErrDetail

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `field` | string |  | Field is where the finding is: for a theme, its dotted path. |
| `message` | string |  | Message is what is wrong there. |

### Actor

CreatedBy is who created the grant, or last replaced it.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string |  |  |
| `name` | string |  |  |
| `type` | string |  |  |

### RoleRef

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string |  |  |
| `name` | string |  |  |
