API Reference

Power your application with Partner.js's open API. Connect to our global developer network, access collaborative tools, and manage code-sharing workflows.

curl -X POST "https://api.partner.js/v1/code/share" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{ "code": "console.log('Hello Partner.js!');" }'
                

Need an API key? Create one here

API Endpoints

POST /v1/code/share

Share and store code snippets with version control

{
  "code": "string (required)",
  "language": "string",
  "isPublic": "boolean",
  "tags": "array of strings"
}
                    

Success Response

HTTP/1.1 201 Created
{
  "id": "string",
  "url": "string",
  "createdAt": "timestamp"
}
                            

Error Response

HTTP/1.1 400 Bad Request
{
  "error": "string",
  "message": "string"
}
                            

GET /v1/collaborators/:id

Retrieve collaboration details by ID

{
  "id": "string",
  "participants": "array of user objects",
  "sharedAt": "timestamp",
  "active": "boolean"
}
                    

Requires valid API key in Authorization header

Authentication

OAuth 2.0

  1. Register an application at Partner.js App Console
  2. Redirect users to https://auth.partner.js/v1/authorize
  3. Receive authorization code and exchange for token
curl -X POST "https://auth.partner.js/v1/token" \
  -d "grant_type=authorization_code" \
  -d "code=AUTHORIZATION_CODE" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"
                    

API Keys

Generate API keys in your account settings with granular permissions:

Code Sharing
  • • Create
  • • Read
  • • Modify
Collaboration
  • • Invite
  • • Manage
  • • Analyze

Getting Started

Authentication Setup

  1. 1. Register your application in the Partner.js developer console
  2. 2. Implement OAuth 2.0 flow or add API key headers
  3. 3. Handle token expiration with refresh tokens
Need help? Check out our authentication guide

Webhook Integration

Example event payload:

{
  "event": "collab.updated",
  "timestamp": "1678901234",
  "data": {
    "collabId": "string",
    "participants": ["user1", "user2"]
  }
}
                        
Read the Webhook Documentation →

Rate Limiting

  • • 1000 requests/minute for free tier
  • • 10,000 requests/minute for Pro tier
  • • Exponential backoff for rate-limited requests
Use Retry-After headers for throttled requests