Overview
InstaView uses scope-based permissions to provide granular access control. Each API key has a set of scopes that determine which operations it can perform on which resources.Permission Model
Three-Level Access Control
Every resource type supports three permission levels:Read
GET operations - List resources - View resource details - Search and
filter
Write
POST and PATCH operations - Create resources - Update resources -
Modify configurations
Delete
DELETE operations - Soft delete resources - Remove associations -
Archive data
Scope Format
Scopes follow the format:<permission>:<resource>
Available Scopes
- Jobs
- Candidates
- Interviews
- Agents
- Companies
- Billing
- Webhooks
Common Combinations:
Scope Validation
Request-Time Validation
Every API request validates the required scopes:Validation Flow
1
Extract API Key
API key is extracted from
Authorization: Bearer header2
Validate Key
Key is validated (not revoked, not expired, not suspended)
3
Check Scopes
Request’s required scope is compared against key’s scopes
4
Company Isolation
Verify resource belongs to key’s company (if applicable)
5
Execute Request
If all checks pass, request is processed
Scope Strategy
By Use Case
- Analytics Dashboard
- Candidate Sync
- Interview Automation
- Primary Integration
- Webhook Handler
Least Privilege Principle
Always grant the minimum scopes needed:Why Least Privilege?
Why Least Privilege?
- Reduces Attack Surface: Compromised keys have limited damage potential
- Prevents Accidents: Applications can’t accidentally delete data they shouldn’t
- Audit Trail: Scope requirements make it clear what each integration does
- Compliance: Many regulations require least-privilege access
Example: Webhook Handler
Example: Webhook Handler
A webhook handler that processes interview completion events: ❌ Too many
scopes:
json ["read:interviews", "write:interviews", "read:candidates", "write:candidates"] ✅ Minimal scopes: json ["read:interviews", "read:candidates"] The webhook only needs to read interview data, not
create or modify it.Example: Reporting Tool
Example: Reporting Tool
A reporting tool that generates analytics:❌ Includes write scopes:✅ Read-only:Reporting tools should never have write or delete permissions.
Scope Dependencies
Some operations require multiple scopes due to resource relationships:Creating Candidates
write:candidates- To create the candidateread:jobs- To validate the job exists and belongs to your company
Creating Interviews
write:interviews- To create the interviewread:candidates- To validate candidate ownershipread:agents- To validate agent ownership
Listing Candidates with Job Filters
read:candidates- To list candidatesread:jobs- To filter by job
Cross-Resource Operations
Inline Resources
Some operations allow creating inline resources:write:interviews- Primary operationwrite:candidates- To create inline candidateread:agents- To validate agentread:jobs- To validate job
Inline resources (candidate, job, agent) are created automatically as part of
the parent operation and follow the same scope requirements. The XOR behavior
ensures you use either existing resource IDs or inline resource definitions,
not both.
Company Isolation
All scopes are enforced within company boundaries:Regular API Keys
ATS Integration Keys
Scope Errors
The API key lacks the required scopeSolution: Add the required scope to your API key or create a new key with appropriate scopes.
Resource doesn’t exist or belongs to another companyCauses:
- Resource belongs to a different company
- Resource has been soft-deleted
- Invalid resource ID
Best Practices
Create Purpose-Specific Keys
Create Purpose-Specific Keys
Instead of one key with all scopes, create multiple keys for different purposes:
Document Required Scopes
Document Required Scopes
Document which scopes each part of your application needs: ```javascript /** *
Candidate Sync Service * * Required Scopes: * - read:jobs (validate job
ownership) * - read:candidates (check for duplicates) * - write:candidates
(create/update candidates) */ class CandidateSyncService
Regular Scope Audits
Regular Scope Audits
Periodically review API key scopes:
- Are all scopes still necessary?
- Can any keys be downgraded to read-only?
- Are there unused keys that can be revoked?
Testing Scopes
Verify Your Scopes
Test Scope Requirements
Next Steps
API Keys
Learn about API key management
Rate Limiting
Understand rate limits per scope
Error Handling
Handle permission errors gracefully
Best Practices
Production integration patterns