Skip to main content

API Resources

Our API is organized around REST principles with predictable, resource-oriented URLs.

Base URL

Authentication

All requests require an API key passed in the Authorization header:
API keys are sensitive credentials. Never share them publicly or commit them to version control.

OpenAPI Spec

Download the OpenAPI 3.1 specification to import into Postman, Insomnia, or any API client:

Download OpenAPI Spec

openapi.json

Billing

Our API consumes credits for Search and Research operations:
  • Search: 2 credits per search request (charged when search completes)
  • Research: 1 credit per successful, completed research
You can add credits at any time from your Settings page. You can also monitor your credits from the Settings page, or via the API’s Get Usage endpoint.

Error Response Format

All errors follow the RFC 7807 Problem Details format:
FieldDescription
typeA URI reference that identifies the problem type
titleA short, human-readable summary of the problem
statusThe HTTP status code
detailA human-readable explanation specific to this occurrence
instanceA URI reference that identifies the specific occurrence

HTTP Status Codes

2xx Success

CodeDescription
200 OKRequest succeeded

4xx Client Errors

The request was malformed or contains invalid parameters.Common Causes:
  • Missing required fields
  • Invalid JSON format
  • Empty or invalid values
Example:
Solution: Check your request body against the API documentation
Authentication failed - your API key is invalid or missing.Common Causes:
  • Missing Authorization header
  • Invalid API key
  • Revoked API key
Example:
Solution: Verify your API key is correct and not revoked
You don’t have enough credits to perform this operation.Common Causes:
  • Account has zero credits
  • Insufficient credits for the requested operation
Example:
Solution: Purchase more credits from your Settings page
You don’t have permission to access the requested resource.Common Causes:
  • Attempting to access another user’s research
  • Insufficient permissions for the operation
Example:
Solution: Verify you have access to the resources you’re requesting
The requested resource doesn’t exist.Common Causes:
  • Invalid endpoint URL
  • Resource has been deleted
  • Wrong research ID
Example:
Solution: Check the resource ID and endpoint URL
The request body failed validation.Common Causes:
  • Missing required fields
  • Invalid field types
  • Fields that don’t match expected format
Example:
Solution: Ensure all required fields are present and correctly formatted
You’ve exceeded the rate limit.Common Causes:
  • Making too many research requests per hour
  • Burst of requests in short time period
Example:
Solution: Implement exponential backoff and respect rate limits

5xx Server Errors

Something went wrong on our end.Example:
Solution:
  • Retry the request with exponential backoff
  • If the issue persists, contact us on Discord
The API is temporarily unavailable.Common Causes:
  • Scheduled maintenance
  • Temporary outage
  • Database connection issues
Solution:
  • Retry the request with exponential backoff
  • If the issue persists, contact support

Error Handling Best Practices

Check Status Codes

Always check the HTTP status code before parsing the response:

Implement Retry Logic

For transient errors (429, 500, 503), implement exponential backoff:

Validate Input Before Sending

Catch errors early by validating input:

Log Errors for Debugging

Always log error details:

Common Error Scenarios

Invalid API Key

Fix: Use a valid API key from your account settings.

Empty Description

Fix: Provide a non-empty description with details about the person.

Research Not Found

Fix: Check that the research ID is correct and belongs to your account.

Insufficient Credits

Fix: Purchase more credits from your Settings page.

Empty Search Results

Cause: You set include_my_connections or include_friends_connections to true, but you haven’t uploaded any connections to search across. Fix: Upload your LinkedIn connections at happenstance.ai before searching. Alternatively, search within specific groups by providing group_ids.

Need Help?

Research Reference

Detailed endpoint documentation

Support

Contact our support team