> For the complete documentation index, see [llms.txt](https://docs.bugsplat.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugsplat.com/api-reference/api/databases.md).

# Databases

API Documentation for the BugSplat Databases Endpoint

Operations related to a user or company's databases in BugSplat. Get a list of databases for the currently authenticated user or company, create a new database, transfer a database's ownership to another company, or delete a database.

## Get Databases

<mark style="color:blue;">`GET`</mark> `https://app.bugsplat.com/api/databases`

Returns databases for the current user or a company specified by companyId.

#### Query Parameters

| Name      | Type   | Description                               |
| --------- | ------ | ----------------------------------------- |
| companyId | number | ID of the company that owns the databases |

{% tabs %}
{% tab title="200 " %}

```json
[{
    "uId": 55411,
    "dbId": 25,
    "dbName": "Fred",
    "rights": 1,
    "companyId": 545,
    "companyName": "BugSplat Public Testing",
    "Rights": 1
}]
```

{% endtab %}

{% tab title="200 (companyId) " %}

```json
[{
    "dbName": "Fred",
    "companyId": 545,
    "companyName": "BugSplat Public Testing"
}]
```

{% endtab %}
{% endtabs %}

### Curl Example

```bash
curl --location 'https://app.bugsplat.com/api/databases' \
--header 'Cookie: user=fred%40bugsplat.com; PHPSESSID=4g3pr9rdtehoddac9ohrt1qrc3cehg54; xsrf-token=ajKqRF12QJJ3IlLFdCEH0RhMjpuD5scz86mul3zdjTYA'
```

## Create Database

<mark style="color:green;">`POST`</mark> `https://app.bugsplat.com/api/databases`

Create a new database for the current user. Default values for the new database are copied from the current database.

#### Request Body

| Name                                       | Type   | Description                        |
| ------------------------------------------ | ------ | ---------------------------------- |
| database<mark style="color:red;">\*</mark> | string | Name of the database being created |

{% tabs %}
{% tab title="200 " %}

```json
{
    "status": "success",
    "database": "fred"
}
```

{% endtab %}
{% endtabs %}

### Curl Example

```bash
curl --location 'https://app.bugsplat.com/api/databases' \
--header 'xsrf-token: ajKqRF12QJJ3IlLFdCEH0RhMjpuD5scz86mul3zdjTYA' \
--header 'Cookie: user=fred%40bugsplat.com; PHPSESSID=4g3pr9rdtehoddac9ohrt1qrc3cehg54; xsrf-token=ajKqRF12QJJ3IlLFdCEH0RhMjpuD5scz86mul3zdjTYA' \
--form 'database="postman-4f17b3f4-7ff0-497c-b3ec-94b333c05bd6"'
```

## Update Databases

<mark style="color:orange;">`PUT`</mark> `https://app.bugsplat.com/api/databases`

Transfer ownership of a database to another company.

#### Request Body

| Name      | Type   | Description                                            |
| --------- | ------ | ------------------------------------------------------ |
| companyId | number | ID of the company the database is being transferred to |
| database  | string | Name of the database being transferred                 |

{% tabs %}
{% tab title="200 " %}

```json
{
    "status": "success",
    "database": "fred",
    "companyId": 25
}
```

{% endtab %}
{% endtabs %}

## Delete Database

<mark style="color:red;">`DELETE`</mark> `https://app.bugsplat.com/api/databases`

Deletes a database and all associated data from BugSplat. This action is irreversible

#### Query Parameters

| Name     | Type   | Description                 |
| -------- | ------ | --------------------------- |
| database | string | BugSplat database to delete |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "database": "fred",
    "deleted": true
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugsplat.com/api-reference/api/databases.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
