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

# Programmatic access

> Create an admin API key, then provision projects, enable yields, request fee configurations, and pull reporting without the dashboard UI.

Automate dashboard configuration: create projects, issue project API keys, enable yields, request fee configurations, and pull revenue and campaign data into your own systems. See [Programmatic access](/documentation/advanced-setup/programmatic-access) for what this covers and when to reach for it instead of the dashboard.

## Prerequisites

The owner or admin role to create an admin API key. This is a separate credential from the project-level `x-api-key` your integration uses against the Yield, Perps, or Borrow API; see [Manage team roles](/guides/enterprise/rbac#dashboard-roles-vs-api-keys).

<Note>
  Every programmatic route in this guide is served from `https://api.stakek.it`, the host the current admin API key documentation and dashboard Swagger reference both declare. This is a different host from `https://api.yield.xyz`, which serves the Yield API.
</Note>

## Create an admin API key

<Steps>
  <Step title="Open the admin API keys page">
    In the dashboard, go to **Programmatic Access** (`/admin-api-keys`), the page listed as admin API keys in the navigation.
  </Step>

  <Step title="Create the key">
    Click **Create API Key**, give it a **Name** and an optional **Note**, then create it.
  </Step>

  <Step title="Copy it immediately">
    The key value is shown once. Store it in a secrets manager; there's no way to retrieve it again.
  </Step>
</Steps>

## Authenticate

Send the key on every request as the `X-ADMIN-API-KEY` header:

```bash cURL theme={null}
curl https://api.stakek.it/v1/programmatic/projects \
  -H "X-ADMIN-API-KEY: $ADMIN_API_KEY"
```

## Provision a project

<Steps>
  <Step title="Create a project">
    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.stakek.it/v1/programmatic/projects \
        -H "X-ADMIN-API-KEY: $ADMIN_API_KEY" \
        -H "content-type: application/json" \
        -d '{ "name": "Acme", "description": "Production integration" }'
      ```
    </CodeGroup>

    ```json Response (excerpt) theme={null}
    { "id": "proj_...", "name": "Acme", "teamId": "..." }
    ```
  </Step>

  <Step title="Create a project API key">
    This is the `x-api-key` your integration will use against the Yield, Perps, or Borrow API, scoped to the project you just created.

    ```bash cURL theme={null}
    curl -X POST https://api.stakek.it/v1/programmatic/projects/{projectId}/keys \
      -H "X-ADMIN-API-KEY: $ADMIN_API_KEY" \
      -H "content-type: application/json" \
      -d '{ "name": "Production key" }'
    ```

    ```json Response (excerpt) theme={null}
    { "id": "key_...", "name": "Production key", "apiKey": "...", "projectId": "..." }
    ```

    `apiKey` is shown once, the same as a key created from the dashboard. An optional `expiresAt` (date only) sets an expiration; omitted, it defaults to 30 days.
  </Step>

  <Step title="Enable yields">
    A project only serves yields it has enabled. Pass an array of yield ids:

    ```bash cURL theme={null}
    curl -X POST https://api.stakek.it/v1/programmatic/projects/{projectId}/yields/enabled \
      -H "X-ADMIN-API-KEY: $ADMIN_API_KEY" \
      -H "content-type: application/json" \
      -d '[{ "integrationId": "base-usdc-aave-v3-lending" }]'
    ```

    List what's currently enabled with `GET` on the same path (paginated, `page`/`limit`, max 50 per page); remove one with `DELETE .../yields/enabled/{integrationId}`, or several at once with `DELETE .../yields/enabled` and a body.
  </Step>

  <Step title="Request a fee configuration">
    ```bash cURL theme={null}
    curl -X POST https://api.stakek.it/v1/programmatic/projects/{projectId}/fee-configuration \
      -H "X-ADMIN-API-KEY: $ADMIN_API_KEY" \
      -H "content-type: application/json" \
      -d '{
        "integrationId": "base-usdc-aave-v3-lending",
        "managementFeeBps": 100,
        "performanceFeeBps": 1000,
        "depositFeeBps": 50
      }'
    ```

    ```json Response (excerpt) theme={null}
    { "id": "fee_...", "integrationId": "base-usdc-aave-v3-lending", "status": "REQUESTED", "managementFeeBps": 100, "performanceFeeBps": 1000, "depositFeeBps": 50 }
    ```

    Each fee type accepts 1 to 10,000 bps. Keep `performanceFeeBps` at or below 2,000 (20%); yield.xyz doesn't charge the portion of a performance fee above that, so a higher value doesn't get you more revenue. A new configuration starts `REQUESTED`, moves to `PROCESSING` while yield.xyz deploys the fee contracts, then `LIVE`; only a `LIVE` configuration is applied to transactions. Updating a configuration sets it back to `REQUESTED`. `GET` (paginated) and `PATCH`/`DELETE .../fee-configuration/{feeConfigurationId}` manage existing ones. See [Reporting](/documentation/advanced-setup/reporting) for where the resulting revenue shows up, and register a payout wallet in the dashboard for each network you charge fees on; see [Set up fees and payouts](/guides/dashboards/fees-payouts).
  </Step>
</Steps>

## Manage what you provisioned

The same pattern, `GET` to list, `PATCH` to update, `DELETE` to remove, applies to projects and project API keys:

| Resource | Path |
| - | - |
| Projects | `/v1/programmatic/projects/{projectId}` |
| Project API keys | `/v1/programmatic/projects/{projectId}/keys/{keyId}` |

## Reporting

Pull the same revenue and performance data reporting shows in the dashboard, scoped to a project:

```bash cURL theme={null}
curl "https://api.stakek.it/v1/programmatic/projects/{projectId}/reporting/revenue?date=2026-09-29" \
  -H "X-ADMIN-API-KEY: $ADMIN_API_KEY"
