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

# Authentication

> Learn how to obtain your Tickify Partner API key, generate an access token, and authenticate API requests step by step.

# Authentication

To use the Tickify Partner API, you need two things:

1. **API Key:** A credential provided by a Tickify administrator to identify your partner integration.
2. **Access Token:** A temporary token generated using your API key. You use this token to access protected API endpoints.

Think of your API key as the credential you use to request access, and the access token as the credential you present when making API requests.

Follow the steps below to get started.

## Step 1: Request an API Key

Before making API requests, you must obtain an API key from a Tickify administrator.

Contact [info@tickify.io](mailto:info@tickify.io) after completing your partner registration. Include your registered name, registration email, platform name, and whether you need a testing or live API key.

Tickify supports two types of API keys:

| Key type | Prefix | Purpose |
| - | - | - |
| Test key | `tk_test_` | For development and testing your integration. |
| Live key | `tk_live_` | For accessing the live environment, subject to approval and configuration. |

**Important:** Keep your API key private. Do not share it publicly or place it in frontend code, public repositories, or mobile applications.

## Step 2: Generate an Access Token

Once you have received your API key, use it to request an access token.

You do not need to create an access token manually. The authentication endpoint generates one for you when you submit a valid API key.

### Request an access token

For the staging environment, run the following command in your terminal:

```bash theme={null}
curl -X POST 'https://api-staging.tickify.io/partners/auth/token' \
  -H 'Content-Type: application/json' \
  -d '{"apiKey":"YOUR_API_KEY"}'
```

Replace `YOUR_API_KEY` with the API key provided by your Tickify administrator.

For example, if you received a test key, the request body would contain your `tk_test_` key.

**What happens next?**

1. Your application sends the API key to Tickify's authentication endpoint.
2. Tickify validates the API key.
3. If the key is valid, the endpoint returns an access token.
4. You use that access token when calling protected API endpoints.

If the request fails, check that your API key is correct and that you are using the appropriate environment.

### View the endpoint documentation

For the endpoint's exact request format, response structure, and any additional requirements, see [Get Access Token for Authenticated Partner](https://partner-docs.tickify.io/partner-docs/api-reference/partner-auth/get-access-token-for-authenticated-partner).

## Step 3: Copy Your Access Token

If your API key is valid, the endpoint will return a response containing an access token.

The exact response structure is documented on the access-token endpoint page.

Copy the returned token and keep it secure. You will use it in the next step.

**Remember:** Your API key and access token are different credentials. The API key is used to obtain the access token; the access token is used to authenticate requests to protected endpoints.

## Step 4: Use the Access Token to Call an API

Now that you have an access token, include it in the `Authorization` header when calling an endpoint that requires authentication.

For example:

```bash theme={null}
curl -X GET 'YOUR_API_ENDPOINT' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

Replace:

* `YOUR_API_ENDPOINT` with the actual endpoint URL you want to call.
* `YOUR_ACCESS_TOKEN` with the access token returned in Step 2.

The example above illustrates the authentication header. The HTTP method, endpoint URL, and any additional headers or request parameters depend on the API endpoint you want to use.

For a list of available endpoints, visit the [API Reference](https://partner-docs.tickify.io/partner-docs/api-reference).

## Step 5: Choose the Correct Environment

Always use credentials that correspond to the environment you are accessing.

* **Staging/testing:** Use your test API key and the staging API environment to test your integration.
* **Production/live:** Use your live API key and the corresponding production API environment provided by Tickify.

Do not assume that a staging access token or test API key will work in production. Contact Tickify if you need clarification about the correct production endpoint.

## Troubleshooting

| Problem | What to do |
| - | - |
| You do not have an API key | Email [info@tickify.io](mailto:info@tickify.io) to request one from a Tickify administrator. |
| Your API key is rejected | Check the key for typing errors and confirm that it belongs to the environment you are using. |
| You cannot obtain an access token | Review the authentication endpoint documentation and confirm that your request body contains the required `apiKey` field. |
| You receive an authentication error from a protected endpoint | Confirm that you are sending the access token in the `Authorization: Bearer` header. |
| You need a live API key | Contact Tickify to request production access and the appropriate live credentials. |

## Security Best Practices

* Never expose your API key or access token in public code.
* Store credentials in backend environment variables or a secrets manager.
* Do not commit credentials to GitHub, GitLab, or other source control repositories.
* Avoid sharing authentication responses containing tokens.
* If you suspect a credential has been compromised, contact Tickify for assistance.

## Quick Summary

1. Register as a Tickify partner.
2. Contact [info@tickify.io](mailto:info@tickify.io) to request a test or live API key.
3. Send your API key to the access-token endpoint.
4. Copy the returned access token.
5. Include the access token in the `Authorization: Bearer` header when calling protected endpoints.


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