API Documentation

Integrate Quadrant with your applications using our comprehensive REST API for OKR management.

Overview

The Quadrant API provides programmatic access to all OKR management features. Our API follows REST principles and returns JSON responses with standard HTTP status codes.

Base URLs

Production: https://api.mygoals.io/v1
Staging: https://api-staging.mygoals.io/v1

Response Format

All responses are JSON with the following structure:

{
  "success": true,
  "data": { ... },
  "meta": { ... },
  "errors": null
}

Authentication

Quadrant API uses Bearer token authentication. Include your API key in the Authorization header for all requests.

API Key Authentication

Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with your actual API key from the dashboard.

Getting Your API Key

  1. Log into your Quadrant dashboard
  2. Navigate to your profile settings
  3. Go to the "API Keys" section
  4. Generate a new API key
  5. Copy and securely store your API key

Data Models

Objective

{
  "id": 1,
  "title": "Increase Revenue",
  "description": "Grow quarterly revenue by 25%",
  "user_id": 1,
  "created_at": "2024-12-15T10:30:00Z",
  "updated_at": "2024-12-15T10:30:00Z"
}

Key Result

{
  "id": 1,
  "objective_id": 1,
  "title": "Increase customer acquisition",
  "description": "Acquire 1000 new customers",
  "target_value": 1000,
  "current_value": 750,
  "unit": "customers",
  "created_at": "2024-12-15T10:30:00Z",
  "updated_at": "2024-12-15T10:30:00Z"
}

Priority

{
  "id": 1,
  "title": "Complete Q1 planning",
  "description": "Finalize quarterly objectives and key results",
  "user_id": 1,
  "position": 1,
  "completed": false,
  "created_at": "2024-12-15T10:30:00Z",
  "updated_at": "2024-12-15T10:30:00Z"
}

Project

{
  "id": 1,
  "title": "Mobile app launch",
  "description": "Launch new mobile application",
  "user_id": 1,
  "status": "in_progress",
  "created_at": "2024-12-15T10:30:00Z",
  "updated_at": "2024-12-15T10:30:00Z"
}

Health Metric

{
  "id": 1,
  "title": "Team Morale",
  "description": "Maintain team satisfaction above 8/10",
  "user_id": 1,
  "current_value": 8.5,
  "target_value": 8.0,
  "status": "green",
  "created_at": "2024-12-15T10:30:00Z",
  "updated_at": "2024-12-15T10:30:00Z"
}

Objectives

List Objectives

GET /api/v1/objectives

Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Increase Revenue",
      "description": "Grow quarterly revenue by 25%",
      "user_id": 1,
      "created_at": "2024-12-15T10:30:00Z",
      "updated_at": "2024-12-15T10:30:00Z"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "per_page": 20
  }
}

Get Objective

GET /api/v1/objectives/{id}

Response

{
  "success": true,
  "data": {
    "id": 1,
    "title": "Increase Revenue",
    "description": "Grow quarterly revenue by 25%",
    "user_id": 1,
    "key_results": [
      {
        "id": 1,
        "title": "Increase customer acquisition",
        "current_value": 750,
        "target_value": 1000
      }
    ],
    "created_at": "2024-12-15T10:30:00Z",
    "updated_at": "2024-12-15T10:30:00Z"
  }
}

Create Objective

POST /api/v1/objectives

Request Body

{
  "title": "Improve Customer Satisfaction",
  "description": "Increase customer satisfaction score to 9.0"
}

Response

{
  "success": true,
  "data": {
    "id": 2,
    "title": "Improve Customer Satisfaction",
    "description": "Increase customer satisfaction score to 9.0",
    "user_id": 1,
    "created_at": "2024-12-15T11:00:00Z",
    "updated_at": "2024-12-15T11:00:00Z"
  }
}

Update Objective

PUT /api/v1/objectives/{id}

Request Body

{
  "title": "Increase Revenue by 30%",
  "description": "Grow quarterly revenue by 30% through improved sales"
}

Delete Objective

DELETE /api/v1/objectives/{id}

Response

{
  "success": true,
  "message": "Objective deleted successfully"
}

Key Results

List Key Results

GET /api/v1/key_results

Query Parameters

  • objective_id - Filter by objective ID
  • page - Page number (default: 1)
  • per_page - Items per page (default: 20)

Create Key Result

POST /api/v1/key_results

Request Body

{
  "objective_id": 1,
  "title": "Improve website conversion rate",
  "description": "Increase website conversion rate from 2% to 3%",
  "target_value": 3.0,
  "current_value": 2.0,
  "unit": "percentage"
}

Update Key Result

PUT /api/v1/key_results/{id}

Request Body

{
  "current_value": 2.5,
  "title": "Improve website conversion rate to 3.5%"
}

Priorities

List Priorities

