{"openapi":"3.0.0","paths":{"/v1/costs/cost-centers":{"get":{"description":"Returns a paginated list of cost centers in the order they are shown in remberg.","operationId":"/v1/costs/cost-centers_get","parameters":[{"name":"page","required":false,"in":"query","description":"Page number.","schema":{"default":0,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Define how many items will be received in the payload per request.(default 20 items, max 1000 items)","schema":{"default":20,"type":"number"}},{"name":"remberg-active-site-ref","in":"header","required":false,"schema":{"type":"string","pattern":"^s[1-9]\\d*$"},"description":"The site the request acts on, e.g. `s2`. You find it in the remberg web app URL (e.g. `/s2/`) or next to the site name under Settings → Sites. If your account has access to more than one site, send this header on every request; site-specific requests without it fail with `403 ACTIVE_SITE_UNAVAILABLE`. With access to a single site, that site is used when the header is omitted. A site your account cannot access fails with `403 ACTIVE_SITE_UNAVAILABLE`; a record that belongs to another site returns `404`."}],"responses":{"200":{"description":"List of cost centers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCentersCfaFindManyResponseDto"}}}},"400":{"description":"Bad Request"},"403":{"description":"Forbidden"}},"security":[{"authorization":[]}],"summary":"Get a list of cost centers","tags":["cost-centers"],"x-controller-class":"CostCentersCfaController"},"post":{"description":"Creates a new cost center. Returns the API label of the created cost center. Responds with 409 if a cost center with the same API label already exists, or if the cost center could not be saved because of a concurrent change (safe to retry).","operationId":"/v1/costs/cost-centers_post","parameters":[{"name":"remberg-active-site-ref","in":"header","required":false,"schema":{"type":"string","pattern":"^s[1-9]\\d*$"},"description":"The site the request acts on, e.g. `s2`. You find it in the remberg web app URL (e.g. `/s2/`) or next to the site name under Settings → Sites. If your account has access to more than one site, send this header on every request; site-specific requests without it fail with `403 ACTIVE_SITE_UNAVAILABLE`. With access to a single site, that site is used when the header is omitted. A site your account cannot access fails with `403 ACTIVE_SITE_UNAVAILABLE`; a record that belongs to another site returns `404`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterCfaCreateOneBodyDto"}}}},"responses":{"201":{"description":"Resource created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCentersCfaCreateOneResponseDto"}}}},"400":{"description":"Bad Request"},"403":{"description":"Forbidden"},"409":{"description":"Duplicate cost center API label, or a concurrent change (safe to retry)"}},"security":[{"authorization":[]}],"summary":"Create a new cost center","tags":["cost-centers"],"x-controller-class":"CostCentersCfaController"}},"/v1/costs/cost-centers/{reference}":{"get":{"description":"Returns a single cost center identified by its API label.","operationId":"/v1/costs/cost-centers/{reference}_get","parameters":[{"name":"reference","required":true,"in":"path","description":"The cost center's API label (must be URL encoded)","schema":{"type":"string"}},{"name":"remberg-active-site-ref","in":"header","required":false,"schema":{"type":"string","pattern":"^s[1-9]\\d*$"},"description":"The site the request acts on, e.g. `s2`. You find it in the remberg web app URL (e.g. `/s2/`) or next to the site name under Settings → Sites. If your account has access to more than one site, send this header on every request; site-specific requests without it fail with `403 ACTIVE_SITE_UNAVAILABLE`. With access to a single site, that site is used when the header is omitted. A site your account cannot access fails with `403 ACTIVE_SITE_UNAVAILABLE`; a record that belongs to another site returns `404`."}],"responses":{"200":{"description":"Cost center retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterCfaResponseDto"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"security":[{"authorization":[]}],"summary":"Get a cost center by its API label","tags":["cost-centers"],"x-controller-class":"CostCentersCfaController"},"patch":{"description":"Partially updates the cost center identified by its API label. Only the fields provided in the request body are modified. The API label itself cannot be changed.","operationId":"/v1/costs/cost-centers/{reference}_patch","parameters":[{"name":"reference","required":true,"in":"path","description":"The cost center's API label (must be URL encoded)","schema":{"type":"string"}},{"name":"remberg-active-site-ref","in":"header","required":false,"schema":{"type":"string","pattern":"^s[1-9]\\d*$"},"description":"The site the request acts on, e.g. `s2`. You find it in the remberg web app URL (e.g. `/s2/`) or next to the site name under Settings → Sites. If your account has access to more than one site, send this header on every request; site-specific requests without it fail with `403 ACTIVE_SITE_UNAVAILABLE`. With access to a single site, that site is used when the header is omitted. A site your account cannot access fails with `403 ACTIVE_SITE_UNAVAILABLE`; a record that belongs to another site returns `404`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterCfaUpdateOneBodyDto"}}}},"responses":{"204":{"description":"Resource updated"},"400":{"description":"Bad Request"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"security":[{"authorization":[]}],"summary":"Update a cost center by its API label","tags":["cost-centers"],"x-controller-class":"CostCentersCfaController"},"delete":{"description":"Deletes the cost center identified by its API label. Returns 204 on success, also if no cost center with this API label exists.","operationId":"/v1/costs/cost-centers/{reference}_delete","parameters":[{"name":"reference","required":true,"in":"path","description":"The cost center's API label (must be URL encoded)","schema":{"type":"string"}},{"name":"remberg-active-site-ref","in":"header","required":false,"schema":{"type":"string","pattern":"^s[1-9]\\d*$"},"description":"The site the request acts on, e.g. `s2`. You find it in the remberg web app URL (e.g. `/s2/`) or next to the site name under Settings → Sites. If your account has access to more than one site, send this header on every request; site-specific requests without it fail with `403 ACTIVE_SITE_UNAVAILABLE`. With access to a single site, that site is used when the header is omitted. A site your account cannot access fails with `403 ACTIVE_SITE_UNAVAILABLE`; a record that belongs to another site returns `404`."}],"responses":{"204":{"description":"Resource deleted"},"403":{"description":"Forbidden"}},"security":[{"authorization":[]}],"summary":"Delete a cost center by its API label","tags":["cost-centers"],"x-controller-class":"CostCentersCfaController"}}},"info":{"title":"Costs","description":"The remberg Costs API description","version":"v1","contact":{}},"tags":[],"servers":[{"url":"https://api.remberg.de"}],"components":{"securitySchemes":{"authorization":{"type":"apiKey","in":"header","name":"authorization"}},"schemas":{"CostCenterCfaResponseDto":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","description":"The cost center's creation date"},"updatedAt":{"type":"string","format":"date-time","description":"The cost center's date of the last update"},"name":{"type":"string","description":"The cost center's name"},"reference":{"type":"string","description":"The cost center's API label: a unique free-text key within the tenant that identifies the cost center in this API. It cannot be changed after creation."}},"required":["createdAt","updatedAt","name","reference"]},"CostCentersCfaFindManyResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CostCenterCfaResponseDto"}}},"required":["data"]},"CostCenterCfaCreateOneBodyDto":{"type":"object","properties":{"name":{"type":"string","description":"The cost center's name"},"reference":{"type":"string","description":"The cost center's API label: a unique free-text key within the tenant that identifies the cost center in this API. It cannot be changed after creation."}},"required":["name","reference"]},"CostCentersCfaCreateOneResponseDto":{"type":"object","properties":{"reference":{"type":"string","description":"The created cost center's API label"}},"required":["reference"]},"CostCenterCfaUpdateOneBodyDto":{"type":"object","properties":{"name":{"type":"string","description":"The cost center's name"}}}}}}