🚀 Devdraft Launch Week I is live! Sign up for exclusive access and early features. Learn more →
English
Developers
API documentation and developer resources
How to authenticate your API requests to Devdraft
pk_live_...
sk_live_...
pk_test_...
sk_test_...
Key Permissions
Authorization
curl https://api.devdraft.ai/v1/customers \ -H "Authorization: Bearer sk_test_your_secret_key_here" \ -H "Content-Type: application/json"
curl https://api.devdraft.ai/v1/customers \ -u sk_test_your_secret_key_here: \ -H "Content-Type: application/json"
Authorization: Bearer sk_test_your_secret_key_here Content-Type: application/json
Idempotency-Key: unique_request_identifier User-Agent: YourApp/1.0 X-API-Version: 2024-01-01
const axios = require('axios'); const devdraft = axios.create({ baseURL: 'https://api.devdraft.ai/v1', headers: { 'Authorization': 'Bearer sk_test_your_secret_key_here', 'Content-Type': 'application/json' } }); // Make a request const response = await devdraft.get('/customers');
# .env file DEVDRAFT_SECRET_KEY=sk_test_your_secret_key_here DEVDRAFT_PUBLISHABLE_KEY=pk_test_your_publishable_key_here
{ "error": { "type": "authentication_error", "message": "Invalid API key provided" } }
{ "error": { "type": "permission_error", "message": "This API key does not have permission to perform this action" } }
curl https://api.devdraft.ai/v1/account \ -H "Authorization: Bearer sk_test_your_secret_key_here"