View a markdown version of this page

CreateAttachedFile - Amazon Connect Customer

CreateAttachedFile

Creates an attached file for a completed voice contact by copying a recording from a source S3 URI into Connect Customer managed storage. Use this API to attach voice recordings to contacts for downstream processing such as conversational analytics.

Important

The AssociatedResourceArn must be the ARN of a completed voice contact, FileUseCaseType must be set to VOICE_RECORDING, and FileSourceUri must be a valid S3 URI.

Note

For example, you can call CreateContact, then CreateAttachedFile, then StartContactConversationalAnalyticsJob to create a contact, attach a recording, and run post-call analytics.

Request Syntax

PUT /attached-files/InstanceId/files?associatedResourceArn=AssociatedResourceArn HTTP/1.1 Content-type: application/json { "ClientToken": "string", "FileSourceUri": "string", "FileUseCaseType": "string", "Tags": { "string" : "string" } }

URI Request Parameters

The request uses the following URI parameters.

AssociatedResourceArn

The ARN of the completed voice contact to attach the file to. Only voice contacts with Telephony subtype are supported.

Note

This value must be a valid ARN.

Required: Yes

InstanceId

The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

Request Body

The request accepts the following data in JSON format.

ClientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Type: String

Length Constraints: Maximum length of 500.

Required: No

FileSourceUri

The S3 URI of the file to be attached. Only S3 source URIs are supported.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2000.

Required: Yes

FileUseCaseType

The use case for the file.

Important

Only VOICE_RECORDING is supported.

Type: String

Valid Values: CONTACT_ANALYSIS | EMAIL_MESSAGE | EMAIL_MESSAGE_PLAIN_TEXT | EMAIL_MESSAGE_REDACTED | EMAIL_MESSAGE_PLAIN_TEXT_REDACTED | ATTACHMENT | VOICE_RECORDING

Required: Yes

Tags

The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(?!aws:)[\p{L}\p{Z}\p{N}_.:/=+\-@]*$

Value Length Constraints: Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "CreationTime": "string", "FileArn": "string", "FileId": "string", "FileStatus": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

CreationTime

The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2024-05-03T02:41:28.172Z.

Type: String

FileArn

The unique identifier of the attached file resource (ARN).

Type: String

FileId

The unique identifier of the attached file resource.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

FileStatus

The current status of the attached file. Valid values: PROCESSING | APPROVED | REJECTED | FAILED.

Type: String

Valid Values: APPROVED | REJECTED | PROCESSING | FAILED

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

You do not have sufficient permissions to perform this action.

HTTP Status Code: 403

InternalServiceException

Request processing failed because of an error or failure with the service.

Message

The message.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

Message

The message about the request.

Reason

Reason why the request was invalid.

HTTP Status Code: 400

ResourceConflictException

A resource already has that name.

HTTP Status Code: 409

ServiceQuotaExceededException

The service quota has been exceeded.

Reason

The reason for the exception.

HTTP Status Code: 402

ThrottlingException

The throttling limit has been exceeded.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: