# Delegate to a DRep

DRep (Delegation Representative) delegation enables users to participate in Cardano's governance system by assigning their voting power to chosen representatives. By integrating DRep delegation into your application, you empower users to influence the blockchain's future without requiring them to actively participate in every governance decision.

## API Endpoint

**URL**: `https://preprod.api.ada-anvil.app/v2/services/transactions/build`\
**Method**: POST\
**Headers**: `Content-Type: application/json`, `x-api-key: YOUR_API_KEY`

## Request Format

```json
{
  "changeAddress": "addr_test1...",
  "utxos": ["8282...", "8282..."],
  "delegations": [
    {
      "type": "drep",
      "address": "addr_test1...",
      "keyHash": "drep13d6sxkyz6st9h65qqrzd8ukpywhr8swe9f6357qntgjqye0gttd"
    }
  ]
}
```

## Parameter Details

| Parameter | Description                       | Example                  |
| --------- | --------------------------------- | ------------------------ |
| `type`    | Must be `"drep"`                  | `"drep"`                 |
| `address` | User's full address               | `"addr_test1..."`        |
| `keyHash` | DRep ID to delegate to            | `"drep13d6s..."`         |
| `utxos`   | Array of UTXOs in CBOR hex format | `["8282...", "8282..."]` |

## Implementation Examples

**Using Fetch API:**

{% content-ref url="/pages/91YG6z42M04LInALjboG" %}
[Deno & Fetch](/guides/delegations/delegate-to-a-drep/deno-and-fetch.md)
{% endcontent-ref %}

**Using cURL:**

{% content-ref url="/pages/s4ycPbUoRrJNj7KPhj0x" %}
[Bash & cURL](/guides/delegations/delegate-to-a-drep/bash-and-curl.md)
{% endcontent-ref %}

## Transaction Signing

After building the transaction, it must be signed before submission:

{% content-ref url="<https://github.com/Cardano-Forge/anvil-api/blob/main/docs/guides/transaction/signing-transaction.md>" %}
<https://github.com/Cardano-Forge/anvil-api/blob/main/docs/guides/transaction/signing-transaction.md>
{% endcontent-ref %}

## User Interface Examples

<figure><img src="/files/aciYKy4GbwODcmxC7y2c" alt="Eternl Vote Delegation"><figcaption><p>Eternl's DRep delegation interface provides a good reference</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ada-anvil.io/guides/delegations/delegate-to-a-drep.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
