{"openapi":"3.1.0","info":{"title":"POST /api/v1/entity-tags/bulk-attach-many","version":"1.0.0","description":"Bulk attach tags to many entities"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/entity-tags/bulk-attach-many":{"post":{"tags":["tags"],"summary":"Bulk attach tags to many entities","description":"Attach one or more tags to many entities of the same type in a single request. Idempotent; existing attachments are skipped. Replaces the per-entity request fan-out used for bulk tagging a table selection.","operationId":"bulk_attach_tags_to_entities_api_v1_entity_tags_bulk_attach_many_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/BulkEntityTagAttachManyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BulkEntityTagAttachManyResponse_"}}}},"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"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BulkEntityTagAttachManyRequest":{"properties":{"tag_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Tag Ids","description":"Tag UUIDs to attach to every entity"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity (transaction, invoice, bill, etc.)"},"model_ids":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Model Ids","description":"Entity UUIDs to tag (typically the current selection)."}},"type":"object","required":["tag_ids","model_type","model_ids"],"title":"BulkEntityTagAttachManyRequest","description":"Schema for attaching multiple tags to multiple entities at once."},"BulkEntityTagAttachManyResponse":{"properties":{"attached_count":{"type":"integer","title":"Attached Count","description":"Number of new (tag, entity) attachments created"},"entity_count":{"type":"integer","title":"Entity Count","description":"Number of entities the tags were applied to"}},"type":"object","required":["attached_count","entity_count"],"title":"BulkEntityTagAttachManyResponse","description":"Response for attaching multiple tags to multiple entities."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_BulkEntityTagAttachManyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BulkEntityTagAttachManyResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BulkEntityTagAttachManyResponse]"},"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":[]}]}