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

# Decline organization invitation

Declines an invitation sent to the caller's verified email.

`POST https://api.akua.dev/v1/organizations/{id}/invitations/{invitationId}:decline`

## Authorizations

- `Authorization: Bearer <token>` (BearerAuth): Bearer token for the authenticated caller.

## Path Parameters

- `id` (string, required): Organization ID, `org_<id>`. Required string length: `3 - 54`.
- `invitationId` (string, required): Invitation ID, `orgi_<id>`. Required string length: `3 - 55`.

## Response

### 200: Invitation declined

`application/json`: `OrganizationInvitation`

- `id` (string, required): Invitation ID, `orgi_<id>`. Required string length: `3 - 55`.
- `organization_id` (string, required): Organization ID, `org_<id>`. Required string length: `3 - 54`.
- `email` (string<email>, required): Maximum string length: `254`. Pattern: `^[^\s@]+@[^\s@]+\.[^\s@]+$`. Example: `"ada@example.com"`.
- `role` (enum<string>, required): Only an owner may invite an owner. `roles/viewer` is granted through `:setIamPolicy`. Available options: `"roles/member"`, `"roles/admin"`, `"roles/owner"`.
- `state` (enum<string>, required): Available options: `"pending"`, `"accepted"`, `"declined"`, `"revoked"`, `"expired"`.
- `expire_at` (integer, required): When a pending invitation becomes `expired`. Required range: `0 <= x <= 9007199254740991`.
- `created_at` (integer, required): Unix timestamp (seconds). Required range: `0 <= x <= 9007199254740991`.
- `updated_at` (integer, required): Unix timestamp (seconds). Required range: `0 <= x <= 9007199254740991`.

### 401: Missing, invalid or expired credential.

`application/json`: `ApiUnauthorized`

- `_tag` (enum<string>, required): Available options: `"Unauthorized"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 403: The credential may not act in this workspace.

`application/json`: `ApiForbidden`

- `_tag` (enum<string>, required): Available options: `"Forbidden"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 404: The resource was not found in this workspace.

`application/json`: `ApiNotFound`

- `_tag` (enum<string>, required): Available options: `"NotFound"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 409: The request conflicts with existing resource state or immutable intent.

`application/json`: `ApiConflict`

- `_tag` (enum<string>, required): Available options: `"Conflict"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 503: The service is temporarily unavailable.

`application/json`: `ApiServiceUnavailable`

- `_tag` (enum<string>, required): Available options: `"ServiceUnavailable"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

## Example request

```bash
curl --request POST \
  --url 'https://api.akua.dev/v1/organizations/org_j572abc123def456/invitations/orgi_j572abc123def456:decline' \
  --header 'Authorization: Bearer <token>'
```

## Example response

`200` `application/json`

```json
{
  "id": "orgi_j572abc123def456",
  "organization_id": "org_j572abc123def456",
  "email": "ada@example.com",
  "role": "roles/member",
  "state": "pending",
  "expire_at": 123,
  "created_at": 123,
  "updated_at": 123
}
```
