Skip to navigation

AWS S3

Store recordings of chat conversations in AWS S3

Your assistants can be configured to record chat conversations and upload the recordings to a bucket in AWS S3 when the conversation ends. You will need to configure the credential and bucket settings in the Cloud Providers section of the Integrations page in the Vapi dashboard.

Vapi can authenticate to your bucket in two ways:

  • Access keys: an AWS Identity and Access Management (IAM) user’s access key ID and secret access key. For more information, see AWS’s guide to managing IAM user access keys.
  • Role-based (AWS STS): Vapi uses AWS Security Token Service (STS) to assume an IAM role in your account and receives short-lived credentials. No long-lived keys are shared. For more information, see Role-based credentials (AWS STS).

Credential Settings

SettingDescription
AWS Access Key IDThe access key id for AWS
AWS Secret Access KeyThe secret access key for AWS
S3 Bucket NameThe name of the bucket to upload recordings to
Bucket Path PrefixAn optional path prefix for recordings uploaded to the bucket. Supports LiquidJS Date format templating - for example, {{ "now" | date: "%Y/%m/%d" }} renders as YYYY/MM/DD.

Example

AWS S3 dialog in Dashboard Integrations with AWS Access Key ID, AWS Secret Access Key, S3 Bucket Region, S3 Bucket Name, optional S3 Path Prefix, and Fallback Index
Example Configuration

Role-based credentials (AWS STS)

With role-based credentials, you create an IAM role in your AWS account that trusts Vapi’s AWS account. When Vapi uploads a recording, it calls STS AssumeRole on your role and uses the temporary credentials it receives.

Prerequisites

  • An S3 bucket for your recordings
  • IAM permissions to create roles and policies in the account that owns the bucket
  • A Vapi private API key, if you create the credential through the API
1

Create an IAM role

Create the role that Vapi will assume.

  1. Open the IAM Console in AWS
  2. Go to Roles and click Create role
  3. Select Custom trust policy as the trusted entity type
  4. Paste a trust policy from the next step

Choose a descriptive name for the role, such as VapiS3RecordingsRole.

2

Attach the trust policy

The trust policy allows Vapi’s production AWS account, 533267069243, to assume the role.

Set the principal to Vapi’s account root, arn:aws:iam::533267069243:root. Do not name a specific Vapi IAM user or role. Vapi may change which of its IAM identities calls AssumeRole, and a trust policy that names a specific identity stops working when that happens. Trusting the account root does not give every identity in Vapi’s account access; it lets Vapi’s account grant sts:AssumeRole only to the identity that needs it.

An External ID is optional. If you use one, enter the same value in the trust policy’s sts:ExternalId condition and in the Vapi credential’s authenticationPlan.externalId.

For more information, see AWS’s guides to creating a role with a custom trust policy and using External IDs for third-party access.

Replace YOUR_UNIQUE_EXTERNAL_ID with a unique value before use. AWS recommends an External ID for third-party cross-account access.

Trust policy with External ID
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::533267069243:root"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "YOUR_UNIQUE_EXTERNAL_ID"
}
}
}
]
}
3

Attach the permissions policy

Give the role access to your bucket. Replace YOUR_BUCKET_NAME with your bucket name. To limit access to a path prefix, replace /* with /YOUR_PREFIX/*.

Permissions policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:ListMultipartUploadParts",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
}
]
}
ActionPurpose
s3:PutObjectUpload recordings, including multipart uploads of large files
s3:ListMultipartUploadPartsComplete multipart uploads
s3:GetObjectRead back recordings that Vapi uploaded
s3:DeleteObjectDelete recordings that Vapi uploaded. Omit it if Vapi should never delete objects.

If your bucket uses server-side encryption with AWS Key Management Service keys (SSE-KMS) and a customer managed key, also allow kms:GenerateDataKey and kms:Decrypt on that key.

Before attaching the policy, you can check it with IAM Access Analyzer policy validation.

To attach the policy:

  1. In the IAM Console, go to Policies and click Create policy
  2. Select JSON and paste the policy
  3. Name the policy, for example VapiS3RecordingsPolicy
  4. Attach the policy to your IAM role
4

Create the Vapi credential

Create a credential with the role’s Amazon Resource Name (ARN) and bucket details, in the dashboard or through the API.

The dashboard form has no External ID field. If your trust policy requires an External ID, create the credential through the API.

  1. In the Vapi dashboard, open the AWS integration
  2. In AWS STS Credentials, enter the Role ARN of the IAM role you created
  3. Enter the S3 Bucket Region and S3 Bucket Name
  4. Optionally, enter a Path Prefix for uploaded recordings, for example recordings/, and a Fallback Index
  5. Save the credential

Troubleshooting

  • AccessDenied on sts:AssumeRole: The trust policy doesn’t allow Vapi to assume the role. Check that the principal is arn:aws:iam::533267069243:root, not a specific Vapi IAM user or role, and that the External ID matches.
  • External ID mismatch: The externalId in your Vapi credential must exactly match sts:ExternalId in the trust policy. If you don’t use an External ID, remove the Condition block from the trust policy and the externalId field from the credential.
  • AccessDenied on upload: The role’s permissions policy doesn’t cover the bucket or prefix, or a bucket policy or KMS key policy denies access. Check the Resource ARN and any path prefix restriction.