Sponsors
Sponsor name normalization
GET /sponsors
Section titled “GET /sponsors”List all sponsors
Returns list of all known sponsors with their aliases and metadata
Parameters
Section titled “Parameters”include_inactive(query, boolean): Include inactive (deleted) sponsors
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | List of sponsors | object |
200 response body
Section titled “200 response body”sponsors(array of Sponsor)
POST /sponsors
Section titled “POST /sponsors”Add a new sponsor
Create a new sponsor entry with optional aliases and category
Request body (application/json, required)
Section titled “Request body (application/json, required)”name(string, required): Canonical sponsor namealiases(array of string): Alternative names for this sponsorcategory(string): Sponsor categorysegment_category(string or null, one ofsponsor,cross_promo,self_promo,interaction,intro,outro,recap,null): Segment category applied to every read naming this sponsor
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 201 | Sponsor created | object |
| 400 | Bad request - invalid input | Error |
| 409 | Sponsor already exists | Error |
201 response body
Section titled “201 response body”message(string)id(integer)
GET /sponsors/{sponsor_id}
Section titled “GET /sponsors/{sponsor_id}”Get a single sponsor
Returns details for a specific sponsor by ID
Parameters
Section titled “Parameters”sponsor_id(path, integer, required): Sponsor identifier (integer)
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | Sponsor details | Sponsor |
| 404 | Resource not found | Error |
PUT /sponsors/{sponsor_id}
Section titled “PUT /sponsors/{sponsor_id}”Update a sponsor
Update sponsor properties. Any subset of the fields may be sent.
Parameters
Section titled “Parameters”sponsor_id(path, integer, required): Sponsor identifier (integer)
Request body (application/json, required)
Section titled “Request body (application/json, required)”name(string)aliases(array of string)category(string)segment_category(string or null, one ofsponsor,cross_promo,self_promo,interaction,intro,outro,recap,null): Segment category applied to every read naming this sponsor; null clears ittags(array of string): Community tags for grouping and filteringcommon_ctas(array of string): Common calls-to-action associated with this sponsoris_active(boolean): Set false to deactivate, true to reactivate
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | Sponsor updated | object |
| 400 | Bad request - invalid input | Error |
| 404 | Resource not found | Error |
200 response body
Section titled “200 response body”message(string)
DELETE /sponsors/{sponsor_id}
Section titled “DELETE /sponsors/{sponsor_id}”Delete a sponsor
Permanently remove a sponsor. Any ad patterns linked to it are unlinked (their sponsor_id is set to null), not deleted, so no pattern data is lost.
Parameters
Section titled “Parameters”sponsor_id(path, integer, required): Sponsor identifier (integer)
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | Sponsor deleted | object |
| 404 | Resource not found | Error |
200 response body
Section titled “200 response body”message(string)unlinkedPatterns(integer): Number of ad patterns that were unlinked
GET /sponsors/normalizations
Section titled “GET /sponsors/normalizations”List sponsor normalizations
Returns list of sponsor name normalization rules with optional filtering
Parameters
Section titled “Parameters”category(query, string, one ofsponsor,url,number,phrase): Filter by normalization categoryinclude_inactive(query, boolean): Include inactive normalizations
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | List of normalizations | object |
200 response body
Section titled “200 response body”normalizations(array of Normalization)
POST /sponsors/normalizations
Section titled “POST /sponsors/normalizations”Add a normalization rule
Create a sponsor name normalization rule. terms is a regex pattern applied case-insensitively; canonical is its replacement. The legacy field names pattern/replacement are still accepted on write. The regex is validated on create and rejected with 400 if invalid.
Request body (application/json, required)
Section titled “Request body (application/json, required)”terms(string, required): Regex pattern to match (legacy alias - pattern)canonical(string, required): Replacement text (legacy alias - replacement)category(string, one ofsponsor,url,number,phrase, required): Normalization category
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 201 | Normalization created | object |
| 400 | Bad request - invalid input | Error |
201 response body
Section titled “201 response body”message(string)id(integer)
PUT /sponsors/normalizations/{norm_id}
Section titled “PUT /sponsors/normalizations/{norm_id}”Update a normalization rule
Update a normalization rule. Any subset of fields may be sent. The legacy field names pattern/replacement are still accepted in place of terms/canonical.
Parameters
Section titled “Parameters”norm_id(path, integer, required): Normalization rule identifier (integer)
Request body (application/json, required)
Section titled “Request body (application/json, required)”terms(string): Regex pattern to match (legacy alias - pattern)canonical(string): Replacement text (legacy alias - replacement)category(string, one ofsponsor,url,number,phrase)
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | Normalization updated | object |
| 400 | Bad request - invalid input | Error |
| 404 | Resource not found | Error |
200 response body
Section titled “200 response body”message(string)
DELETE /sponsors/normalizations/{norm_id}
Section titled “DELETE /sponsors/normalizations/{norm_id}”Delete a normalization rule
Deactivate a normalization rule (soft delete)
Parameters
Section titled “Parameters”norm_id(path, integer, required): Normalization rule identifier (integer)
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | Normalization deleted | object |
| 404 | Resource not found | Error |
200 response body
Section titled “200 response body”message(string)
PUT /sponsors/{sponsor_id}/tags
Section titled “PUT /sponsors/{sponsor_id}/tags”Update a sponsor’s tags
Parameters
Section titled “Parameters”sponsor_id(path, integer, required)
Request body (application/json, required)
Section titled “Request body (application/json, required)”tags(array of string, required)
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
| 200 | Updated sponsor tags | |
| 404 | Sponsor not found |