> For the complete documentation index, see [llms.txt](https://drop-cowboy.gitbook.io/drop-cowboy-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://drop-cowboy.gitbook.io/drop-cowboy-docs/getting-started/api-credentials.md).

# API Credentials

To access the Drop Cowboy API, you must first complete the **Know Your Customer (KYC)** process.\
This includes verifying your identity and registering your brand(s) in the **Drop Cowboy Trust Center**.

Once approved, you’ll receive a **Team ID** and **Secret Key** used to authenticate requests to the API.

***

### Getting Your Credentials <a href="#get-your-api-credentials" id="get-your-api-credentials"></a>

1. Log in to your Drop Cowboy account.
2. Navigate to **My Account → API**.
3. Locate your:
   1. `team_id`
   2. `secret`

<div align="left"><figure><img src="/files/MTev5Cafhldp7h7wm2eg" alt=""><figcaption></figcaption></figure></div>

> ⚠️ **Keep these credentials secure.**\
> Do not share them publicly or include them in client-side code (such as browser JavaScript).
>
> If you're working with a developer or a third-party integration, share these keys only with trusted partners.

***

### Using Credentials in the API

When calling the Drop Cowboy API directly, include your credentials in each request:

* For **HTTP** operations → include in the **request headers**

#### Example (GET request)

```bash
curl -X GET "https://api.dropcowboy.com/v1/brand" \
  -H "x-team-id: YOUR_TEAM_ID" \
  -H "x-secret: YOUR_SECRET"
```

***

### Using Credentials with the Drop Cowboy SDK

The Drop Cowboy SDK allows you to authenticate globally or per instance.

#### Option 1 — Global Configuration

Create a config file at `~/.dropcowboyrc`:

```json
{
  "teamId": "your-team-id",
  "secret": "your-secret",
  "baseUrl": "https://api.dropcowboy.com/v1"
}
```

> `baseUrl` is optional — it defaults to `https://api.dropcowboy.com/v1`.

Once created, any SDK instance you initialize will automatically use these credentials.

#### Option 2 — Per-instance Configuration

You can also pass credentials directly when initializing the client.

```javascript
import { DropCowboy } from "dropcowboy";

const dropcowboy = new DropCowboy({
  teamId: "your-team-id",
  secret: "your-secret",
});

// Example: fetch all brands
const brands = await dropcowboy.listBrands();
console.log(brands);
```

***

### Best Practices

* Store your credentials securely (e.g., environment variables or secrets manager).
* Never commit your keys to version control (like GitHub).
* Rotate keys periodically for better security.

> 💡 **Tip:**\
> If you receive an “Unauthorized” or “Missing Credentials” error, double-check your `x-team-id` and `x-secret` values or verify that your API access has been approved in the Trust Center.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://drop-cowboy.gitbook.io/drop-cowboy-docs/getting-started/api-credentials.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
