# Verify destination

`POST /v1/destinations/{destinationId}/verify`

Destination endpoints allow you to review and manage destinations in a specified environment. 

You must be a member of the environment and be assigned to an engineer role to manage destinations. [Learn about roles](https://docs.redoxengine.com/permalink/1OBel3inQAjAnDbgd9QLzM). 

### Verify destination

Update your destination URL and verification token. Then, verify that communication can be established between Redox and the destination. 

If successful, the destination is marked as `verified` and ready to receive data. The `endpoint`, `verificationToken`, and `verificationMethod` must either already be set for the destination or sent as part of this request. 

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `destinationId` | path | string | Yes | Contains the unique identifier of the destination where a dataset should be sent. |

## Request body

Contains the fields that can be provided when verifying a destination.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `endpoint` | string | No | Contains the URL of the endpoint that will receive messages from Redox. Production and staging applications must use HTTPS. |
| `verificationToken` | string | No | Contains the unique value that Redox sends in the message header to authenticate itself to a destination. |
| `verificationMethod` | string | No | HTTP method Redox will use when verifying the destination. Possible values: GET, POST |

## Request example

_Generated from the schema: the values are placeholders, not a real payload._

```bash
curl 'https://api.redoxengine.com/platform/v1/destinations/{destinationId}/verify' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "endpoint": "string",
  "verificationToken": "string",
  "verificationMethod": "POST"
}'
```

## Responses

### 200

Contains a payload object containing the destination details.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `meta` | object | No |  |
| `meta.version` | string | No | Lists the major and minor version number for the format of the returned payload. The payload format or shape may change between minor versions, like including additional or extended fields in later versions. We include the version data in each response so that you have the option to handle the signaled differences. |
| `payload` | object | No | Contains the payload with details about the requested destination. |
| `payload.destination` | object | No | Contains details about the destination and its verification status. |
| `payload.destination.id` | string (uuid) | No | Displays the unique identifier of the endpoint that will receive messages from Redox. |
| `payload.destination.name` | string | No | Displays the human-readable name of the endpoint that will receive messages from Redox. |
| `payload.destination.authCredential` | string (uuid) | No | Displays the unique identifier of the destination's attached auth credential, if any. |
| `payload.destination.environment` | object | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.destination.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.destination.environment.environmentFlag` | string | No | Indicates whether the environment is used for development, staging, or production. Possible values: Production, Staging, Development |
| `payload.destination.endpoint` | string | No | Contains the URL of the endpoint that will receive messages from Redox. Production and staging applications must use HTTPS. |
| `payload.destination.verificationToken` | string | No | Contains the unique value that Redox sends in the message header to authenticate itself to a destination. |
| `payload.destination.verificationMethod` | string | No | HTTP method Redox will use when verifying the destination. Possible values: GET, POST |
| `payload.destination.verified` | boolean | No | Indicates whether a destination has been successfully verified and can receive data. |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "destination": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "authCredential": "95dc8346-96b6-4721-88bf-bd96d3ac7a91",
      "environment": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "environmentFlag": "Staging"
      },
      "endpoint": "string",
      "verificationToken": "string",
      "verificationMethod": "POST",
      "verified": true
    }
  }
}
```

### 400

Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.id` | string | No | Contains a unique identifier for the given error instance. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Bad Request`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Bad Request",
      "code": "validation.error.bad.request",
      "detail": "Error details",
      "status": 400,
      "transient": false
    }
  }
}
```

### 403

Forbidden

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.errors` | Array of object | No |  |
| `payload.errors[].title` | string | No | Displays the high-level error message, typically something succinct like `Forbidden`. |
| `payload.errors[].code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |

```json
{
  "payload": {
    "errors": [
      {
        "title": "Forbidden",
        "code": "authorization.forbidden"
      }
    ]
  }
}
```

### 500

Internal Server Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Failed in step X`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Internal Server Error",
      "code": "failed.db.lookup",
      "detail": "Error details",
      "status": 500,
      "transient": true
    }
  }
}
```
