Manage agency entities used to group advertisers under a common representative
Agencies
Agencies represent advertising agencies that manage campaigns on behalf of one or more advertisers.
Overview
An Agency entity contains:
- Identification - Name, description
- Provider Mappings - Identifiers linking the agency to external systems (e.g. a CRM)
Query Agencies
Basic Query
query GetAgencies {
dream_adserver {
agencies(limit: 10) {
edges {
agency_id
agency_name
agency_desc
}
total_count
}
}
}Filtered Query
query GetFilteredAgencies($filter: JSON, $sort: JSON) {
dream_adserver {
agencies(
filter: $filter
sort: $sort
limit: 25
offset: 0
) {
edges {
agency_id
agency_name
agency_desc
agency_ext_id
agency_ext_ids
agency_modification_time
agency_modification_user
}
total_count
}
}
}Variables:
{
"filter": {
"agency_name": {"like": "%Media%"}
},
"sort": {
"agency_name": "asc"
}
}Available Fields
| Field | Type | Description |
|---|---|---|
agency_id | Int! | Unique identifier |
agency_name | String! | Agency name |
agency_desc | String | Descriptive information about the agency |
agency_ext_id | String | Agency identifier in an external database |
agency_ext_ids | JSON | JSON string containing pairs of data sources and IDs |
agency_modification_time | String | Time of last modification of agency data (format: yyyy-mm-ddThh:mm:ss.s+zzzzzz) |
agency_modification_user | String | Login of the user who last modified the agency data |
Mutations
Create/Update Agency
mutation SetAgency($agency: DASAgencyInput!) {
dream_adserver {
set_agency(agency: $agency) {
hit {
agency_id
agency_name
}
}
}
}Variables (create):
{
"agency": {
"agency_name": "Example Media Agency",
"agency_desc": "Full-service media buying agency",
"agency_provider_mappings": [
{ "provider_name": "CRM", "external_id": "AGY-4821" }
]
}
}Variables (edit an existing agency — pass agency_id):
{
"agency": {
"agency_id": 501,
"agency_name": "Example Media Agency",
"agency_provider_mappings": [
{ "provider_name": "CRM", "external_id": "AGY-4821" }
]
}
}Required field:
agency_name. Omitagency_idto create a new agency, provide it to edit an existing one.agency_provider_mappingsis the full desired set of external-system mappings, reconciled on every call (add/update/remove) — an empty list clears all mappings, omitting the field leaves existing mappings untouched. The mutation returnshit, the savedDASAgencyobject.
Next Steps
- Payers - Manage payer entities
- Advertisers - Manage advertiser entities
- Filtering - Master query filters
Related
- Delivery APIs Overview - Campaign hierarchy
