Skip to main content

kobana finance custom-classifiers

Commands of kobana finance custom-classifiers. Every global option (Global options) applies here.

CommandHTTPDescription
custom-classifiers values updatePATCH /v1/custom-classifiers/{id}/values/{valueId}Update a custom classifier value
custom-classifiers values deleteDELETE /v1/custom-classifiers/{id}/values/{valueId}Delete a custom classifier value
custom-classifiers values createPOST /v1/custom-classifiers/{id}/valuesAdd a value to a custom classifier
custom-classifiers listGET /v1/custom-classifiersList custom classifiers
custom-classifiers createPOST /v1/custom-classifiersCreate a custom classifier
custom-classifiers getGET /v1/custom-classifiers/{id}Get a custom classifier by id
custom-classifiers updatePATCH /v1/custom-classifiers/{id}Update a custom classifier
custom-classifiers deleteDELETE /v1/custom-classifiers/{id}Delete a custom classifier

custom-classifiers values update​

Update a custom classifier value

kobana finance custom-classifiers values update [ID] [VALUEID] [OPTIONS]

PATCH /v1/custom-classifiers/{id}/values/{valueId}

Partial update of a value's value, color, active. Requires scope finance/custom_classifiers with access level write. Send active: false to soft-deactivate, or color: null to clear the swatch.

Path arguments: id, valueId

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Request body

NameTypeRequiredDescription
valuestringno
colorstringnoHex swatch, or null to clear it and fall back to the palette.
activebooleanno
custom_metadataobjectnoMetadados do usuário: objeto JSON livre. Envie null para limpar. Máx. 64 KB serializado, 16 níveis.
custom_metadata_modestringnoComo o custom_metadata enviado é reconciliado com o valor armazenado: replace (padrão) substitui o objeto inteiro, merge faz deep merge sobre o valor atual. Aceito apenas na atualização. Values: replace, merge.

More fields and nested objects: kobana schema finance.custom-classifiers.values.update.

Responses

HTTPDescription
200Updated value.
400Malformed JSON body.
404Value (or its parent dimension) not found within the tenant.
409X-Idempotency-Key reused with a different body.
422Schema validation failure.

custom-classifiers values delete​

Delete a custom classifier value

kobana finance custom-classifiers values delete [ID] [VALUEID] [OPTIONS]

DELETE /v1/custom-classifiers/{id}/values/{valueId}

Deletes a value. Requires scope finance/custom_classifiers with access level delete. Returns 422 (reason: in_use) when the value is assigned to a payable / receivable / transaction — soft-deactivate via PATCH { active: false } instead.

Path arguments: id, valueId

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Responses

HTTPDescription
200Value deleted.
404Value (or its parent dimension) not found within the tenant.
422The value is in use (reason: in_use).

custom-classifiers values create​

Add a value to a custom classifier

kobana finance custom-classifiers values create [ID] [OPTIONS]

POST /v1/custom-classifiers/{id}/values

Adds a value to the dimension. Requires scope finance/custom_classifiers with access level write. Pass an X-Idempotency-Key header on retries.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Request body

