API Reference
The Inhouse API provides programmatic access to all platform features, allowing you to integrate link management, app tracking, and customer data into your existing workflows and applications.π Getting Started? Check out our Quick Reference section below for the most common endpoints and authentication methods.
Quick Reference
π Authentication Methods
- JWT Bearer Token:
Authorization: Bearer {token}(24h expiry) - Project API Token:
x-api-token-id: {id}+x-api-token-secret: {secret}(permanent) - Chrome Extension:
x-inhouse-token-id: {id}+x-inhouse-token-secret: {secret}+x-inhouse-app: {app_id}
π Base URLs
- Production:
https://api.tryinhouse.co/v1/apiβ Recommended - Legacy:
https://api.tryinhouse.co/apiβ οΈ Deprecated
π Common Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /projects | List projects |
POST | /links?project_id={id} | Create link |
GET | /links?project_id={id} | List links |
GET | /links/{id} | Get link details |
PATCH | /links/{id} | Update link |
DELETE | /links/{id} | Archive link |
π οΈ SDKs Available
- JavaScript/Node.js:
npm install @inhouse/sdkβ - Python: In development π§
- Postman Collection: [email protected]
Table of Contents
- Getting Started
- Core Endpoints
- Analytics and Reporting
- Webhooks
- SDKs and Libraries
- Error Handling
- Rate Limits
- Best Practices
- Troubleshooting
Getting Started
Authentication
The Inhouse API supports multiple authentication methods to suit different use cases. Choose the method that best fits your needs:1. JWT Bearer Tokens
For most applications, use JWT Bearer tokens which provide secure, time-limited access:- Web applications with user sessions
- Mobile applications
- Short-lived API access
- When you need automatic token expiration for security
2. Project API Tokens (Recommended for Server-to-Server)
For server-to-server communication or long-running processes, use project API tokens:- Server-to-server communication
- Background jobs and cron tasks
- Long-running processes
- When you need non-expiring tokens
3. Chrome Extension Headers (For Browser Extensions)
For Chrome extensions and browser-based integrations:- Chrome browser extensions
- Browser-based tools and integrations
- Client-side applications that need persistent access
x-inhouse-app header must match the Chrome extension ID registered in your project.
Base URL
/v1/api) for better stability and future compatibility.
Content Type
All API requests should include theContent-Type header:
Response Format
All API responses are returned in JSON format with the following structure: Success Response:Authentication
Login
Request OTP for login
Refresh Token
Authentication Priority
The API checks authentication in the following order:- JWT Bearer Token (Authorization header)
- Chrome Extension Headers (x-inhouse-token-id, x-inhouse-token-secret)
- Project API Tokens (x-api-token-id, x-api-token-secret)
Authentication Examples
Example 1: Using JWT Bearer Token
Step 1: Login to get JWT tokenExample 2: Using Project API Tokens
** Use project token for API calls**Using Chrome Extension Headers
Core Endpoints
Projects Management
List Projects
Retrieve all projects accessible to the authenticated user.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
Create Project
Create a new project.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
Get Project Details
Retrieve details for a specific project.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
Update Project
Update an existing project.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
List Project Members
Retrieve all members of a specific project.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
List Project Invites
Retrieve all pending invites for a project.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
Create Project Invite
Send an invitation to join a project.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
Get Project Invite
Retrieve details of a specific project invite.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
invite_id(string, required): The unique identifier of the invite
Remove Project Invite
Cancel a pending project invitation.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the projectinvite_id(string, required): The unique identifier of the invite
List Project Tokens
Retrieve all API tokens for a project.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
Create Project Token
Generate a new API token for a project. You can also create tokens through the dashboard at app.tryinhouse.co in the project settings. (preferably use the dashboard)Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
Links Management
Create a Link
Create a new shortened link with optional tracking and customization features.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): The unique identifier of the project
Get Link Details
Retrieve detailed information about a specific link.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
link_id(string, required): The unique identifier of the link
List Links
Retrieve all links for a specific project with optional filtering and pagination.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
project_id(string, required): Project ID to filter linkslimit(number, optional): Items per page (default: 100, max: 100)offset(number, optional): Number of items to skip (default: 0)archived(boolean, optional): Filter by archived statuslink_type(string, optional): Filter by link typeslug(boolean, optional): Filter by slug presence
Update Link
Update an existing linkβs properties.Authorization: Bearer {jwt_token}(required)Content-Type: application/json
link_id(string, required): The unique identifier of the link
Domains Management
- contact [email protected] for custom domains
Apps Tracking
coming soonGet App Analytics
coming soonChrome Extensions Management
List Extensions
Create Extension
Update Extension
Get Extension
Events Tracking
Track Chrome Event
Customer Management
TODO: coming soonAnalytics and Reporting
TODO: coming soonWebhooks
Webhooks allow you to receive real-time notifications when events occur in your Inhouse project. This enables you to build integrations and automate workflows based on link activity, user actions, and system events.Setting Up Webhooks
contact [email protected]Webhook Events
Link Events
| Event | Description | Payload |
|---|---|---|
link.created | New link created | Link object with full details |
link.updated | Link updated | Updated link object |
link.clicked | Link clicked | Click event with analytics data |
link.archived | Link archived | Link ID and metadata |
App Events
| Event | Description | Payload |
|---|---|---|
app.created | New app added | App object with details |
app.event | App event tracked | Event data and properties |
app.updated | App updated | Updated app object |
Customer Events
| Event | Description | Payload |
|---|---|---|
customer.created | New customer added | Customer object with details |
customer.updated | Customer updated | Updated customer object |
customer.status_changed | Customer status changed | Customer ID and new status |
Error Response Format
Common Error Codes
| Error Code | Description |
|---|---|
VALIDATION_ERROR | Request validation failed |
AUTHENTICATION_REQUIRED | Authentication is required |
INVALID_TOKEN | Token is invalid or expired |
INSUFFICIENT_PERMISSIONS | User lacks required permissions |
RESOURCE_NOT_FOUND | Requested resource doesnβt exist |
RESOURCE_ALREADY_EXISTS | Resource with this identifier already exists |
RATE_LIMIT_EXCEEDED | Too many requests |
- Implement exponential backoff when receiving 429 responses
- Monitor rate limit headers to avoid hitting limits
- Consider upgrading your plan for higher limits
Best Practices
Authentication
-
Use Project API Tokens for Server-to-Server Communication
- More secure than JWT tokens for long-running processes
- Never expire, reducing the need for token refresh logic
- Store tokens securely using environment variables
-
Implement Token Refresh for JWT Authentication
- JWT tokens expire after 24 hours
- Use refresh tokens to obtain new access tokens
- Handle token expiration gracefully in your application
-
Rotate API Tokens Regularly
- Generate new tokens periodically
- Revoke old tokens when no longer needed
- Monitor token usage for security
Request Handling
-
Use Appropriate HTTP Methods
GETfor retrieving dataPOSTfor creating resourcesPATCHfor partial updatesPUTfor complete updatesDELETEfor archiving resources
-
Implement Proper Error Handling
- Check HTTP status codes
- Parse error messages for user feedback
- Implement retry logic for transient errors
-
Use Pagination for Large Datasets
- Always specify
limitparameter for list endpoints - Implement pagination in your UI
- Use
pageparameter to navigate through results
- Always specify
Performance Optimization
-
Cache Responses When Appropriate
- Cache static data like project details
- Implement cache invalidation strategies
- Use appropriate cache headers
-
Minimize API Calls
- Batch operations when possible
- Use filtering parameters to reduce data transfer
- Implement client-side caching
-
Monitor API Usage
- Track rate limit consumption
- Monitor response times
- Set up alerts for errors
Security
-
Never Expose API Tokens
- Store tokens in environment variables
- Never commit tokens to version control
- Use different tokens for different environments
-
Validate Input Data
- Sanitize user input before sending to API
- Validate required fields
- Check data types and formats
-
Use HTTPS Only
- Always use HTTPS endpoints
- Validate SSL certificates
- Never send sensitive data over HTTP
Troubleshooting
Common Issues
π Authentication Problems
Issue:401 Unauthorized errors
- Cause: Invalid or expired token
- Solution:
- Check token format and validity
- Refresh JWT tokens using
/auth/refresh-token - Verify project API token credentials
403 Forbidden errors
- Cause: Insufficient permissions
- Solution:
- Check user role in project
- Verify token has required permissions
- Contact project admin for access
π Validation Errors
Issue:422 Unprocessable Entity errors
- Cause: Invalid field values or missing required fields
- Solution:
- Check field validation rules in documentation
- Ensure required fields are provided
- Validate data types and formats
β±οΈ Rate Limiting
Issue:429 Too Many Requests errors
- Cause: Exceeding rate limits
- Solution:
- Implement exponential backoff
- Monitor rate limit headers
- Consider upgrading plan for higher limits
π Link Creation Issues
Issue: Custom key conflicts- Cause: Key already exists in project
- Solution:
- Use unique custom keys
- Let API generate random keys
- Check existing links for conflicts
Debug Tips
-
Enable Verbose Logging
-
Check Response Headers
- Look for
X-RateLimit-*headers - Check
Content-Typeisapplication/json - Verify
X-Request-IDfor support requests
- Look for
-
Validate JSON
- Use JSON validators for request bodies
- Check for trailing commas or syntax errors
- Ensure proper escaping of special characters
-
Test with Postman
- Import our Postman collection
- Use environment variables for tokens
- Test authentication flows step by step