OAuth Authentication
The Nerve API uses OAuth 2.0 for authentication. To get started, you’ll need to obtain your client credentials from our support team.To get your OAuth client ID and secret, please contact our support team at
[email protected]
OAuth Flow
The Nerve API follows the standard OAuth 2.0 authorization code flow. Here’s how it works:1. Authorization Request
Redirect users to the authorization endpoint to begin the OAuth flow:client_id: Your application’s client ID (obtained from support)redirect_uri: The URI where users will be redirected after authorizationresponse_type: Must becodefor authorization code flowscope: Space-separated list of requested permissionsstate: A random string to prevent CSRF attacks
2. User Authorization
The user will be redirected to Nerve’s authorization page where they can:- Log in to their Nerve account
- Review the permissions your application is requesting
- Grant or deny access
3. Authorization Code
If the user grants access, they’ll be redirected back to yourredirect_uri with an authorization code:
4. Exchange Code for Token
Exchange the authorization code for an access token:5. Using the Access Token
Include the access token in the Authorization header for all API requests:Token Refresh
Access tokens expire after a certain period. Use the refresh token to obtain a new access token:Scopes
The following scopes are available for the Nerve API:read: Read access to your Nerve datawrite: Write access to create and update dataadmin: Administrative access (if applicable)
Specific scope requirements may vary by endpoint. Check individual endpoint
documentation for required permissions.
Error Handling
If authentication fails, the API will return appropriate HTTP status codes and error messages:400 Bad Request: Invalid request parameters401 Unauthorized: Invalid or expired token403 Forbidden: Insufficient permissions500 Internal Server Error: Server error