NameTypeRequiredDescription
valuestringyes
colorstringnoHex swatch (#rrggbb or #rrggbbaa). Omit for an auto-assigned palette color.
activebooleannoDefaults to true.
custom_metadataobjectnoMetadados do usuário: objeto JSON livre. Envie null para limpar. Máx. 64 KB serializado, 16 níveis.

More fields and nested objects: kobana schema finance.custom-classifiers.values.create.

Responses

HTTPDescription
201Value created. The Location header points at the new value.
400Malformed JSON body.
404Parent custom classifier not found within the tenant.
409X-Idempotency-Key reused with a different body.
422Schema validation failure.

custom-classifiers list​

List custom classifiers

kobana finance custom-classifiers list [OPTIONS]

GET /v1/custom-classifiers

Returns a cursor-paginated page of custom classifiers (user-defined classification dimensions) for the workspace tied to the token's sub claim. Each dimension carries its values[] inline. Company-scoped — pass ?company_id=… to narrow. Requires scope finance/custom_classifiers with access level read.

Query parameters

NameTypeRequiredDescription
company_idstringnoFilter by owning company UUID. Accepts [in]=uuid1,uuid2 for OR matching.
activestringnoFilter by active flag. true returns only active; omit to return both. Values: true, false.
namestringnoFilter by exact name. Accepts [in].
sort_bystringnoField to order by. Default: sort_by=name&sort_order=asc. Values: created_at, name.
sort_orderstringnoOrder direction. Defaults to asc; ignored without sort_by. Values: asc, desc.
limitintegernoPage size. Default 25, max 100.
cursorstringnoOpaque cursor for the next page. Round-trip meta.next_cursor from the previous response.
fieldsstringnoComma-separated top-level fields to return, e.g. fields=description,amount,due_date. Omit for every field. id is always included; naming an object field returns it whole. An unknown name is a 400 whose details lists unknown and available.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Responses

HTTPDescription
200Page of custom classifiers plus pagination metadata.
400Malformed query (unknown filter / operator, invalid limit, bad cursor).

custom-classifiers create​

Create a custom classifier

kobana finance custom-classifiers create [OPTIONS]

POST /v1/custom-classifiers

Creates a custom classifier dimension. Requires scope finance/custom_classifiers with access level write. workspace_id is taken from the token. Add values with POST /custom-classifiers/{id}/values. Pass an X-Idempotency-Key header on retries.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Request body

NameTypeRequiredDescription
company_idstring (uuid)yesOwning company UUID. Must belong to the tenant.
namestringyes
field_typestringnoDefaults to dropdown. Values: dropdown, radio, multi_select, number, text, phone, url, date, datetime.
number_formatstringnoOnly meaningful for number (defaults to formatted); ignored otherwise. Values: formatted, unformatted, currency, percent, null.
option_stylestringnoOnly meaningful for list types (defaults to default); ignored otherwise. Values: default, dot, null.
activebooleannoDefaults to true.
custom_metadataobjectnoMetadados do usuário: objeto JSON livre. Envie null para limpar. Máx. 64 KB serializado, 16 níveis.

More fields and nested objects: kobana schema finance.custom-classifiers.create.

Responses

HTTPDescription
201Custom classifier created. The Location header points at the new row.
400Malformed JSON body.
409X-Idempotency-Key reused with a different body.
422Schema validation failure, or company_id not in the tenant.

custom-classifiers get​

Get a custom classifier by id

kobana finance custom-classifiers get [ID] [OPTIONS]

GET /v1/custom-classifiers/{id}

Returns the same shape as the rows from the list endpoint. Requires scope finance/custom_classifiers with access level read. 404 covers both "doesn't exist" and "not in the tenant" — the API does not distinguish.

Path arguments: id

Query parameters

NameTypeRequiredDescription
fieldsstringnoComma-separated top-level fields to return, e.g. fields=description,amount,due_date. Omit for every field. id is always included; naming an object field returns it whole. An unknown name is a 400 whose details lists unknown and available.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Responses

HTTPDescription
200Get a custom classifier by id
404Custom classifier not found within the tenant.

custom-classifiers update​

Update a custom classifier

kobana finance custom-classifiers update [ID] [OPTIONS]

PATCH /v1/custom-classifiers/{id}

Partial update of name, field_type, number_format, option_style, active. Requires scope finance/custom_classifiers with access level write. Send active: false to soft-deactivate (existing assignments are preserved).

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Request body

NameTypeRequiredDescription
namestringno
field_typestringnoValues: dropdown, radio, multi_select, number, text, phone, url, date, datetime.
number_formatstringnoValues: formatted, unformatted, currency, percent, null.
option_stylestringnoValues: default, dot, null.
activebooleanno
custom_metadataobjectnoMetadados do usuário: objeto JSON livre. Envie null para limpar. Máx. 64 KB serializado, 16 níveis.
custom_metadata_modestringnoComo o custom_metadata enviado é reconciliado com o valor armazenado: replace (padrão) substitui o objeto inteiro, merge faz deep merge sobre o valor atual. Aceito apenas na atualização. Values: replace, merge.

More fields and nested objects: kobana schema finance.custom-classifiers.update.

Responses

HTTPDescription
200Updated custom classifier.
400Malformed JSON body.
404Custom classifier not found within the tenant.
409X-Idempotency-Key reused with a different body.
422Schema validation failure.

custom-classifiers delete​

Delete a custom classifier

kobana finance custom-classifiers delete [ID] [OPTIONS]

DELETE /v1/custom-classifiers/{id}

Deletes a custom classifier and its values. Requires scope finance/custom_classifiers with access level delete. Returns 422 (reason: in_use, with a usage breakdown) when any value is assigned to a payable / receivable / transaction — soft-deactivate via PATCH { active: false } instead. Calling DELETE twice returns 200 then 404.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringyesWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Responses

HTTPDescription
200Custom classifier deleted.
404Custom classifier not found within the tenant.
422The custom classifier is in use (reason: in_use).