Introduction
Welcome to the DevAPI documentation. DevAPI is a unified API platform that provides everything you need to build, secure, and scale modern applications. Whether you are building a simple script or a complex microservices architecture, our tools are designed to stay out of your way.
Blazing Fast
Sub-50ms latency across 200+ global edge locations.
Secure by Default
Built-in rate limiting, JWT, and OAuth 2.0 validation.
Quick Start
The fastest way to interact with DevAPI is by using our official official SDK. It's fully typed and supports auto-completion in modern editors.
1. Installation
2. Initialize the Client
import { DevAPI } from '@devapi/sdk';
const client = new DevAPI({
apiKey: process.env.DEVAPI_KEY,
environment: 'production'
});
// Example: Fetch user details
const user = await client.users.get('usr_123');
console.log(user.name);
Authentication
DevAPI uses API keys to authenticate requests. You can view and manage your API keys in the DevAPI Dashboard.
Keep your keys safe
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, etc.
All API requests must be made over
HTTPS. Calls made over plain HTTP will fail. API requests without
authentication will also fail.
curl https://api.devapi.com/v1/users \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"
Routing & Endpoints
DevAPI follows RESTful conventions. We use standard HTTP methods and standard HTTP status codes to indicate the success or failure of requests.
Rate Limiting
To ensure consistent performance for all users, DevAPI limits the number of API requests you can make in a given period.
Limit Exceeded
If you exceed the rate limit, the API will respond with a
429 Too Many Requests
status code.
Headers
Every API response includes headers detailing your current rate limit status:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 998
X-RateLimit-Reset: 1617235200
Error Handling
DevAPI uses conventional HTTP response codes to indicate the success or failure of an API request. Errors are returned in a standard JSON format.
{
"error": {
"code": "invalid_parameter",
"message": "The email address provided is invalid.",
"param": "email"
}
}
Webhooks New
Webhooks allow your application to receive real-time notifications when certain events happen in your DevAPI account.
Verifying Signatures
We sign every webhook event we send to your endpoint. You should verify this signature to ensure the payload was sent by DevAPI.
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const hash = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return hash === signature;
}
Generating SDKs
DevAPI can automatically generate type-safe SDKs based on your OpenAPI specification. This saves hundreds of hours of manual boilerplate code.