Opportunities API
The Opportunities API provides comprehensive endpoints for managing job offers, project requests, and collaboration opportunities within the Ring platform. It supports full CRUD operations, file uploads, search functionality, and role-based access control.
Base URLβ
https://ring.platform/api/opportunities
Authenticationβ
Most endpoints require authentication via NextAuth.js session or API key. Role-based access control is enforced based on user permissions.
Endpoints Overviewβ
GET /api/opportunities
- List opportunities with filtering and paginationGET /api/opportunities/[id]
- Get specific opportunity detailsPOST /api/opportunities/create
- Create new opportunityPUT /api/opportunities/update
- Update existing opportunityDELETE /api/opportunities/delete/[id]
- Delete opportunityPOST /api/opportunities/upload
- Upload opportunity attachmentsGET /api/confidential/opportunities
- Access confidential opportunities
Core Endpointsβ
GET /api/opportunitiesβ
Retrieve a paginated list of opportunities with advanced filtering and search capabilities.
Method: GET
Authentication: Optional (affects visibility)
Rate Limit: 100 requests per minute
Query Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
page | number | No | Page number for pagination (default: 1) |
limit | number | No | Items per page (default: 10, max: 50) |
category | string | No | Filter by opportunity category |
type | string | No | Filter by type (job, project, collaboration) |
budget_min | number | No | Minimum budget filter |
budget_max | number | No | Maximum budget filter |
location | string | No | Filter by location |
remote | boolean | No | Filter for remote opportunities |
search | string | No | Search in title and description |
entity_id | string | No | Filter by posting entity |
sort | string | No | Sort field (created_at, budget, title, views) |
order | string | No | Sort order (asc, desc) |
status | string | No | Filter by status (active, expired, closed) |
Example Requestβ
GET /api/opportunities?category=Software%20Development&remote=true&limit=20&page=1
Response Schemaβ
{
"success": true,
"data": {
"opportunities": [
{
"id": "opp_123456",
"title": "Senior Full-Stack Developer",
"description": "We are looking for an experienced full-stack developer...",
"short_description": "Senior developer position with modern tech stack",
"category": "Software Development",
"type": "job",
"budget": {
"min": 3000,
"max": 5000,
"currency": "USD",
"per": "month"
},
"location": {
"city": "Kyiv",
"country": "Ukraine",
"remote": true,
"timezone": "Europe/Kiev"
},
"requirements": [
"5+ years of experience",
"React, Node.js proficiency",
"English B2+"
],
"benefits": [
"Flexible schedule",
"Health insurance",
"Professional development"
],
"entity": {
"id": "entity_456",
"name": "TechCorp Ukraine",
"logo": "https://storage.com/logos/techcorp.png"
},
"tags": ["react", "nodejs", "typescript", "remote"],
"status": "active",
"visibility": "public",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-16T14:30:00Z",
"expires_at": "2024-03-15T23:59:59Z",
"views": 245,
"applications": 12,
"is_featured": false
}
],
"pagination": {
"current_page": 1,
"total_pages": 15,
"total_items": 147,
"per_page": 10,
"has_next": true,
"has_prev": false
},
"filters": {
"categories": ["Software Development", "Design", "Marketing"],
"types": ["job", "project", "collaboration"],
"locations": ["Kyiv", "Lviv", "Kharkiv", "Remote"]
}
}
}
Error Responsesβ
{
"success": false,
"error": {
"code": "INVALID_PARAMETERS",
"message": "Invalid query parameters provided",
"details": {
"field": "limit",
"reason": "Must be between 1 and 50"
}
}
}
GET /api/opportunities/[id]β
Retrieve detailed information about a specific opportunity.
Method: GET
Authentication: Optional (affects content visibility)
Rate Limit: 200 requests per minute
Path Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique opportunity identifier |
Example Requestβ
GET /api/opportunities/opp_123456
Response Schemaβ
{
"success": true,
"data": {
"opportunity": {
"id": "opp_123456",
"title": "Senior Full-Stack Developer",
"description": "Detailed job description with full requirements and expectations...",
"short_description": "Senior developer position with modern tech stack",
"category": "Software Development",
"type": "job",
"budget": {
"min": 3000,
"max": 5000,
"currency": "USD",
"per": "month"
},
"location": {
"city": "Kyiv",
"country": "Ukraine",
"remote": true,
"timezone": "Europe/Kiev",
"address": "Optional office address"
},
"requirements": [
"5+ years of full-stack development experience",
"Expert knowledge of React and Node.js",
"TypeScript proficiency",
"English B2+ level"
],
"benefits": [
"Flexible working hours",
"Health and dental insurance",
"Professional development budget",
"Modern office in city center"
],
"entity": {
"id": "entity_456",
"name": "TechCorp Ukraine",
"logo": "https://storage.com/logos/techcorp.png",
"website": "https://techcorp.ua",
"employee_count": "50-100"
},
"contact_person": {
"name": "Anna Kovalenko",
"position": "HR Manager",
"email": "anna@techcorp.ua",
"phone": "+380123456789"
},
"application_process": {
"method": "form",
"instructions": "Please fill out the application form and attach your CV",
"required_documents": ["CV", "Cover Letter", "Portfolio"]
},
"attachments": [
{
"id": "att_789",
"name": "detailed_job_description.pdf",
"url": "https://storage.com/attachments/detailed_job.pdf",
"size": 512000,
"uploaded_at": "2024-01-15T10:00:00Z"
}
],
"tags": ["react", "nodejs", "typescript", "remote", "fintech"],
"status": "active",
"visibility": "public",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-16T14:30:00Z",
"expires_at": "2024-03-15T23:59:59Z",
"views": 245,
"applications": 12,
"is_featured": false
}
}
}
POST /api/opportunities/createβ
Create a new opportunity posting.
Method: POST
Authentication: Required (Member role or higher)
Rate Limit: 10 requests per minute
Request Body Schemaβ
{
"title": "Senior Full-Stack Developer",
"description": "We are looking for an experienced full-stack developer to join our growing team...",
"short_description": "Senior developer position with modern tech stack",
"category": "Software Development",
"type": "job",
"budget": {
"min": 3000,
"max": 5000,
"currency": "USD",
"per": "month"
},
"location": {
"city": "Kyiv",
"country": "Ukraine",
"remote": true
},
"requirements": [
"5+ years of experience",
"React, Node.js proficiency",
"English B2+"
],
"benefits": [
"Flexible schedule",
"Health insurance"
],
"entity_id": "entity_456",
"contact_person": {
"name": "Anna Kovalenko",
"position": "HR Manager",
"email": "anna@techcorp.ua"
},
"application_process": {
"method": "email",
"contact": "hr@techcorp.ua",
"instructions": "Send CV and cover letter"
},
"tags": ["react", "nodejs", "typescript"],
"expires_at": "2024-03-15T23:59:59Z",
"visibility": "public"
}
Response Schemaβ
{
"success": true,
"data": {
"opportunity": {
"id": "opp_new123456",
"title": "Senior Full-Stack Developer",
"status": "pending",
"created_at": "2024-01-20T15:30:00Z"
}
},
"message": "Opportunity created successfully and is pending review"
}
PUT /api/opportunities/updateβ
Update an existing opportunity.
Method: PUT
Authentication: Required (Owner or Admin)
Rate Limit: 20 requests per minute
Request Body Schemaβ
{
"id": "opp_123456",
"title": "Updated Senior Full-Stack Developer Position",
"description": "Updated description with new requirements...",
"budget": {
"min": 3500,
"max": 5500,
"currency": "USD",
"per": "month"
},
"status": "active",
"updated_fields": ["title", "description", "budget"]
}
Response Schemaβ
{
"success": true,
"data": {
"opportunity": {
"id": "opp_123456",
"updated_at": "2024-01-20T16:45:00Z"
}
},
"message": "Opportunity updated successfully"
}
DELETE /api/opportunities/delete/[id]β
Delete an opportunity posting.
Method: DELETE
Authentication: Required (Owner or Admin)
Rate Limit: 10 requests per minute
Path Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique opportunity identifier |
Response Schemaβ
{
"success": true,
"message": "Opportunity deleted successfully"
}
POST /api/opportunities/uploadβ
Upload files and attachments for opportunities.
Method: POST
Authentication: Required
Content-Type: multipart/form-data
Rate Limit: 5 requests per minute
File Size Limit: 10MB per file
Form Data Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
file | File | Yes | File to upload |
opportunity_id | string | Yes | Opportunity identifier |
description | string | No | File description |
Response Schemaβ
{
"success": true,
"data": {
"attachment": {
"id": "att_789012",
"name": "job_requirements.pdf",
"url": "https://storage.com/attachments/job_req.pdf",
"size": 245760,
"uploaded_at": "2024-01-20T17:00:00Z"
}
}
}
GET /api/confidential/opportunitiesβ
Access confidential opportunities for premium members.
Method: GET
Authentication: Required (Confidential role or higher)
Rate Limit: 50 requests per minute
Query Parametersβ
Same parameters as the regular opportunities endpoint.
Response Schemaβ
Similar structure to regular opportunities but includes confidential content and additional premium features.
Search and Filteringβ
Advanced Searchβ
The opportunities API supports sophisticated search capabilities:
- Full-text search across titles and descriptions
- Multi-field filtering with AND/OR logic
- Range queries for budget and dates
- Geolocation search with radius support
- Tag-based filtering with multiple tags
Example Advanced Searchβ
GET /api/opportunities?search=React%20developer&category=Software%20Development&budget_min=2000&remote=true&tags=react,typescript&sort=created_at&order=desc
Webhooksβ
The Opportunities API supports webhooks for real-time notifications:
Available Eventsβ
opportunity.created
- New opportunity postedopportunity.updated
- Opportunity modifiedopportunity.deleted
- Opportunity removedopportunity.expired
- Opportunity expiredapplication.submitted
- New application received
Webhook Configurationβ
{
"url": "https://your-app.com/webhooks/opportunities",
"events": ["opportunity.created", "application.submitted"],
"secret": "webhook_secret_key"
}
Rate Limitingβ
Rate limits are enforced per authenticated user or IP address:
Endpoint | Rate Limit |
---|---|
GET endpoints | 100-200 req/min |
POST/PUT endpoints | 10-20 req/min |
File uploads | 5 req/min |
Confidential access | 50 req/min |
Rate limit headers are included in all responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1642780800
Error Handlingβ
The API uses standard HTTP status codes and provides detailed error information:
Common Error Codesβ
400 Bad Request
- Invalid request parameters401 Unauthorized
- Authentication required403 Forbidden
- Insufficient permissions404 Not Found
- Opportunity not found409 Conflict
- Duplicate opportunity422 Unprocessable Entity
- Validation errors429 Too Many Requests
- Rate limit exceeded500 Internal Server Error
- Server error
Error Response Formatβ
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": {
"field": "budget.min",
"reason": "Must be a positive number"
},
"timestamp": "2024-01-20T18:00:00Z"
}
}
SDK and Integrationβ
JavaScript/TypeScript SDKβ
import { OpportunitiesAPI } from '@ring/api-client'
const api = new OpportunitiesAPI({
apiKey: 'your_api_key',
baseURL: 'https://ring.platform/api'
})
// List opportunities
const opportunities = await api.list({
category: 'Software Development',
remote: true,
limit: 20
})
// Create opportunity
const newOpportunity = await api.create({
title: 'Senior Developer',
category: 'Software Development',
type: 'job',
entity_id: 'entity_123'
})
cURL Examplesβ
# List opportunities
curl -X GET "https://ring.platform/api/opportunities?category=Software%20Development" \
-H "Authorization: Bearer your_token"
# Create opportunity
curl -X POST "https://ring.platform/api/opportunities/create" \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{"title": "Senior Developer", "category": "Software Development"}'
Data Modelsβ
Opportunity Schemaβ
interface Opportunity {
id: string
title: string
description: string
short_description?: string
category: string
type: 'job' | 'project' | 'collaboration'
budget?: {
min?: number
max?: number
currency: string
per: 'hour' | 'day' | 'month' | 'project'
}
location: {
city?: string
country?: string
remote: boolean
timezone?: string
}
requirements: string[]
benefits: string[]
entity_id: string
entity?: Entity
contact_person?: ContactPerson
application_process: ApplicationProcess
attachments: Attachment[]
tags: string[]
status: 'draft' | 'pending' | 'active' | 'expired' | 'closed'
visibility: 'public' | 'members' | 'confidential'
created_at: string
updated_at: string
expires_at?: string
views: number
applications: number
is_featured: boolean
}
The Opportunities API provides a comprehensive, scalable solution for managing job postings and project opportunities with full internationalization support and optimized performance.