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

# Create Location

> Create a new cloud storage location.

**Required Role:** ADMIN or OWNER

**Tier Limits:**
- Free Tier: Maximum 4 locations
- Pro Tier: Maximum 100 locations

Locations define cloud storage endpoints (buckets/containers). RClone configuration
options are set at the Task level, not here.

Example request body for S3:
```json
{
    "name": "Production S3 Bucket",
    "description": "Main production data storage",
    "location_type": "s3",
    "secret_id": "uuid-of-secret",
    "bucket_name": "my-prod-bucket",
    "region": "us-east-1"
}
```

Example for Azure Blob:
```json
{
    "name": "Azure Backup Storage",
    "location_type": "azure_blob",
    "secret_id": "uuid-of-secret",
    "bucket_name": "backup-container",
    "region": "eastus"
}
```



## OpenAPI

````yaml POST /v1/teams/{team_id}/locations
openapi: 3.1.0
info:
  title: Data Raven API
  description: Cloud-to-cloud data transfer platform powered by RClone
  version: 0.5.0
servers: []
security: []
paths:
  /v1/teams/{team_id}/locations:
    post:
      tags:
        - Locations
      summary: Create Location
      description: >-
        Create a new cloud storage location.


        **Required Role:** ADMIN or OWNER


        **Tier Limits:**

        - Free Tier: Maximum 4 locations

        - Pro Tier: Maximum 100 locations


        Locations define cloud storage endpoints (buckets/containers). RClone
        configuration

        options are set at the Task level, not here.


        Example request body for S3:

        ```json

        {
            "name": "Production S3 Bucket",
            "description": "Main production data storage",
            "location_type": "s3",
            "secret_id": "uuid-of-secret",
            "bucket_name": "my-prod-bucket",
            "region": "us-east-1"
        }

        ```


        Example for Azure Blob:

        ```json

        {
            "name": "Azure Backup Storage",
            "location_type": "azure_blob",
            "secret_id": "uuid-of-secret",
            "bucket_name": "backup-container",
            "region": "eastus"
        }

        ```
      operationId: create_location_v1_teams__team_id__locations_post
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationDetailResponse'
        '400':
          description: Invalid location data or secret not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Failed to create location
      security:
        - HTTPBearer: []
components:
  schemas:
    LocationCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Location name
        description:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Description
          description: Optional description
        location_type:
          $ref: '#/components/schemas/LocationType'
          description: Cloud provider type
        secret_id:
          type: string
          format: uuid
          title: Secret Id
          description: ID of the secret containing credentials
        bucket_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Bucket Name
          description: Bucket/container name
        region:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Region
          description: Cloud provider region
        endpoint_url:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          title: Endpoint Url
          description: Custom endpoint URL (for S3-compatible providers)
      type: object
      required:
        - name
        - location_type
        - secret_id
        - bucket_name
      title: LocationCreate
      description: >-
        Schema for creating a new cloud storage location.


        Locations define cloud storage endpoints (buckets/containers) that can
        be used

        as sources or destinations in data transfer tasks. RClone configuration
        options

        are set at the Task level, not here.
    LocationDetailResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        location_type:
          $ref: '#/components/schemas/LocationType'
        bucket_name:
          type: string
          title: Bucket Name
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
        endpoint_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Endpoint Url
        last_verified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Verified At
        last_verification:
          anyOf:
            - $ref: '#/components/schemas/LocationVerificationSummary'
            - type: 'null'
          description: >-
            Most recent verification attempt (success or failure) for health
            badge. last_verified_at only updates on success — this field
            reflects the actual most recent run regardless of outcome.
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_by:
          type: string
          format: uuid
          title: Created By
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
          description: Email of user who created this location
        updated_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Updated By
          description: User who last updated this location
        updated_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By Email
          description: Email of user who last updated this location
        secret_id:
          type: string
          format: uuid
          title: Secret Id
        secret_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Secret Name
          description: Name of the linked secret
        usage_stats:
          $ref: '#/components/schemas/LocationUsageStats'
        tasks_as_source:
          items:
            $ref: '#/components/schemas/LinkedTask'
          type: array
          title: Tasks As Source
          description: Tasks using this location as source
        tasks_as_destination:
          items:
            $ref: '#/components/schemas/LinkedTask'
          type: array
          title: Tasks As Destination
          description: Tasks using this location as destination
      type: object
      required:
        - id
        - name
        - description
        - location_type
        - bucket_name
        - region
        - endpoint_url
        - last_verified_at
        - created_at
        - updated_at
        - created_by
        - secret_id
        - usage_stats
      title: LocationDetailResponse
      description: Schema for detailed location information.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LocationType:
      type: string
      enum:
        - s3
        - azure_blob
        - gcs
        - r2
        - b2
        - wasabi
        - railway
        - oracle_object_storage_s3
        - s3_compatible
        - tigris
        - digitalocean_spaces
        - hetzner
        - rabata
      title: LocationType
      description: Cloud storage provider types.
    LocationVerificationSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        verified:
          type: boolean
          title: Verified
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        created_at:
          type: string
          format: date-time
          title: Created At
        can_list:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Can List
        can_read:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Can Read
        can_write:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Can Write
        can_delete:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Can Delete
      type: object
      required:
        - id
        - verified
        - created_at
      title: LocationVerificationSummary
      description: >-
        Compact verification record for embedding in list responses.


        Drives the health badge on LocationList — we need verified + timestamp

        plus the three-state permission flags so the list can distinguish fully

        verified from "verified but with permission gaps" (e.g. read-only
        users).
    LocationUsageStats:
      properties:
        tasks_as_source:
          type: integer
          title: Tasks As Source
          description: Number of tasks using this as source
        tasks_as_destination:
          type: integer
          title: Tasks As Destination
          description: Number of tasks using this as destination
      type: object
      required:
        - tasks_as_source
        - tasks_as_destination
      title: LocationUsageStats
      description: Statistics about location usage in tasks.
    LinkedTask:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: LinkedTask
      description: Minimal task info for navigation links.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````