```

That route returns one project's daily revenue by integration; `/reporting/revenue/aggregate` (with `from`/`to`) totals it across integrations for a date range. `/reporting/performance` and `/reporting/performance/aggregate` return the same shapes for volume and TVL instead of revenue. A team-wide, non-project-scoped feed of individual actions is available at `GET /v1/programmatic/report-entries`, filterable by project, integration, status, type, and address. See [Reporting](/documentation/advanced-setup/reporting) for what each figure means.

## Campaign reporting

[Incentive campaign](/documentation/platform/incentive-campaigns) data is readable, not configurable, through the programmatic campaign routes:

```bash cURL theme={null}
curl "https://api.stakek.it/v2/programmatic/projects/{projectId}/campaigns" \
  -H "X-ADMIN-API-KEY: $ADMIN_API_KEY"
```

```json Response (excerpt) theme={null}
{ "data": [{ "id": "camp_...", "integrationId": "...", "status": "active", "rewardToken": "...", "totalBudget": "..." }] }
```

Per-campaign routes under `/v2/programmatic/projects/{projectId}/campaigns/{campaignId}/` cover balances (per-user earned, paid, and unpaid totals), accrual details by window, TVL stats, payout runs and their per-batch detail, the campaign Safe's live balance, and a payout-eligibility summary. All of them are read-only.

## Next steps

<Columns cols={2}>
  <Card title="Programmatic access" icon="terminal" href="/documentation/advanced-setup/programmatic-access">
    What this credential covers and who can create one.
  </Card>

  <Card title="Reporting" icon="chart-line" href="/documentation/advanced-setup/reporting">
    Dashboard and programmatic reporting side by side.
  </Card>

  <Card title="Incentive Campaigns" icon="bullhorn" href="/documentation/platform/incentive-campaigns">
    How a campaign accrues and pays out.
  </Card>

  <Card title="Manage team roles" icon="user-shield" href="/guides/enterprise/rbac">
    Who can create an admin API key.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.