{"openapi":"3.1.0","info":{"title":"POST /api/v1/entity-tags","version":"1.0.0","description":"Attach tag to entity"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/entity-tags":{"post":{"tags":["tags"],"summary":"Attach tag to entity","description":"Attach a tag to a specific entity (transaction, invoice, bill, etc.)","operationId":"attach_tag_api_v1_entity_tags_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/EntityTagCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityTagResponse"}}}},"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"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"EntityTagCreate":{"properties":{"tag_id":{"type":"string","title":"Tag Id","description":"UUID of the tag to attach"},"model_type":{"type":"string","title":"Model Type","description":"Type of entity (transaction, invoice, bill, journal_entry, customer, vendor, product)"},"model_id":{"type":"string","title":"Model Id","description":"UUID of the entity to tag"}},"type":"object","required":["tag_id","model_type","model_id"],"title":"EntityTagCreate","description":"Schema for attaching a tag to an entity.","example":{"model_id":"660e8400-e29b-41d4-a716-446655440001","model_type":"transaction","tag_id":"550e8400-e29b-41d4-a716-446655440000"}},"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":[]}]}