# Bounties ## Overview ### Available Operations * [listSubmissions](#listsubmissions) - List bounty submissions * [approveSubmission](#approvesubmission) - Approve a bounty submission * [rejectSubmission](#rejectsubmission) - Reject a bounty submission ## listSubmissions List all submissions for a specific bounty in your partner program. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.bounties.listSubmissions({ bountyId: "", page: 1, pageSize: 50, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DubCore } from "dub/core.js"; import { bountiesListSubmissions } from "dub/funcs/bountiesListSubmissions.js"; // Use `DubCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dub = new DubCore({ token: "DUB_API_KEY", }); async function run() { const res = await bountiesListSubmissions(dub, { bountyId: "", page: 1, pageSize: 50, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("bountiesListSubmissions failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.ListBountySubmissionsRequest](../../models/operations/listbountysubmissionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListBountySubmissionsResponseBody[]](../../models/.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## approveSubmission Approve a bounty submission. Optionally specify a custom reward amount. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.bounties.approveSubmission({ bountyId: "", submissionId: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DubCore } from "dub/core.js"; import { bountiesApproveSubmission } from "dub/funcs/bountiesApproveSubmission.js"; // Use `DubCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dub = new DubCore({ token: "DUB_API_KEY", }); async function run() { const res = await bountiesApproveSubmission(dub, { bountyId: "", submissionId: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("bountiesApproveSubmission failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.ApproveBountySubmissionRequest](../../models/operations/approvebountysubmissionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ApproveBountySubmissionResponseBody](../../models/operations/approvebountysubmissionresponsebody.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## rejectSubmission Reject a bounty submission with a specified reason and optional note. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.bounties.rejectSubmission({ bountyId: "", submissionId: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DubCore } from "dub/core.js"; import { bountiesRejectSubmission } from "dub/funcs/bountiesRejectSubmission.js"; // Use `DubCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dub = new DubCore({ token: "DUB_API_KEY", }); async function run() { const res = await bountiesRejectSubmission(dub, { bountyId: "", submissionId: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("bountiesRejectSubmission failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.RejectBountySubmissionRequest](../../models/operations/rejectbountysubmissionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.RejectBountySubmissionResponseBody](../../models/operations/rejectbountysubmissionresponsebody.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* |