Request Specifications
Request URL
All APIs only accept access via HTTPS protocol and have a single Endpoint:Headers
Most requests use the POST method with JSON Payload parameters. Please ensure the correct Content-Type is set:Character Encoding
All APIs use UTF-8 encoding.Authentication
All Open APIs use APP Key for authentication.Obtaining an APP Key
1
Sign in to console
Sign in to the Flashduty Console
2
Create APP Key
Go to Account Settings → APP Key, enter a name, choose a permission scope, then click Add.
- All permissions: Does not add an API-scope restriction, but remains limited by the creator’s current role permissions.
- Custom permissions: Select at least one available API permission. The APP Key can call only APIs in the selected scope.
Usage Example
Pass the APP Key as a query string parameter:Using Go? Use the official Go SDK to call Flashduty — you get typed request parameters, response structs, and error codes out of the box, with no hand-written HTTP.
Response Structure
All request responses are in JSON format and follow a unified structure:Response Examples
- Success Response
- Error Response
Error Object Structure
Rate Limits
Rate Limits
To ensure service stability, APIs have rate limits on request frequency. When requests are too frequent, a429 status code with RequestTooFrequently error will be returned.
Permission Limits
- An APP Key with All permissions has no additional API-scope restriction, but remains limited by the creator’s current role permissions
- Custom permissions requires at least one selected API permission; the APP Key can call only APIs in that selected scope
- When an operation exceeds either the APP Key scope or the creator’s role permissions, a
403status code withAccessDeniederror is returned - It is recommended to create separate APP Keys for different purposes, following the principle of least privilege
Error Code List
Error Handling Recommendations
400 Parameter Error
400 Parameter Error
Possible causes:
- Missing required parameters
- Incorrect parameter format
- Content-Type not set to
application/json
401 Authentication Failed
401 Authentication Failed
Possible causes:
- APP Key not provided
- APP Key is incorrect or has expired
- Confirm that the request URL contains the
app_keyparameter - Go to the console to check if the APP Key is valid
403 Permission Denied
403 Permission Denied
Possible causes:
- Current user does not have permission to perform this operation
- The user corresponding to the APP Key has insufficient permissions
429 Too Many Requests
429 Too Many Requests
Possible causes:
- Too many requests sent in a short period
- Reduce request frequency
- Implement exponential backoff retry mechanism
- Combine multiple requests (e.g., use batch APIs)
500 Internal Error
500 Internal Error
Possible causes:
- Server-side internal exception
- Retry later
- If the issue persists, contact technical support and provide the
request_id
Best Practices
Implement Retry Mechanism
For network errors and 5xx errors, it is recommended to implement exponential backoff retry with an initial interval of 1 second and a maximum of 3 retries.
Record request_id
Save the
request_id returned from each request to facilitate troubleshooting and technical support.Protect APP Key
Do not hardcode APP Key in client code. It is recommended to manage it through environment variables or configuration centers.
Rotate Keys Regularly
Regularly replace APP Keys and promptly delete keys that are no longer in use to reduce the risk of leakage.