Skip to main content
POST
/
organizations
/
{orgId}
/
dataexports
/
destinations
Create ExportDestination
curl --request POST \
  --url https://api.m3ter.com/organizations/{orgId}/dataexports/destinations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "code": "<string>",
  "bucketName": "<string>",
  "iamRoleArn": "<string>",
  "version": 123,
  "destinationType": "S3",
  "prefix": "<string>",
  "partitionOrder": "TYPE_FIRST"
}
'
{
  "id": "<string>",
  "version": 123,
  "name": "<string>",
  "code": "<string>",
  "destinationType": "S3",
  "dtCreated": "2023-11-07T05:31:56Z",
  "dtLastModified": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "lastModifiedBy": "<string>",
  "bucketName": "<string>",
  "prefix": "<string>",
  "iamRoleArn": "<string>",
  "partitionOrder": "TYPE_FIRST"
}

Authorizations

Authorization
string
header
required

m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.

The authorizationCode flow controls access for human users via the m3ter Console application.

Path Parameters

orgId
string
required

UUID of the organization

Body

application/json
name
string
required

The name of the Export Destination.

Required string length: 1 - 200
code
string
required

The code of the Export Destination.

Required string length: 1 - 80
bucketName
string
required

Name of the S3 bucket for the Export Destination.

Required string length: 3 - 63
iamRoleArn
string
required

To enable m3ter to upload a Data Exports to your S3 bucket, the service has to assume an IAM role with PutObject permission for the specified bucketName. Create a suitable IAM role in your AWS account and enter ARN:

Formatting Constraints:

  • The IAM role ARN must begin with "arn:aws:iam".
  • The general format required is: "arn:aws:iam:::role/". For example: "arn:aws:iam::922609978421:role/IAMRole636".
  • If the iamRoleArn used doesn't comply with this format, then an error message will be returned.

More Details: For more details and examples of the Permission and Trust Policies you can use to create the required IAM Role ARN, see Creating Data Export Destinations in our main User documentation.

Minimum string length: 1
version
integer<int64>

The version number of the entity:

  • Create entity: Not valid for initial insertion of new entity - do not use for Create. On initial Create, version is set at 1 and listed in the response.
  • Update Entity: On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
destinationType
enum<string>
Available options:
S3,
GCS
prefix
string

Location in specified S3 bucket for the Export Destination. If you omit a prefix, then the root of the bucket will be used.

partitionOrder
enum<string>
Available options:
TYPE_FIRST,
TIME_FIRST

Response

Returns the created Export Destination.

id
string
required

The UUID of the entity.

version
integer<int64>

The version number:

  • Create: On initial Create to insert a new entity, the version is set at 1 in the response.
  • Update: On successful Update, the version is incremented by 1 in the response.
name
string

The name of the data Export Destination.

code
string

The code of the data Export Destination.

destinationType
enum<string>
Available options:
S3,
GCS
dtCreated
string<date-time>

The DateTime when the Export Destination was created.

dtLastModified
string<date-time>

The DateTime when the Export Destination was last modified.

createdBy
string

The id of the user who created the Export Destination.

lastModifiedBy
string

The id of the user who last modified the Export Destination.

bucketName
string

Name of the S3 bucket for the Export Destination.

prefix
string

Location in specified S3 bucket for the Export Destination. If no prefix is specified, then the root of the bucket is used.

iamRoleArn
string

The specified IAM role ARN with PutObject permission for the specified bucketName, which allows the service to upload Data Exports to your S3 bucket.

partitionOrder
enum<string>
Available options:
TYPE_FIRST,
TIME_FIRST