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

# Check if collection exists

> Check whether a collection with the given name exists in the database.



## OpenAPI

````yaml get /collections/{collection_name}/exists
openapi: 3.0.3
info:
  title: Actian VectorAI DB - Collections API
  description: Collection management API for Actian VectorAI DB.
  version: 1.0.0
  contact:
    name: Actian Corporation
    url: https://www.actian.com
servers:
  - url: http://localhost:6573
    description: Local development server (REST API)
  - url: https://api.vectorai.actian.com
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Collections
    description: Collection lifecycle management operations
paths:
  /collections/{collection_name}/exists:
    get:
      tags:
        - Collections
      summary: Check if collection exists
      description: Check whether a collection with the given name exists in the database.
      operationId: collection_exists
      parameters:
        - name: collection_name
          in: path
          required: true
          description: The name of the collection to check.
          schema:
            type: string
            example: my_collection
      responses:
        '200':
          description: Collection existence status
          content:
            application/json:
              schema:
                type: object
                properties:
                  usage:
                    type: object
                    properties:
                      hardware:
                        type: object
                        nullable: true
                        description: >-
                          Hardware resource counters for the operation,
                          including CPU, payload I/O, payload index I/O, and
                          vector I/O metrics.
                  time:
                    type: number
                    format: double
                    example: 0.000002404
                    description: Time spent to process this request, in seconds.
                  status:
                    type: string
                    example: ok
                    description: Operation status.
                  result:
                    type: object
                    properties:
                      exists:
                        type: boolean
                        example: true
                        description: Whether the collection exists.
              examples:
                success:
                  value:
                    usage:
                      hardware: null
                    time: 0.000002404
                    status: ok
                    result:
                      exists: true
      x-codeSamples:
        - lang: Python
          label: Check collection exists
          source: |
            from actian_vectorai_client import VectorAIClient

            with VectorAIClient("localhost:6574") as client:
                # Check if collection exists
                exists = client.collections.exists("my_collection")
                print(f"Collection exists: {exists}")
        - lang: JavaScript
          label: Check collection exists
          source: |
            import { VectorAIClient } from '@actian/vectorai-client';

            const client = new VectorAIClient('localhost:6574');

            const exists = await client.collections.exists('my_collection');
            console.log(`Collection exists: ${exists}`);

            client.close();
        - lang: cURL
          label: Check exists
          source: >
            curl -X GET "http://localhost:6573/collections/my_collection/exists"
            \
              -H "Accept: application/json" \
              -H 'Authorization: Bearer <admin-jwt-or-access-token>'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Admin JWT or access token for authenticating requests to VectorAI DB.

````

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