{"openapi":"3.1.0","info":{"title":"POST /api/v1/entity-tags/batch","version":"1.0.0","description":"Batch fetch tags for multiple entities"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/entity-tags/batch":{"post":{"tags":["tags"],"summary":"Batch fetch tags for multiple entities","description":"Fetch tags for many entities of the same type in a single request. Returns a mapping of entity id -> its tags; entities with no tags are omitted. Replaces per-row GET /entity-tags/{model_type}/{model_id} calls to avoid request fan-out (and the edge rate limiting it causes).","operationId":"get_entity_tags_batch_api_v1_entity_tags_batch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEntityTagsRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEntityTagsResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BulkEntityTagsRequest":{"properties":{"model_type":{"type":"string","title":"Model Type","description":"Type of entity (transaction, invoice, bill, etc.)"},"model_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Model Ids","description":"Entity UUIDs to fetch tags for (typically the visible page)."}},"type":"object","required":["model_type","model_ids"],"title":"BulkEntityTagsRequest","description":"Schema for fetching tags for many entities of the same type at once."},"BulkEntityTagsResponse":{"properties":{"items":{"additionalProperties":{"items":{"$ref":"#/components/schemas/EntityTagResponse"},"type":"array"},"type":"object","title":"Items","description":"Mapping of entity UUID -> tags attached to it. Entities with no tags are omitted."}},"type":"object","title":"BulkEntityTagsResponse","description":"Schema for the batch entity-tag lookup, keyed by entity id."},"EntityTagResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the entity tag"},"tag_id":{"type":"string","title":"Tag Id","description":"UUID of the tag"},"tag_name":{"type":"string","title":"Tag Name","description":"Name of the tag"},"tag_group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Group Name","description":"Name of the tag group (if any)"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity this tag is attached to"},"model_id":{"type":"string","title":"Model Id","description":"UUID of the entity"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the tag was attached"}},"type":"object","required":["id","tag_id","tag_name","model_type","model_id","created_at"],"title":"EntityTagResponse","description":"Schema for entity tag response."},"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"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}