mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
54 lines
2.5 KiB
Plaintext
54 lines
2.5 KiB
Plaintext
---
|
|
title: API Authentication
|
|
description: Learn how to create a Documenso API key and authenticate your API requests.
|
|
---
|
|
|
|
# API Authentication
|
|
|
|
Documenso uses API keys for authentication. An API key is a unique token that is generated for each client. The client must provide the key whenever it makes an API call. This way, Documenso can identify the clients making the requests and authorize their access to the API.
|
|
|
|
## Creating an API Key
|
|
|
|
To create an API key, navigate to the user settings page. Click on your avatar in the top right corner of the dashboard and select "Team Settings" from the dropdown menu.
|
|
|
|

|
|
|
|
Once you're on the settings page, navigate to the **API Tokens** tab. This page lists your existing keys and enables you to create new ones.
|
|
|
|

|
|
|
|
To create a new API key, you must:
|
|
|
|
- Choose a name (e.g. "zapier-key")
|
|
- We recommend using a descriptive name that helps you quickly identify the key and its purpose.
|
|
- Choose an expiration date
|
|
- You can set the key never to expire or choose when to become invalid: 7 days, 1 month, 3 months, 6 months, or 1 year.
|
|
|
|
After providing the required information, click the "Create token" button to generate the API key.
|
|
|
|

|
|
|
|
Once you've created the token, Documenso will display the key on the screen. Make sure to copy the key and store it securely. You won't be able to see the key again once you refresh/leave the page.
|
|
|
|
## Using the API Key
|
|
|
|
You must include the API key in the `Authorization` request header to authenticate your API requests. The format is `Authorization: api_xxxxxxxxxxxxxxxx`.
|
|
|
|
Here's a sample API request using cURL:
|
|
|
|
```bash
|
|
curl --location 'https://app.documenso.com/api/v2/envelope/create' \
|
|
--header 'Authorization: api_xxxxxxxxxxxxxxxx' \
|
|
--form 'payload={ "title": "Some Title", "type": "DOCUMENT" }'
|
|
```
|
|
|
|
Here's a sample response from the API based on the above cURL request:
|
|
|
|
```json
|
|
{
|
|
"id": "envelope_xxxxxxxxxxxxx"
|
|
}
|
|
```
|
|
|
|
The API key has access to your account and all its resources. Please keep it secure and do not share it with others. If you suspect your key has been compromised, you can revoke it from the same page you created it from.
|