# Invitations

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

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

## List a project's invitations

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

List the invitations to the project

Operation ID: `ListProjectInvitations`

### Path parameters

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

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `search` | string |  | Search term matched against the invitee email |
| `page` | integer |  | Page number |
| `limit` | integer |  | Page size (default 25, at most 100) |
| `sort` | string |  | Sort order |

### Responses

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

## Invite to a project

```http
POST https://api.pontive.com/v1/projects/{project_id}/invitations
```

Invite people to the project by email. Invitees who are not workspace members join the workspace too, with no role there.

Operation ID: `CreateProjectInvitations`

### Path parameters

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

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

Invite Project Members Request

### Responses

- `201` Created: InviteMembersResponse
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete a project invitation

```http
DELETE https://api.pontive.com/v1/projects/{project_id}/invitations/{invitation_id}
```

Withdraw one of the project's invitations: it is deleted, and its link stops working.

Operation ID: `DeleteProjectInvitation`

### Path parameters

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

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `notify_invitee` | boolean |  | Notify the invitee that the invitation was withdrawn |

### Responses

- `204` No Content
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Resend a project invitation

```http
POST https://api.pontive.com/v1/projects/{project_id}/invitations/{invitation_id}/resend
```

Send one of the project's outstanding invitations again

Operation ID: `ResendProjectInvitation`

### Path parameters

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

### Request body (`application/json`): ProjectInvitationRequest

Resend Project Invitation Request

### Responses

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

## List workspace invitations

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

Get a list of the workspace's invitations

Operation ID: `ListWorkspaceInvitations`

### Path parameters

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

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `search` | string |  | Search term matched against the invitee email |
| `page` | integer |  | Page number |
| `limit` | integer |  | Page size (default 25, at most 100) |
| `sort` | string |  | Sort order |

### Responses

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

## Invite members

```http
POST https://api.pontive.com/v1/workspaces/{workspace_id}/invitations
```

Invite people to the workspace by email

Operation ID: `CreateWorkspaceInvitations`

### Path parameters

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

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

Invite Members Request

### Responses

- `201` Created: InviteMembersResponse
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete an invitation

```http
DELETE https://api.pontive.com/v1/workspaces/{workspace_id}/invitations/{invitation_id}
```

Withdraw an invitation: it is deleted, and its link stops working. An invitation exists only while it is open — accepting one deletes it too, and an expired one is purged.

Operation ID: `DeleteWorkspaceInvitation`

### Path parameters

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

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `notify_invitee` | boolean |  | Notify the invitee that the invitation was withdrawn |

### Responses

- `204` No Content
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Resend an invitation

```http
POST https://api.pontive.com/v1/workspaces/{workspace_id}/invitations/{invitation_id}/resend
```

Send an outstanding invitation again

Operation ID: `ResendWorkspaceInvitation`

### Path parameters

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

### Request body (`application/json`): ResendInvitationRequest

Resend Invitation Request

### Responses

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

## Schemas

### ListInvitationsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Invitation[] |  | List of invitations |
| `object` | string |  | The object type |
| `pagination` | Pagination |  | Pagination information |

### ErrResponse

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

### InviteProjectMembersRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emails` | string[] |  | The email addresses to invite required: true |
| `message` | string |  | An optional message included in the invitation email |
| `roles` | string[] |  | The roles the invitees will hold on the project once they accept. They join the project's workspace too, with no role there. required: true enum: admin,developer,viewer |

### InviteMembersResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Invitation[] |  | The invitations sent: new ones, and live ones an address already held, reissued with this request's roles and a new link (resend_count > 0) |
| `object` | string |  | The object type |
| `skipped` | SkippedInvitee[] |  | The addresses that got no invitation, and why. Skipping is not an error: a request whose every address was skipped still succeeds. |

### ProjectInvitationRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string |  | An optional message replacing the original (resend) |

### GetInvitationResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string (date-time) |  | The time when the invitation was created |
| `expires_at` | string (date-time) |  | The time when the invitation expires |
| `id` | string |  | The unique identifier of the invitation |
| `invited_by` | string |  | The user who sent the invitation |
| `invitee_email` | string |  | The email address the invitation was sent to |
| `last_sent_at` | string (date-time) |  | The time when the invitation was last sent |
| `message` | string |  | The message included with the invitation |
| `object` | string |  | The object type |
| `project` | InvitationProject |  | For an invitation to a project, the project; absent on one to the workspace alone. |
| `project_roles` | string[] |  | For an invitation to a project, the roles the invitee will hold on it. The invitee joins the workspace too, with no role there unless Roles names one. enum: admin,developer,viewer |
| `resend_count` | integer |  | How many times the invitation has been resent |
| `roles` | string[] |  | The roles the invitee will hold on the workspace once they accept enum: admin,billing,developer |

### InviteMembersRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emails` | string[] |  | The email addresses to invite required: true |
| `message` | string |  | An optional message included in the invitation email |
| `roles` | string[] |  | The roles the invitees will hold once they accept. `owner` cannot be granted by invitation — ownership moves through transfer-ownership. enum: admin,billing,developer |

### ResendInvitationRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string |  | An optional message replacing the original |

### Invitation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string (date-time) |  | The time when the invitation was created |
| `expires_at` | string (date-time) |  | The time when the invitation expires |
| `id` | string |  | The unique identifier of the invitation |
| `invited_by` | string |  | The user who sent the invitation |
| `invitee_email` | string |  | The email address the invitation was sent to |
| `last_sent_at` | string (date-time) |  | The time when the invitation was last sent |
| `message` | string |  | The message included with the invitation |
| `object` | string |  | The object type |
| `project` | InvitationProject |  | For an invitation to a project, the project; absent on one to the workspace alone. |
| `project_roles` | string[] |  | For an invitation to a project, the roles the invitee will hold on it. The invitee joins the workspace too, with no role there unless Roles names one. enum: admin,developer,viewer |
| `resend_count` | integer |  | How many times the invitation has been resent |
| `roles` | string[] |  | The roles the invitee will hold on the workspace once they accept enum: admin,billing,developer |

### Pagination

Pagination information

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer |  | Number of records per page |
| `page` | integer |  | Current page number |
| `total` | integer |  | Total number of records |
| `total_pages` | integer |  | Total number of pages |

### 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. |

### SkippedInvitee

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string |  |  |
| `reason` | "already_member" |  | already_member: a member already. An invite does not change a member's roles. |

### InvitationProject

For an invitation to a project, the project; absent on one to the
workspace alone.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string |  | The ID of the project |
| `name` | string |  | The name of the project |
