Skip to main content

REST API

About 2 min

REST API

The system provides a REST API for automating core tasks, such as retrieving and modifying diagrams, and managing architecture elements. The API operates over the HTTP protocol with JSON serialization.

Cloud version limitations

The cloud version enforces limitations on API usage regarding request rate and size.


Authentication

Obtaining the API Key

To obtain the API key, follow these steps:

  1. Navigate to the "Team" section
  2. Open the "Team Settings" tab
  3. Click "Generate Key"

API Key Generation

Using the key

ParameterValueDescription
HeaderX-Api-KeyAdd to all API requests
PermissionsTeam administratorActions are performed on behalf of the administrator
SecurityConfidentialDo not share the key with third parties

Cloud Version Limitations

Default Limits

ParameterValueDescription
Request rate5 requests/minuteCheck the X-Rate-Limit-Remaining header
Request size10 MBMaximum size of a single request
Diagrams per request20For diagram loading methods

Limit Exceeded

Upon reaching the quota:

{
    "timestamp": "2022-06-28T12:03:03.438+00:00",
    "status": 429,
    "error": "Too Many Requests",
    "message": "You have exhausted your API Request Quota",
    "path": "/public-api/v1/upload-diagrams"
}

Response headers:

  • X-Rate-Limit-Remaining - remaining requests
  • X-Rate-Limit-Retry-After-Seconds - wait time until the next attempt

Account Lockout

If the limit is exceeded more than 3 times within 24 hours, the account will be locked. Contact support to unlock it.


Reference sections

Changing architecture element types

Built-in architecture element types (except Document and System) are now classified as Custom types. This affects the format of API requests and data import rules.


Best Practices

Query Optimization

RecommendationDescription
Batch processingSend up to 20 diagrams at a time
Compliance with limitsMonitor rate limit headers
Retry logicImplement retries with backoff
LoggingStore request IDs for debugging

Security

AspectRecommendation
API keysStore them in environment variables
HTTPSUse only secure connections
Access rightsRestrict API key permissions
RotationRegularly update keys

Monitoring

  • Track limits via response headers
  • Log errors for problem analysis
  • Monitor API response time
  • Analyze quota usage

CI/CD Integration

Integrate the API into deployment pipelines to automatically update diagrams after code changes.


Related sections