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

# Create source

> Create a new source: S3, Azure, Google Cloud, or image source.

<Note>
  **Key type:** requires a private key. A public key returns `403` here, because it may only
  upload — see [key types and scope](/docs/api-reference/introduction#key-types-and-scope). Call
  this from your server, never from browser code.
</Note>

<RequestExample>
  ```bash cURL (image_source) theme={null}
  curl --request POST \
    --url 'https://upload.autorender.io/api/v1/sources' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "name": "my_image_source",
    "type": "image_source",
    "configuration": {
      "base_url": "https://cdn.example.com",
      "forward_header": true
    }
  }'
  ```

  ```bash cURL (s3) theme={null}
  curl --request POST \
    --url 'https://upload.autorender.io/api/v1/sources' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "name": "my_s3_bucket",
    "type": "s3",
    "configuration": {
      "access_key": "AKIA...",
      "secret_key": "secret...",
      "region": "us-east-1",
      "bucket": "my-bucket"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "success": true,
    "data": {
      "id": "974628c2-9b55-4ce4-adf1-9b63edff6baa",
      "name": "my_image_source",
      "type": "image_source",
      "configuration": {
        "base_url": "https://cdn.example.com",
        "forward_header": true
      },
      "is_active": true,
      "created_at": "2026-03-27T14:58:53.795Z",
      "updated_at": "2026-03-27T14:58:53.795Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Validation failed",
    "message": "Configuration is invalid for the specified type"
  }
  ```

  ```json 409 theme={null}
  {
    "error": "Origin name already exists in this workspace"
  }
  ```
</ResponseExample>

## Overview

Creates a source in your workspace. Send **`name`**, **`type`**, and a **`configuration`** object shaped for that type — the API validates the configuration against the type before creating the row.

## Request body

| Field           | Type   | Required | Description                                                                       |
| --------------- | ------ | -------- | --------------------------------------------------------------------------------- |
| `name`          | string | Yes      | Letters, numbers, underscores, and hyphens only. Must be unique in the workspace. |
| `type`          | string | Yes      | One of: `s3`, `azure`, `google_cloud`, `image_source`                             |
| `configuration` | object | Yes      | Type-specific fields (see below)                                                  |

### Configuration by type

| Type           | Fields                                                                                 |
| -------------- | -------------------------------------------------------------------------------------- |
| `s3`           | `access_key`, `secret_key`, `region` (required), `bucket` (required)                   |
| `azure`        | `connection_string` (required), `container_name` (required)                            |
| `google_cloud` | `service_account_json` (required), `bucket_name` (required)                            |
| `image_source` | `base_url` (required, no trailing `/`), `canonical_header`, `forward_header` (boolean) |

## Response

The created source, wrapped as `{ "success": true, "data": { ... } }`. Sensitive fields are masked in the response even though they were just set.

## Next steps

<CardGroup cols={2}>
  <Card title="List sources" icon="list" iconType="solid" href="/docs/api-reference/list-sources">
    Browse the sources in your workspace.
  </Card>

  <Card title="Update source" icon="pen" iconType="solid" href="/docs/api-reference/update-source">
    Change a source's name or configuration.
  </Card>
</CardGroup>


## OpenAPI

````yaml api-reference/openapi.json POST /api/v1/sources
openapi: 3.0.0
info:
  title: AutoRender Public API
  description: >-
    REST API for uploading, managing, and serving media assets. All endpoints
    require an API key via the x-api-key header or Authorization: Bearer <key>.
  version: 1.0.0
  contact:
    name: AutoRender Support
    email: support@autorender.io
servers:
  - url: https://app-api.autorender.io
    description: Production server
security:
  - apiKey: []
tags:
  - name: Uploads
    description: Upload endpoints (API key required)
  - name: Files
    description: File management endpoints (API key required)
  - name: Folders
    description: Folder management endpoints (API key required)
  - name: Sources
    description: Source management endpoints (API key required)
paths:
  /api/v1/sources:
    post:
      tags:
        - Sources
      summary: Create source
      description: Create a new source (s3, azure, google_cloud, or image_source).
      operationId: createSource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  pattern: ^[a-zA-Z0-9_-]+$
                  description: Source name (letters, numbers, underscores, hyphens)
                type:
                  type: string
                  enum:
                    - s3
                    - azure
                    - google_cloud
                    - image_source
                configuration:
                  type: object
                  properties: {}
                  additionalProperties:
                    x-stainless-any: true
                  description: Type-specific configuration payload
              required:
                - name
                - type
                - configuration
      responses:
        '201':
          description: Source created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      name:
                        type: string
                      type:
                        type: string
                        enum:
                          - s3
                          - azure
                          - google_cloud
                          - image_source
                      configuration:
                        type: object
                        properties: {}
                        additionalProperties:
                          x-stainless-any: true
                      is_active:
                        type: boolean
                      created_at:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      updated_at:
                        nullable: true
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    required:
                      - id
                      - name
                      - type
                      - configuration
                      - is_active
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
                description: Source created
        '400':
          description: Invalid payload
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Invalid payload
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                  - message
                additionalProperties: false
                description: Unauthorized
        '403':
          description: Private API key required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                  - message
                additionalProperties: false
                description: Private API key required
        '409':
          description: Source name already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Source name already exists
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  retryAfterSeconds:
                    type: number
                required:
                  - error
                  - message
                additionalProperties: false
                description: Rate limit exceeded
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for public endpoints. Can also be provided via Authorization:
        Bearer <key>

````