The Terms Setup API provides four endpoints for managing IP licensing terms. All endpoints require authentication and return standardized JSON responses.
Base Path: /api/terms-setup
All endpoints require authentication via session cookie. The API validates the session and extracts user information including roles for authorization checks.
All endpoints return responses in this format:
Success Response:
{
"status": "success",
"data": { /* endpoint-specific data */ }
}
Error Response:
{
"status": "error",
"error": "Error message describing what went wrong"
}
Endpoint: POST /api/terms-setup/getOrCreateIpTerms
Purpose: Retrieves existing IP terms for a specific type, or generates default terms if none exist. This endpoint has a side-effect of creating records when they don't exist, hence the explicit naming and POST method.
Request Body:
ipTermType (required): One of "VoiceOver", "Likeness", "Image"accountId (optional): Target account ID (requires admin role if different from authenticated user's account)HTTP Status Codes:
200 OK - Success, existing term retrieved201 Created - Success, new term generated400 Bad Request - Invalid ipTermType or validation error401 Unauthorized - Not authenticated403 Forbidden - Not authorized to access target account (admin check failed)500 Internal Server Error - Server errorResponse Data:
ipTerms - Raw database recordsellerData.sellerName - Seller name from account display namefmtIpTerms - Formatted terms with legal text:
id - Term IDipTermType - Term typeipApprove - Approval statuslegalText:
shortTerms - Brief description with seller namebullets - Array of formatted bullet pointslongTerms - Full legal textpriceUSDollar - Compensation value as number (null if not set)accountData - Full account data for client-side useBehavior:
accountId provided, verifies user has "admin" roleipTermType is a valid enum valueaccountId and ipTermType (excluding soft-deleted)Example Request:
{
"ipTermType": "VoiceOver"
}
Example Response (201 Created):
{
"status": "success",
"data": {
"ipTerms": {
"id": "abc123",
"accountId": "acc456",
"ipTermType": "VoiceOver",
"compensationType": null,
"compensationValue": null,
"ipApprove": false,
"termsVersion": 1,
"createdBy": "user789",
"createdAt": "2026-02-12T10:00:00Z"
},
"sellerData": {
"sellerName": "John Doe"
},
"fmtIpTerms": {
"id": "abc123",
"ipTermType": "VoiceOver",
"ipApprove": false,
"legalText": {
"shortTerms": "John Doe's VoiceOver licensing terms...",
"bullets": [],
"longTerms": "Full legal text..."
}
},
"priceUSDollar": null,
"accountData": { /* account object */ }
}
}
Endpoint: POST /api/terms-setup/approveIpTerms
Purpose: Updates IP terms with new data and marks them as approved.
Request Body:
ipTermsId (required): ID of the IpTerms record to updateaccountId (optional): Target account ID (requires admin role if different from authenticated user's account)ipTerms (required): Partial update data:
compensationType (optional): Must be valid value from compensationTypes enumcompensationValue (optional): Must be non-negative number if providedapprovalType (optional): Must be valid value from approvalTypes enumpermittedUsage (optional): Free-text field describing permitted usageadditionalRestrictions (optional): Free-text field for additional restrictionsadditionalShareData (optional): Free-text field for additional data sharing requirementsHTTP Status Codes:
200 OK - Success, term updated and approved400 Bad Request - Invalid input data or validation error401 Unauthorized - Not authenticated403 Forbidden - Not authorized to update target account (admin check failed or ownership mismatch)404 Not Found - IP term not found500 Internal Server Error - Server errorResponse Data: Same structure as Get-or-Create response (FormattedIpTermsResult), but without accountData.
Behavior:
accountId provided, verifies user has "admin" roleipTermsId is required and valid stringcompensationType is valid enum value (if provided)compensationValue is non-negative number (if provided)approvalType is valid enum value (if provided)id (excluding soft-deleted)accountId matches authenticated user's account or user has "admin" roleipTerms update dataipApprove: trueupdatedBy to authenticated user IDupdatedAt to current timestampExample Request:
{
"ipTermsId": "abc123",
"ipTerms": {
"compensationType": "ONE_TIME_FEE_PER_IMAGE",
"compensationValue": 50.00,
"approvalType": "APPROVAL_BY_USER",
"permittedUsage": "Commercial use in marketing materials",
"additionalRestrictions": "No use in adult content"
}
}
Example Response:
{
"status": "success",
"data": {
"ipTerms": {
"id": "abc123",
"accountId": "acc456",
"ipTermType": "Image",
"ipApprove": true,
"compensationType": "ONE_TIME_FEE_PER_IMAGE",
"compensationValue": "50.00",
"termsVersion": 1,
"updatedBy": "user789",
"updatedAt": "2026-02-12T11:00:00Z"
},
"fmtIpTerms": { /* formatted terms */ },
"priceUSDollar": 50.00
}
}
Endpoint: DELETE /api/terms-setup/deleteIpTerms
Purpose: Soft-deletes an IP terms record by setting deletedAt timestamp. Records are not physically deleted to maintain audit trail.
Query Parameters:
ipTermsId (required): ID of the IpTerms record to soft-deleteaccountId (optional): Target account ID (requires admin role if different from authenticated user's account)HTTP Status Codes:
200 OK - Success, term soft-deleted400 Bad Request - Invalid ipTermsId401 Unauthorized - Not authenticated403 Forbidden - Not authorized to delete target account (admin check failed or ownership mismatch)404 Not Found - IP term not found500 Internal Server Error - Server errorResponse Data: The soft-deleted record with deletedAt set.
Behavior:
accountId provided, verifies user has "admin" roleipTermsId is required and valid stringid (excluding already soft-deleted)accountId matches authenticated user's account or user has "admin" roledeletedAt to current timestampupdatedBy to authenticated user IDupdatedAt to current timestampExample Request:
DELETE /api/terms-setup/deleteIpTerms?ipTermsId=abc123
Example Response:
{
"status": "success",
"data": {
"id": "abc123",
"accountId": "acc456",
"ipTermType": "VoiceOver",
"deletedAt": "2026-02-12T12:00:00Z",
"updatedBy": "user789",
"updatedAt": "2026-02-12T12:00:00Z"
}
}
Endpoint: GET /api/terms-setup/listIpTerms
Purpose: Retrieves all IP terms for an account in a single request, excluding soft-deleted records.
Query Parameters:
accountId (optional): Target account ID (requires admin role if different from authenticated user's account)HTTP Status Codes:
200 OK - Success, terms retrieved401 Unauthorized - Not authenticated403 Forbidden - Not authorized to access target account (admin check failed)500 Internal Server Error - Server errorResponse Data:
terms - Array of FormattedIpTermsResult objects (one per term type)Behavior:
accountId provided, verifies user has "admin" roleaccountId or authenticated user's accountformatIpTerms()Example Request:
GET /api/terms-setup/listIpTerms
Example Response:
{
"status": "success",
"data": {
"terms": [
{ /* VoiceOver term */ },
{ /* Image term */ },
{ /* Likeness term */ }
]
}
}
"VoiceOver" - Voice recordings and audio content"Likeness" - Person's likeness or appearance"Image" - Images and photographs"ONE_TIME_FEE_PER_MINUTE" - One-time fee per minute of audio"ONE_TIME_FEE_PER_SECOND" - One-time fee per second of audio"ONE_TIME_FEE_PER_IMAGE" - One-time fee per image"PERCENTAGE_OF_NET_REVENUES" - Percentage of net revenues"PAYMENT_PER_1000_VIEWS" - Payment per 1000 views"MAKE_ME_AN_OFFER" - Custom offer"NO_APPROVAL_NEEDED" - Automatic usage without approval"APPROVAL_BY_USER" - Seller must approve each use"APPROVAL_BY_AGENT" - Designated agent approves uses"APPROVAL_BY_AI" - Automated approval based on criteriaCommon error messages:
"IP term not found" - Term doesn't exist (404)"Unauthorized: This term does not belong to you" - Ownership mismatch (403)"Permission denied" - Cannot edit target account (403)"Invalid IP term type" - Unsupported term type (400)"ipTermsId is required" - Missing required parameter (400)"Invalid compensation value" - Negative or invalid number (400)"Invalid enum value" - Invalid compensationType or approvalType (400)Users with the "admin" role can manage terms for any account:
accountId parameter in request"admin" role403 ForbiddenThis enables support workflows and administrative management of terms across accounts.