---
title: "Upsert vouch"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sureshake.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sureshake API › entities

`PUT /v2/entities/{entityId}/vouches`

## Path parameters

- `entityId` (`entity-reputation-upsert-vouch.path.entityId`; string, required)
  - format `uuid`

## Request body

_Required._

- `voucherEntityId` (`entity-reputation-upsert-vouch.voucherEntityId`; string, required)
  - format `uuid`
- `scope` (`entity-reputation-upsert-vouch.scope`; string, optional)
  - minLength 1; maxLength 64; default `"general"`
- `confidence` (`entity-reputation-upsert-vouch.confidence`; integer, optional)
  - min 1; max 5; default `3`
- `evidenceHash` (`entity-reputation-upsert-vouch.evidenceHash`; string, optional)
  - minLength 1; maxLength 255
- `evidenceCid` (`entity-reputation-upsert-vouch.evidenceCid`; string, optional)
  - minLength 1; maxLength 255
- `comment` (`entity-reputation-upsert-vouch.comment`; string, optional)
  - maxLength 500
- `expiresAt` (`entity-reputation-upsert-vouch.expiresAt`; string, optional, nullable)
  - format `date-time`

## Example request

```json
{
  "voucherEntityId": "687a822d-209a-4607-9d86-54cce0292c95",
  "scope": "general",
  "confidence": 3,
  "evidenceHash": "string",
  "evidenceCid": "string",
  "comment": "string",
  "expiresAt": "2019-08-24T14:15:22Z"
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.sureshake.com/v2/entities/<entityId>/vouches' \
  --header 'Content-Type: application/json' \
  --data '
{
  "voucherEntityId": "687a822d-209a-4607-9d86-54cce0292c95",
  "scope": "general",
  "confidence": 3,
  "evidenceHash": "string",
  "evidenceCid": "string",
  "comment": "string",
  "expiresAt": "2019-08-24T14:15:22Z"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sureshake.com/v2/entities/<entityId>/vouches';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    voucherEntityId: '687a822d-209a-4607-9d86-54cce0292c95',
    scope: 'general',
    confidence: 3,
    evidenceHash: 'string',
    evidenceCid: 'string',
    comment: 'string',
    expiresAt: '2019-08-24T14:15:22Z'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sureshake.com/v2/entities/<entityId>/vouches"

payload = {
    "voucherEntityId": "687a822d-209a-4607-9d86-54cce0292c95",
    "scope": "general",
    "confidence": 3,
    "evidenceHash": "string",
    "evidenceCid": "string",
    "comment": "string",
    "expiresAt": "2019-08-24T14:15:22Z"
}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Default Response

#### Example

```json
{
  "data": {
    "vouchId": "75e5cbca-6c1b-4ab5-830e-1def92881769",
    "recalculatedOverall": 0,
    "recalculatedGrade": "AAA"
  },
  "meta": {
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
```

- `data` (`entity-reputation-upsert-vouch.response.200.data`; object, required)
  - `vouchId` (`entity-reputation-upsert-vouch.response.200.data.vouchId`; string, required)
    - format `uuid`
  - `recalculatedOverall` (`entity-reputation-upsert-vouch.response.200.data.recalculatedOverall`; number, required, nullable)
  - `recalculatedGrade` (`entity-reputation-upsert-vouch.response.200.data.recalculatedGrade`; string, required, nullable)
    - one of `"AAA"`, `"AA"`, `"A"`, `"BBB"`, `"BB"`, `"B"`, `"CCC"`, `"CC"`, `"C"`, `"D"`
- `meta` (`entity-reputation-upsert-vouch.response.200.meta`; object, optional)
  - `timestamp` (`entity-reputation-upsert-vouch.response.200.meta.timestamp`; string, required)
    - format `date-time`

### 400

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.400.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.400.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.400.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.400.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.400.error.traceId`; string, optional) — Unique ID for log correlation

### 401

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.401.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.401.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.401.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.401.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.401.error.traceId`; string, optional) — Unique ID for log correlation

### 403

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.403.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.403.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.403.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.403.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.403.error.traceId`; string, optional) — Unique ID for log correlation

### 404

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.404.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.404.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.404.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.404.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.404.error.traceId`; string, optional) — Unique ID for log correlation

### 409

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.409.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.409.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.409.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.409.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.409.error.traceId`; string, optional) — Unique ID for log correlation

### 500

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.500.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.500.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.500.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.500.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.500.error.traceId`; string, optional) — Unique ID for log correlation

### 501

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.501.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.501.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.501.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.501.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.501.error.traceId`; string, optional) — Unique ID for log correlation

### 503

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-reputation-upsert-vouch.response.503.error`; object, required)
  - `code` (`entity-reputation-upsert-vouch.response.503.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-reputation-upsert-vouch.response.503.error.message`; string, required) — Human-readable error message
  - `details` (`entity-reputation-upsert-vouch.response.503.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-reputation-upsert-vouch.response.503.error.traceId`; string, optional) — Unique ID for log correlation


Source: https://docs.sureshake.com/reference/entity-reputation-upsert-vouch/index.md
