---
title: Create Destination
slug: redcircleapi/destinations-api/create
docTags: 
createdAt: 2024-07-27T14:22:43.825Z
---

# Create Destination

Create a Destination to upload Collection Result Sets to on completion.

Destinations are created by making an  `HTTP POST`  to the  `/destinations`  endpoint. POST parameters can be either supplied as  `x-www-form-urlencoded`  parameters or by POST'ing a `JSON`  object.

***

### Example

<font color="#fa8c16">`POST`</font>  `/destination`

To create a new Amazon S3 Destination the request would be as shown below:

:::hint{type="info"}
**Verifying your Destination**
Whenever you create a new  `enabled`  Destination, or enable a previous disabled Destination, or update an existing Destination's credentials, RedCircle API will upload and then delete a small test file to the Destination to verify connectivity. If this connectivity test fails then the create/update operation itself fails.
:::

:::CodeblockTabs
```curl
$ curl "https://api.redcircleapi.com/destinations?api_key=demo" \
  -d name="My First S3 Destination" \
  -d type="s3" \
  -d enabled=true \
  -d s3_access_key_id="my_access_key_id" \
  -d s3_secret_access_key="my_secret_access_key" \
  -d s3_bucket_name="MyS3Bucket" \
  -d s3_path_prefix="my_path_prefix"
```

```nodejs
const axios = require('axios');
const body = {
  name: 'My First S3 Destination',
  type: "s3",
  enabled: true,
  s3_access_key_id: 'my_access_key_id',
  s3_secret_access_key: 'my_secret_access_key',
  s3_bucket_name: 'MyS3Bucket',
  s3_path_prefix: 'my_path_prefix'
}

axios.post('https://api.redcircleapi.com/destinations?api_key=demo', body)
  .then(response => {
    const apiResponse = response.data;

    console.log('Destination Created: ' + JSON.stringify(apiResponse, 0, 2));

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests
import json

body = {
  "name": "My First S3 Destination",
  "type": "s3",
  "enabled": True,
  "s3_access_key_id": "my_access_key_id",
  "s3_secret_access_key": "my_secret_access_key",
  "s3_bucket_name": "s3_bucket_name",
  "s3_path_prefix": "my_path_prefix"
}

api_result = requests.post('https://api.redcircleapi.com/destinations?api_key=demo', json=body)

api_response = api_result.json()

print("Destination Created: " + json.dumps(api_response))
```

```php
<?php

$body = http_build_query([
  "name" => "My First S3 Destination",
  "type" => "s3",
  "enabled" => false,
  "s3_access_key_id" => "my_access_key_id",
  "s3_secret_access_key" => "my_secret_access_key",
  "s3_bucket_name" => "s3_bucket_name",
  "s3_path_prefix" => "my_path_prefix"
]);

$ch = curl_init('https://api.redcircleapi.com/destinations?api_key=demo');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
# the following options are required if you're using an outdated OpenSSL version
# more details: https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

$json = curl_exec($ch);
curl_close($ch);

$api_result = json_decode($json, true);

print_r($api_result);

echo "Destination Created", PHP_EOL;

?>
```
:::

RedCircle API responds with the following JSON confirming the Destination has been successfully created.

```json
{
  "request_info": {
    "success": true
  },
  "destination": {
    "id": "ABCDEFG"
  }
}
```

***

### Destination Parameters

<font color="#fa8c16">`POST`</font>  `/destinations`

The following parameters can be used when creating a Destination. The  `api_key`  parameter should be supplied as a querystring parameter on the request URL.

Parameters pther than  `api_key`  should be supplied in either  `x-www-form-urlencoded`  or  `JSON`  format, in the request body.