GET /api/v1/priorities

Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Complete Q1 planning",
      "description": "Finalize quarterly objectives and key results",
      "position": 1,
      "completed": false,
      "created_at": "2024-12-15T10:30:00Z"
    }
  ]
}

Create Priority

POST /api/v1/priorities

Request Body

{
  "title": "Review team metrics",
  "description": "Analyze current team performance metrics"
}

Update Priority Position

PUT /api/v1/priorities/{id}

Request Body

{
  "position": 2,
  "completed": true
}

Projects

List Projects

GET /api/v1/projects

Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Mobile app launch",
      "description": "Launch new mobile application",
      "status": "in_progress",
      "created_at": "2024-12-15T10:30:00Z"
    }
  ]
}

Create Project

POST /api/v1/projects

Request Body

{
  "title": "API integration",
  "description": "Integrate with third-party APIs",
  "status": "planned"
}

Health Metrics

List Health Metrics

GET /api/v1/health_metrics

Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Team Morale",
      "description": "Maintain team satisfaction above 8/10",
      "current_value": 8.5,
      "target_value": 8.0,
      "status": "green",
      "created_at": "2024-12-15T10:30:00Z"
    }
  ]
}

Create Health Metric

POST /api/v1/health_metrics

Request Body

{
  "title": "Code Quality",
  "description": "Keep bug reports below 5 per week",
  "current_value": 3,
  "target_value": 5,
  "unit": "bugs_per_week"
}

Update Health Metric

PUT /api/v1/health_metrics/{id}

Request Body

{
  "current_value": 4,
  "status": "yellow"
}

Error Handling

The API uses standard HTTP status codes and returns error details in the response body.

Common Status Codes

200 - Success
201 - Created
400 - Bad Request
401 - Unauthorized
404 - Not Found
422 - Validation Error
500 - Server Error

Error Response Format

{
  "success": false,
  "errors": [
    {
      "field": "title",
      "message": "Title cannot be blank"
    }
  ],
  "message": "Validation failed"
}

Rate Limiting

API requests are rate limited to ensure fair usage and system stability.

Rate Limits

  • Free Plan: 1,000 requests per hour
  • Pro Plan: 10,000 requests per hour
  • Enterprise: Custom limits

Rate Limit Headers

X-RateLimit-Limit - Maximum requests per hour
X-RateLimit-Remaining - Remaining requests in current hour
X-RateLimit-Reset - Time when rate limit resets (Unix timestamp)

Code Examples

JavaScript (Fetch API)

const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://api.mygoals.io/v1';

// List objectives
async function getObjectives() {
  const response = await fetch(`${BASE_URL}/objectives`, {
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    }
  });
  
  const data = await response.json();
  return data;
}

// Create a new objective
async function createObjective(objective) {
  const response = await fetch(`${BASE_URL}/objectives`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(objective)
  });
  
  const data = await response.json();
  return data;
}

// Example usage
createObjective({
  title: 'Improve Customer Satisfaction',
  description: 'Increase customer satisfaction score to 9.0'
}).then(data => console.log(data));

Python (requests)

import requests

API_KEY = 'your_api_key_here'
BASE_URL = 'https://api.mygoals.io/v1'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Content-Type': 'application/json'
}

# List objectives
def get_objectives():
    response = requests.get(f'{BASE_URL}/objectives', headers=headers)
    return response.json()

# Create a new objective
def create_objective(title, description):
    data = {
        'title': title,
        'description': description
    }
    response = requests.post(f'{BASE_URL}/objectives', headers=headers, json=data)
    return response.json()

# Example usage
objective = create_objective(
    'Improve Customer Satisfaction',
    'Increase customer satisfaction score to 9.0'
)
print(objective)

Ruby (net/http)

require 'net/http'
require 'json'

API_KEY = 'your_api_key_here'
BASE_URL = 'https://api.mygoals.io/v1'

# List objectives
def get_objectives
  uri = URI("#{BASE_URL}/objectives")
  request = Net::HTTP::Get.new(uri)
  request['Authorization'] = "Bearer #{API_KEY}"
  request['Content-Type'] = 'application/json'
  
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
  end
  
  JSON.parse(response.body)
end

# Create a new objective
def create_objective(title, description)
  uri = URI("#{BASE_URL}/objectives")
  request = Net::HTTP::Post.new(uri)
  request['Authorization'] = "Bearer #{API_KEY}"
  request['Content-Type'] = 'application/json'
  request.body = {
    title: title,
    description: description
  }.to_json
  
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
  end
  
  JSON.parse(response.body)
end

# Example usage
objective = create_objective(
  'Improve Customer Satisfaction',
  'Increase customer satisfaction score to 9.0'
)
puts objective

Getting Started

Ready to integrate Quadrant into your application? Follow these steps:

1

Get your API key

Generate an API key from your Quadrant dashboard

2

Test the API

Use the examples above to make your first API call

3

Build your integration

Start building your OKR management integration