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

> ## Agent Instructions
> This is the Sevalla REST API reference. Base URL: https://api.sevalla.com/v3. Authenticate with an API key in the Authorization header as a Bearer token.
> The OpenAPI spec is at https://api.sevalla.com/v3/openapi.json. Concepts and dashboard guides are at https://docs.sevalla.com (index: https://docs.sevalla.com/llms.txt).
> To act on a Sevalla account from an AI agent, prefer the Sevalla MCP server (https://mcp.sevalla.com/mcp, see https://docs.sevalla.com/ai-agents/overview.md) or the Sevalla CLI (https://api-docs.sevalla.com/v3/cli.md).

# List database backup targets

> Retrieve the backup targets attached to a database. A backup target is an S3-compatible bucket that receives scheduled and manual dump backups of the database. Storage credentials are never returned. Databases that do not support external backups return a 400.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json get /databases/{id}/backup-targets
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /databases/{id}/backup-targets:
    get:
      tags:
        - Databases
      summary: List database backup targets
      description: >-
        Retrieve the backup targets attached to a database. A backup target is
        an S3-compatible bucket that receives scheduled and manual dump backups
        of the database. Storage credentials are never returned. Databases that
        do not support external backups return a 400.
      operationId: listDatabaseBackupTargetsV3
      parameters:
        - schema:
            example: fb5e5168-4281-4bec-94c5-0d1584e9e657
            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)$
          in: path
          name: id
          required: true
          description: Database identifier
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: array
                items:
                  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)$
                      description: Backup target identifier
                      example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                    name:
                      type: string
                      description: >-
                        System-generated slug of the backup target, used in dump
                        file names and the backup schedule job name
                      example: daily-offsite
                    display_name:
                      type: string
                      description: Human-readable name of the backup target
                      example: Daily offsite
                    schedule:
                      anyOf:
                        - type: string
                        - type: 'null'
                      description: >-
                        Cron schedule of the automatic dump backups, in standard
                        5-field cron syntax (UTC). Null means a daily run at a
                        stable, automatically assigned time between 00:00 and
                        05:59 UTC.
                      example: 15 3 * * *
                    is_enabled:
                      type: boolean
                      description: >-
                        Whether automatic scheduled backups to this target are
                        enabled
                      example: true
                    retention_days:
                      type: number
                      description: >-
                        Days automatic backups are kept in the bucket before
                        being pruned
                      example: 7
                    manual_retention_days:
                      type: number
                      description: >-
                        Days manual backups are kept in the bucket before being
                        pruned. 0 keeps manual backups forever.
                      example: 14
                    prefix:
                      anyOf:
                        - type: string
                        - type: 'null'
                      description: >-
                        Object key prefix for the dump files inside the bucket.
                        Null uses the default per-database prefix.
                      example: my-app/db-backups
                    object_storage_id:
                      anyOf:
                        - 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)$
                        - type: 'null'
                      description: >-
                        Identifier of the Sevalla object storage bucket this
                        target uploads to. Null when the target uses external
                        S3-compatible storage with customer-provided
                        credentials.
                      example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                    bucket_name:
                      type: string
                      description: Name of the destination bucket
                      example: my-backups
                    endpoint:
                      anyOf:
                        - type: string
                        - type: 'null'
                      description: S3-compatible endpoint URL of the destination storage
                      example: https://account.r2.cloudflarestorage.com
                    region:
                      anyOf:
                        - type: string
                        - type: 'null'
                      description: Region of the destination storage
                      example: auto
                    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))$
                      description: >-
                        Timestamp when the backup target was created, in ISO
                        8601 format
                      example: '2025-01-30T00:00:00.000Z'
                    updated_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))$
                      description: >-
                        Timestamp when the backup target was last updated, in
                        ISO 8601 format
                      example: '2025-01-30T00:00:00.000Z'
                  required:
                    - id
                    - name
                    - display_name
                    - schedule
                    - is_enabled
                    - retention_days
                    - manual_retention_days
                    - prefix
                    - object_storage_id
                    - bucket_name
                    - endpoint
                    - region
                    - created_at
                    - updated_at
                  additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Bad request
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 400
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unauthorized
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 401
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: >-
                      This API key is missing the <RESOURCE>:<ACTION>
                      permission. Grant it to the key or use a key that has it.
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 403
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Not found
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 404
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.