| `Parameter`            | `Required` | `Description`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ---------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `api_key`              | `required` | The API key for your account, should be supplied on the request querystring, i.e. `api_key=demo`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `name`                 | `required` | The name of the Destination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `enabled`              | `required` | Determines whether the Destination is enabled or not. Disabled Destinations do not have Collection Result Sets uploaded to them, even if the Destination is set of a Collection.<br />`Parameter Values`<br />1) `true`
2) Destination is enabled<br /><br />1) `false`
2) Destination is disabled                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `type`                 | `required` | Determines the type of Destination.<br />`Parameter Values`<br />1) `s3`
2) Specifies that this Destination is for an Amazon S3 bucket.<br /><br />1) `gcs`
2) Specifies that this Destination is for a Google Cloud Storage bucket.<br /><br />1) `azure`
2) Specifies that this Destination is for Microsoft Azure Blob Storage.<br /><br />1) `oss`
2) Specifies that this Destination is for a Alibaba Cloud OSS bucket.<br /><br />1) `s3compatible`
2) Specifies that this Destination is an S3 compatible object storage provider. **Note** that when `type=s3compatible` an S3-compatible endpoint must be supplied in the `s3_endpoint` parameter.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `s3_access_key_id`     | `required` | **Applies only when** `type=s3`**&#x20;or&#x20;**`type=s3compatible` <br />The Amazon S3 Access Key ID. We strongly recommend you set up credentials specifically for RedCircle API to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `s3_secret_access_key` | `required` | **Applies only when&#x20;**`type=s3`**&#x20;or&#x20;**`type=s3compatible` <br />The Amazon S3 Secret Access Key. We strongly recommend you set up credentials specifically for RedCircle API to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `s3_bucket_name`       | `required` | **Applies only when&#x20;**`type=s3`**&#x20;or&#x20;**`type=s3compatible` <br />The Amazon S3 bucket name to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `s3_path_prefix`       | `optional` | **Applies only when&#x20;**`type=s3`**&#x20;or&#x20;**`type=s3compatible` <br />The Amazon S3 path prefix to prepend to Collection Result Set files when they are uploaded to your bucket.  <br />The text tokens `%COLLECTION_ID%` , `%COLLECTION_NAME%` , `%RESULT_SET_ID%` and `%DATE%` will be replaced with the Collection ID, Collection name, Result Set ID and UTC date (in the form YYYY\_MM\_DD) respectively when the files are uploaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `s3_endpoint`          | `required` | **Applies only when&#x20;**`type=s3compatible` <br />The Endpoint to use when connecting to S3 compatible storage (i.e. when `type=s3compatible` ) For example `https://ams3.digitaloceanspaces.com`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `s3_region`            | `optional` | **Applies only when&#x20;**`type=s3compatible` <br />The region to use when connecting to S3 compatible storage (i.e. when `type=s3compatible` ) For example `eu-west-1` , `us-east-1` , `auto` , etc                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `gcs_access_key`       | `required` | **Applies only when&#x20;**`type=gcs` <br />The interoperable storage access key to use when connecting to Google Cloud Storage. We strongly recommend you set up credentials specifically for RedCircle API to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `gcs_secret_key`       | `required` | **Applies only when&#x20;**`type=gcs` <br />The interoperable storage secret key used when connecting to Google Cloud Storage. We strongly recommend you set up credentials specifically for RedCircle API to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `gcs_bucket_name`      | `required` | **Applies only when&#x20;**`type=gcs` <br />The Google Cloud Storage bucket name to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `gcs_path_prefix`      | `optional` | **Applies only when&#x20;**`type=gcs` <br />The Google Cloud Storage path prefix to prepend to Collection Result Set files when they are uploaded to your bucket.  <br />The text tokens `%COLLECTION_ID%` , `%COLLECTION_NAME%` , `%RESULT_SET_ID%` and `%DATE%` will be replaced with the Collection ID, Collection name, Result Set ID and UTC date (in the form YYYY\_MM\_DD) respectively when the files are uploaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `azure_account_name`   | `required` | **Applies only when&#x20;**`type=azure` <br />The storage account name to use when connecting to Microsoft Azure Blob Storage. We strongly recommend you set up credentials specifically for RedCircle API to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `azure_account_key`    | `required` | **Applies only when&#x20;**`type=azure` <br />The account key used when connecting to Microsoft Azure Blob Storage. We strongly recommend you set up credentials specifically for RedCircle API to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `azure_container_name` | `required` | **Applies only when&#x20;**`type=azure` <br />The Microsoft Azure Blob Storage container name to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `azure_path_prefix`    | `optional` | **Applies only when&#x20;**`type=azure` <br />The Microsoft Azure Blob Storage path prefix to prepend to Collection Result Set files when they are uploaded to your bucket.  <br />The text tokens `%COLLECTION_ID%` , `%COLLECTION_NAME%` , `%RESULT_SET_ID%` and `%DATE%` will be replaced with the Collection ID, Collection name, Result Set ID and UTC date (in the form YYYY\_MM\_DD) respectively when the files are uploaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `oss_access_key`       | `required` | **Applies only when&#x20;**`type=oss` <br />The RAM user access key to use when connecting to Alibaba Cloud OSS. We highly recommend creating a new Alibaba Cloud RAM user specifically for RedCircle API to use. You can do so in your [Alibaba Cloud console](https://ram.console.aliyun.com/users/new)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `oss_secret_key`       | `required` | **Applies only when&#x20;**`type=oss` <br />The RAM user secret key used when connecting to Alibaba Cloud OSS. We highly recommend creating new Alibaba Cloud RAM user specifically for RedCircle API to use. You can do so in your [Alibaba Cloud console](https://ram.console.aliyun.com/users/new)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `oss_bucket_name`      | `required` | **Applies only when&#x20;**`type=oss` <br />The Alibaba Cloud OSS bucket name to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `oss_region_id`        | `required` | **Applies only when&#x20;**`type=oss` <br />The Alibaba Cloud OSS Region ID to use when connecting to your bucket.<br />`oss-cn-hangzhou` - China (Hangzhou)<br />`oss-cn-shanghai` - China (Shanghai)<br />`oss-cn-qingdao` - China (Qingdao)<br />`oss-cn-beijing` - China (Beijing)<br />`oss-cn-zhangjiakou` - China (Zhangjiakou)<br />`oss-cn-huhehaote` - China (Hohhot)<br />`oss-cn-wulanchabu` - China (Ulanqab)<br />`oss-cn-shenzhen` - China (Shenzhen)<br />`oss-cn-heyuan` - China (Heyuan)<br />`oss-cn-guangzhou` - China (Guangzhou)<br />`oss-cn-chengdu` - China (Chengdu)<br />`oss-cn-hongkong` - China (Hong Kong)<br />`oss-us-west-1` - US (Silicon Valley)<br />`oss-us-east-1` - US (Virginia)<br />`oss-ap-southeast-1` - Singapore<br />`oss-ap-southeast-2` - Australia (Sydney)<br />`oss-ap-southeast-3` - Malaysia (Kuala Lumpur)<br />`oss-ap-southeast-5` - Indonesia (Jakarta)<br />`oss-ap-northeast-1` - Japan (Tokyo)<br />`oss-ap-south-1` - India (Mumbai)<br />`oss-eu-central-1` - Germany (Frankfurt)<br />`oss-eu-west-1` - UK (London)<br />`oss-me-east-1` - UAE (Dubai) |
| `oss_path_prefix`      | `optional` | **Applies only when&#x20;**`type=oss` <br />The Alibaba Cloud OSS path prefix to prepend to Collection Result Set files when they are uploaded to your bucket.  <br />The text tokens `%COLLECTION_ID%` , `%COLLECTION_NAME%` , `%RESULT_SET_ID%` and `%DATE%` will be replaced with the Collection ID, Collection name, Result Set ID and UTC date (in the form YYYY\_MM\_DD) respectively when the files are uploaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

***

**Next Steps**
     [List Destinations](https://docs.trajectdata.com/redcircleapi/destinations-api/list)
     [Update Destination](https://docs.trajectdata.com/redcircleapi/destinations-api/update)
