# prov.identify.addSigningKey

prov.identify.addSigningKey in Node SDK. Agent side: publish a public signing key for one of your agents (free).

## Signature

```ts
prov.identify.addSigningKey(agentId: string, params: SigningKeyParams): Promise<Record<string, unknown>>
```

## Parameters

- `agentId` (string)
- `params` (SigningKeyParams)

## Returns

`Promise<Record<string, unknown>>`

## HTTP operation

[`POST /v1/identify/agents/{id}/signing_keys`](https://provenanceauth.com/docs/api/signed-agents.md#post-v1-identify-agents-id-signing-keys): Add a signing key

## Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`signing_key_exists`](https://provenanceauth.com/docs/platform/errors.md#signing_key_exists)
- [`signing_key_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#signing_key_limit_reached)

## Example

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "pantry-pal", "category": "shopping_agent" }),
})).json();
const agentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/agents/${agentId}/signing_keys`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "jwk": {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "G_STrQBvTD7Bi8OjlNnLcKPPiPp03Vh0sJKTMG7QzFY"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "pantry-pal",
    "category": "shopping_agent"
}).json()
agent_id = step1["id"]
data = httpx.post(f"{api}/v1/identify/agents/{agent_id}/signing_keys", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "jwk": {
        "kty": "OKP",
        "crv": "Ed25519",
        "x": "G_STrQBvTD7Bi8OjlNnLcKPPiPp03Vh0sJKTMG7QzFY"
    }
}).json()
```
