> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voiceable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and Sync Agent File

## Create and Sync Agent File

Create a new agent file and synchronize it with ElevenLabs.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.example.com/api/v1/agent_files/create_and_sync" \
    -H "X-API-Key: your-api-key-here" \
    -H "Content-Type: application/json" \
    -d '{
      "s3_key": "files/product-catalog.pdf",
      "s3_url": "https://s3.amazonaws.com/bucket/files/product-catalog.pdf",
      "file_name": "product-catalog.pdf",
      "file_size": 1024000,
      "content_type": "application/pdf",
      "agent_id": "123"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.example.com/api/v1/agent_files/create_and_sync', {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key-here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      s3_key: 'files/product-catalog.pdf',
      s3_url: 'https://s3.amazonaws.com/bucket/files/product-catalog.pdf',
      file_name: 'product-catalog.pdf',
      file_size: 1024000,
      content_type: 'application/pdf',
      agent_id: '123'
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'X-API-Key': 'your-api-key-here',
      'Content-Type': 'application/json'
  }

  payload = {
      's3_key': 'files/product-catalog.pdf',
      's3_url': 'https://s3.amazonaws.com/bucket/files/product-catalog.pdf',
      'file_name': 'product-catalog.pdf',
      'file_size': 1024000,
      'content_type': 'application/pdf',
      'agent_id': '123'
  }

  response = requests.post(
      'https://api.example.com/api/v1/agent_files/create_and_sync',
      headers=headers,
      json=payload
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "status": {
      "code": 201,
      "message": "File created and synced successfully"
    },
    "data": {
      "id": 1,
      "file_name": "product-catalog.pdf",
      "s3_key": "files/product-catalog.pdf",
      "s3_url": "https://s3.amazonaws.com/bucket/files/product-catalog.pdf",
      "file_size": 1024000,
      "content_type": "application/pdf",
      "elevenlabs_document_id": "doc_abc123",
      "agent_id": 123,
      "agent_name": "Customer Support Agent"
    }
  }
  ```
</ResponseExample>

<OpenApiExplorer />
