> For the complete documentation index, see [llms.txt](https://docs.getuntitled.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getuntitled.ai/api-documentation/agency.md).

# Agency

## Get Agency

> Returns the agency this API key belongs to.

```json
{"openapi":"3.1.0","info":{"title":"Untitled API","version":"1.14.0"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Bearer token for authentication","scheme":"bearer"}},"schemas":{"AgencyResponse":{"properties":{"name":{"type":"string","title":"Name"},"workspace":{"type":"string","title":"Workspace"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["name","workspace","created_at"],"title":"AgencyResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/agency":{"get":{"tags":["Agency"],"summary":"Get Agency","description":"Returns the agency this API key belongs to.","operationId":"get_agency_agency_get","parameters":[{"name":"X-Untitled-Client","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace.","title":"X-Untitled-Client"},"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## List Agency Clients

> Returns every client in the agency. \`accessible\` tells you if \`X-Untitled-Client\` can select it.

```json
{"openapi":"3.1.0","info":{"title":"Untitled API","version":"1.14.0"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Bearer token for authentication","scheme":"bearer"}},"schemas":{"AgencyClient":{"properties":{"workspace":{"type":"string","title":"Workspace"},"name":{"type":"string","title":"Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"accessible":{"type":"boolean","title":"Accessible"},"read_only":{"type":"boolean","title":"Read Only"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"}},"type":"object","required":["workspace","name","accessible","read_only","created_at"],"title":"AgencyClient"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/agency/clients":{"get":{"tags":["Agency"],"summary":"List Agency Clients","description":"Returns every client in the agency. `accessible` tells you if `X-Untitled-Client` can select it.","operationId":"get_agency_clients_agency_clients_get","parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include deleted clients","default":false,"title":"Include Deleted"},"description":"Include deleted clients"},{"name":"X-Untitled-Client","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace.","title":"X-Untitled-Client"},"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgencyClient"},"title":"Response Get Agency Clients Agency Clients Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## List Tags for Agency Clients

> Returns the tags of every client in the agency.

```json
{"openapi":"3.1.0","info":{"title":"Untitled API","version":"1.14.0"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Bearer token for authentication","scheme":"bearer"}},"schemas":{"AgencyClientTags":{"properties":{"agency":{"type":"string","title":"Agency"},"client":{"type":"string","title":"Client"},"tags":{"items":{"$ref":"#/components/schemas/TagApiResponse"},"type":"array","title":"Tags"}},"type":"object","required":["agency","client","tags"],"title":"AgencyClientTags"},"TagApiResponse":{"properties":{"id":{"type":"string","title":"Id"},"tag_id":{"type":"string","title":"Tag Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"url":{"type":"string","title":"Url"},"status":{"type":"string","title":"Status"},"mtd_resolutions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mtd Resolutions"},"created_at":{"type":"string","title":"Created At"},"created_by":{"type":"string","title":"Created By"},"updated_at":{"type":"string","title":"Updated At"},"updated_by":{"type":"string","title":"Updated By"},"monthly_budget":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Budget","description":"Only surface the budget cap when budgets are actually enabled.","readOnly":true},"last_tracked_activity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Tracked Activity","readOnly":true}},"type":"object","required":["id","tag_id","name","url","status","created_at","created_by","updated_at","updated_by","monthly_budget","last_tracked_activity"],"title":"TagApiResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/agency/clients/tags":{"get":{"tags":["Agency"],"summary":"List Tags for Agency Clients","description":"Returns the tags of every client in the agency.","operationId":"get_agency_client_tags_agency_clients_tags_get","parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include deleted clients","default":false,"title":"Include Deleted"},"description":"Include deleted clients"},{"name":"include_deleted_tags","in":"query","required":false,"schema":{"type":"boolean","description":"Include deleted tags","default":false,"title":"Include Deleted Tags"},"description":"Include deleted tags"},{"name":"X-Untitled-Client","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace.","title":"X-Untitled-Client"},"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgencyClientTags"},"title":"Response Get Agency Client Tags Agency Clients Tags Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Summarize Agency Resolutions

> Returns daily visitor and session totals per client and tag.

```json
{"openapi":"3.1.0","info":{"title":"Untitled API","version":"1.14.0"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Bearer token for authentication","scheme":"bearer"}},"schemas":{"ResolutionSummary":{"properties":{"agency_id":{"type":"string","title":"Agency Id"},"client_id":{"type":"string","title":"Client Id"},"tag_id":{"type":"string","title":"Tag Id"},"event_date":{"type":"string","format":"date","title":"Event Date"},"visitor_total":{"type":"integer","title":"Visitor Total"},"session_total":{"type":"integer","title":"Session Total"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["agency_id","client_id","tag_id","event_date","visitor_total","session_total"],"title":"ResolutionSummary"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/agency/clients/resolutions/summary":{"get":{"tags":["Agency"],"summary":"Summarize Agency Resolutions","description":"Returns daily visitor and session totals per client and tag.","operationId":"get_agency_resolutions_summary_agency_clients_resolutions_summary_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Start date (YYYY-MM-DD). Defaults to 30 days ago","title":"Start Date"},"description":"Start date (YYYY-MM-DD). Defaults to 30 days ago"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"End date (YYYY-MM-DD). Defaults to today","title":"End Date"},"description":"End date (YYYY-MM-DD). Defaults to today"},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include deleted clients","default":false,"title":"Include Deleted"},"description":"Include deleted clients"},{"name":"X-Untitled-Client","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace.","title":"X-Untitled-Client"},"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResolutionSummary"},"title":"Response Get Agency Resolutions Summary Agency Clients Resolutions Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Summarize Agency Destinations

> Returns the number of destinations of each service, per client.

```json
{"openapi":"3.1.0","info":{"title":"Untitled API","version":"1.14.0"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Bearer token for authentication","scheme":"bearer"}},"schemas":{"ActivationSummaryResponse":{"properties":{"agency":{"type":"string","title":"Agency"},"client":{"type":"string","title":"Client"},"activation":{"additionalProperties":true,"type":"object","title":"Activation"}},"type":"object","required":["agency","client","activation"],"title":"ActivationSummaryResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/agency/clients/activation/summary":{"get":{"tags":["Agency"],"summary":"Summarize Agency Destinations","description":"Returns the number of destinations of each service, per client.","operationId":"get_agency_activation_summary_agency_clients_activation_summary_get","parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include deleted clients","default":false,"title":"Include Deleted"},"description":"Include deleted clients"},{"name":"X-Untitled-Client","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace.","title":"X-Untitled-Client"},"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActivationSummaryResponse"},"title":"Response Get Agency Activation Summary Agency Clients Activation Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Summarize Agency Sources

> Returns the number of sources of each service, per client.

```json
{"openapi":"3.1.0","info":{"title":"Untitled API","version":"1.14.0"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Bearer token for authentication","scheme":"bearer"}},"schemas":{"EtlSummaryResponse":{"properties":{"agency":{"type":"string","title":"Agency"},"client":{"type":"string","title":"Client"},"etl":{"additionalProperties":true,"type":"object","title":"Etl"}},"type":"object","required":["agency","client","etl"],"title":"EtlSummaryResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/agency/clients/etl/summary":{"get":{"tags":["Agency"],"summary":"Summarize Agency Sources","description":"Returns the number of sources of each service, per client.","operationId":"get_agency_etl_summary_agency_clients_etl_summary_get","parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include deleted clients","default":false,"title":"Include Deleted"},"description":"Include deleted clients"},{"name":"X-Untitled-Client","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace.","title":"X-Untitled-Client"},"description":"The workspace of the agency client to act on. The API key must belong to the agency's root workspace."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EtlSummaryResponse"},"title":"Response Get Agency Etl Summary Agency Clients Etl Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.getuntitled.ai/api-documentation/agency.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
