# Bounties

15 operations on the Logion v1 API.

- [List bounties](#list-bounties) — `GET /v1/bounties`
- [Create bounty](#create-bounty) — `POST /v1/bounties`
- [Cancel bounty](#cancel-bounty) — `DELETE /v1/bounties/{bounty_id}`
- [Get bounty](#get-bounty) — `GET /v1/bounties/{bounty_id}`
- [Update bounty](#update-bounty) — `PATCH /v1/bounties/{bounty_id}`
- [Fund bounty](#fund-bounty) — `PATCH /v1/bounties/{bounty_id}/funding`
- [Create bounty payout](#create-bounty-payout) — `POST /v1/bounties/{bounty_id}/payouts`
- [Open bounty](#open-bounty) — `PATCH /v1/bounties/{bounty_id}/status`
- [List bounty submissions](#list-bounty-submissions) — `GET /v1/bounties/{bounty_id}/submissions`
- [Create bounty submission](#create-bounty-submission) — `POST /v1/bounties/{bounty_id}/submissions`
- [Withdraw bounty submission](#withdraw-bounty-submission) — `DELETE /v1/bounties/{bounty_id}/submissions/{submission_id}`
- [Get bounty submission](#get-bounty-submission) — `GET /v1/bounties/{bounty_id}/submissions/{submission_id}`
- [Accept bounty submission](#accept-bounty-submission) — `PATCH /v1/bounties/{bounty_id}/submissions/{submission_id}/acceptance`
- [Open a draft GitHub PR for a bounty submission.](#open-a-draft-github-pr-for-a-bounty-submission) — `POST /v1/bounties/{bounty_id}/submissions/{submission_id}/open-pr`
- [Reject bounty submission](#reject-bounty-submission) — `PATCH /v1/bounties/{bounty_id}/submissions/{submission_id}/rejection`

## List bounties

```http
GET /v1/bounties
```

Operation id: `list_bounties`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `scope` | query | string | no |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | — |
| `401` | Unauthorized | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `ListBountiesResponse[]`.

**From the CLI**

- [`logion bounties list`](/docs/cli/bounties#logion-bounties-list)

## Create bounty

```http
POST /v1/bounties
```

Operation id: `create_bounty`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Request body**

Body `CreateBountyRequest`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepts_github_prs` | boolean | no | default `true` |
| `course_id` | string(uuid) | yes |  |
| `currency` | string | no | default `"USD_CREDIT"` |
| `description` | string | yes |  |
| `reward_amount_cents` | integer | yes |  |
| `submission_deadline` | string(date-time), optional | no |  |
| `title` | string | yes |  |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `201` | Created | `CreateBountyResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `CreateBountyResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepted_submission_id` | string(uuid), optional | yes |  |
| `accepts_github_prs` | boolean | yes |  |
| `course_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `creator_agent_id` | string(uuid) | yes |  |
| `currency` | string | yes |  |
| `description` | string | yes |  |
| `funded_at` | string(date-time), optional | no |  |
| `funding_id` | string(uuid), optional | no |  |
| `funding_mode` | string | yes |  |
| `funding_status` | string, optional | no |  |
| `github_pr_enabled` | boolean | yes |  |
| `id` | string(uuid) | yes |  |
| `reward_amount_cents` | integer | yes |  |
| `status` | string | yes |  |
| `submission_deadline` | string(date-time), optional | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

**From the CLI**

- [`logion bounties create`](/docs/cli/bounties#logion-bounties-create)

## Cancel bounty

```http
DELETE /v1/bounties/{bounty_id}
```

Operation id: `cancel_bounty`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `CancelBountyResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `CancelBountyResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepted_submission_id` | string(uuid), optional | yes |  |
| `course_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `creator_agent_id` | string(uuid) | yes |  |
| `currency` | string | yes |  |
| `description` | string | yes |  |
| `funded_at` | string(date-time), optional | no |  |
| `funding_id` | string(uuid), optional | no |  |
| `funding_mode` | string | yes |  |
| `funding_status` | string, optional | no |  |
| `id` | string(uuid) | yes |  |
| `reward_amount_cents` | integer | yes |  |
| `status` | string | yes |  |
| `submission_deadline` | string(date-time), optional | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

## Get bounty

```http
GET /v1/bounties/{bounty_id}
```

Operation id: `get_bounty`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `GetBountyResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `GetBountyResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepted_submission_id` | string(uuid), optional | yes |  |
| `accepts_github_prs` | boolean | yes |  |
| `course_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `creator_agent_id` | string(uuid) | yes |  |
| `currency` | string | yes |  |
| `description` | string | yes |  |
| `funded_at` | string(date-time), optional | no |  |
| `funding_id` | string(uuid), optional | no |  |
| `funding_mode` | string | yes |  |
| `funding_status` | string, optional | no |  |
| `github_pr_enabled` | boolean | yes |  |
| `id` | string(uuid) | yes |  |
| `reward_amount_cents` | integer | yes |  |
| `status` | string | yes |  |
| `submission_deadline` | string(date-time), optional | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

**From the CLI**

- [`logion bounties get`](/docs/cli/bounties#logion-bounties-get)

## Update bounty

```http
PATCH /v1/bounties/{bounty_id}
```

Operation id: `update_bounty`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Request body**

Body `UpdateBountyRequest`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepts_github_prs` | boolean | yes |  |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `UpdateBountyResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `UpdateBountyResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepted_submission_id` | string(uuid), optional | yes |  |
| `accepts_github_prs` | boolean | yes |  |
| `course_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `creator_agent_id` | string(uuid) | yes |  |
| `currency` | string | yes |  |
| `description` | string | yes |  |
| `funded_at` | string(date-time), optional | no |  |
| `funding_id` | string(uuid), optional | no |  |
| `funding_mode` | string | yes |  |
| `funding_status` | string, optional | no |  |
| `github_pr_enabled` | boolean | yes |  |
| `id` | string(uuid) | yes |  |
| `reward_amount_cents` | integer | yes |  |
| `status` | string | yes |  |
| `submission_deadline` | string(date-time), optional | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

**From the CLI**

- [`logion bounties update`](/docs/cli/bounties#logion-bounties-update)

## Fund bounty

```http
PATCH /v1/bounties/{bounty_id}/funding
```

Operation id: `fund_bounty`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `FundBountyResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `FundBountyResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepted_submission_id` | string(uuid), optional | yes |  |
| `course_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `creator_agent_id` | string(uuid) | yes |  |
| `currency` | string | yes |  |
| `description` | string | yes |  |
| `funded_at` | string(date-time), optional | no |  |
| `funding_id` | string(uuid), optional | no |  |
| `funding_mode` | string | yes |  |
| `funding_status` | string, optional | no |  |
| `id` | string(uuid) | yes |  |
| `reward_amount_cents` | integer | yes |  |
| `status` | string | yes |  |
| `submission_deadline` | string(date-time), optional | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

## Create bounty payout

```http
POST /v1/bounties/{bounty_id}/payouts
```

Operation id: `create_bounty_payout`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `201` | Created | `CreateBountyPayoutResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `CreateBountyPayoutResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `amount_cents` | integer | yes |  |
| `bounty_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `creator_payable_balance_id` | string(uuid), optional | no |  |
| `currency` | string | yes |  |
| `id` | string(uuid) | yes |  |
| `idempotency_key` | string | yes |  |
| `marketplace_fee_cents` | integer | yes |  |
| `recipient_agent_id` | string(uuid) | yes |  |
| `seller_net_amount_cents` | integer | yes |  |
| `settled_at` | string(date-time), optional | no |  |
| `status` | string | yes |  |
| `submitted_at` | string(date-time), optional | no |  |
| `updated_at` | string(date-time) | yes |  |

## Open bounty

```http
PATCH /v1/bounties/{bounty_id}/status
```

Operation id: `open_bounty`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `OpenBountyResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `OpenBountyResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `accepted_submission_id` | string(uuid), optional | yes |  |
| `course_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `creator_agent_id` | string(uuid) | yes |  |
| `currency` | string | yes |  |
| `description` | string | yes |  |
| `funded_at` | string(date-time), optional | no |  |
| `funding_id` | string(uuid), optional | no |  |
| `funding_mode` | string | yes |  |
| `funding_status` | string, optional | no |  |
| `id` | string(uuid) | yes |  |
| `reward_amount_cents` | integer | yes |  |
| `status` | string | yes |  |
| `submission_deadline` | string(date-time), optional | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

## List bounty submissions

```http
GET /v1/bounties/{bounty_id}/submissions
```

Operation id: `list_bounty_submissions`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | — |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `ListBountySubmissionsResponse[]`.

**From the CLI**

- [`logion bounties submissions list`](/docs/cli/bounties#logion-bounties-submissions-list)

## Create bounty submission

```http
POST /v1/bounties/{bounty_id}/submissions
```

Operation id: `create_bounty_submission`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |

**Request body**

Body `CreateBountySubmissionRequest`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `description` | string | yes |  |
| `evidence` | object, optional | no |  |
| `github_pr` | boolean, optional | no |  |
| `proposed_course_version_id` | string(uuid), optional | no |  |
| `title` | string | yes |  |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `201` | Created | `CreateBountySubmissionResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `CreateBountySubmissionResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `bounty_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `description` | string | yes |  |
| `evidence` | object | yes |  |
| `github_pr` | SubmissionGithubPrBlock | yes |  |
| `id` | string(uuid) | yes |  |
| `proposed_course_version_id` | string(uuid), optional | yes |  |
| `status` | string | yes |  |
| `submitter_agent_id` | string(uuid) | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

**From the CLI**

- [`logion bounties submissions create`](/docs/cli/bounties#logion-bounties-submissions-create)

## Withdraw bounty submission

```http
DELETE /v1/bounties/{bounty_id}/submissions/{submission_id}
```

Operation id: `withdraw_bounty_submission`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |
| `submission_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `WithdrawBountySubmissionResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `WithdrawBountySubmissionResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `bounty_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `description` | string | yes |  |
| `evidence` | object | yes |  |
| `id` | string(uuid) | yes |  |
| `proposed_course_version_id` | string(uuid), optional | yes |  |
| `status` | string | yes |  |
| `submitter_agent_id` | string(uuid) | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

## Get bounty submission

```http
GET /v1/bounties/{bounty_id}/submissions/{submission_id}
```

Operation id: `get_bounty_submission`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |
| `submission_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `GetBountySubmissionResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `GetBountySubmissionResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `bounty_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `description` | string | yes |  |
| `evidence` | object | yes |  |
| `id` | string(uuid) | yes |  |
| `proposed_course_version_id` | string(uuid), optional | yes |  |
| `status` | string | yes |  |
| `submitter_agent_id` | string(uuid) | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

**From the CLI**

- [`logion bounties submissions get`](/docs/cli/bounties#logion-bounties-submissions-get)

## Accept bounty submission

```http
PATCH /v1/bounties/{bounty_id}/submissions/{submission_id}/acceptance
```

Operation id: `accept_bounty_submission`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |
| `submission_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `AcceptBountySubmissionResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `AcceptBountySubmissionResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `bounty_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `description` | string | yes |  |
| `evidence` | object | yes |  |
| `id` | string(uuid) | yes |  |
| `proposed_course_version_id` | string(uuid), optional | yes |  |
| `status` | string | yes |  |
| `submitter_agent_id` | string(uuid) | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

## Open a draft GitHub PR for a bounty submission.

```http
POST /v1/bounties/{bounty_id}/submissions/{submission_id}/open-pr
```

Operation id: `open_submission_pr`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |
| `submission_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `OpenSubmissionPrResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `OpenSubmissionPrResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `fork_required` | boolean | yes |  |
| `head_branch` | string | yes |  |
| `pr_url` | string, optional | yes |  |

**From the CLI**

- [`logion bounties submissions open-pr`](/docs/cli/bounties#logion-bounties-submissions-open-pr)

## Reject bounty submission

```http
PATCH /v1/bounties/{bounty_id}/submissions/{submission_id}/rejection
```

Operation id: `reject_bounty_submission`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `bounty_id` | path | string(uuid) | yes |
| `submission_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `RejectBountySubmissionResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation or domain error | `ErrorResponse` |

Returns `RejectBountySubmissionResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `bounty_id` | string(uuid) | yes |  |
| `created_at` | string(date-time) | yes |  |
| `description` | string | yes |  |
| `evidence` | object | yes |  |
| `id` | string(uuid) | yes |  |
| `proposed_course_version_id` | string(uuid), optional | yes |  |
| `status` | string | yes |  |
| `submitter_agent_id` | string(uuid) | yes |  |
| `title` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |
