Zum Inhalt springen

Contract Assets

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

List of valid attributes:

Attribute Description Specifics
account_id ID of the account the asset belongs to Cannot be set
asset_type One of logo, footer Must be set
value Name of the stored logo file, or the text of the footer Must be set, up to 500 characters. For logo, send a filename ending in .png, .jpg or .jpeg; the server stores a generated name instead (see below)

Example response:

{
"data": [
{
"id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93",
"type": "contract_asset",
"attributes": {
...
}
},
{
...
}
]
}

This endpoint returns the contract assets of the account.

GET /api/v1/contract_assets

Example request:

{
"data": {
"type": "contract_asset",
"attributes": {
"asset_type": "logo",
"value": "my-logo.png"
}
}
}

Example response:

{
"data": {
"id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93",
"type": "contract_asset",
"attributes": {
...
}
}
}

This endpoint creates the contract asset of the given type for the account, or updates it if the account already has one. An account has at most one asset per asset_type.

For a logo, the filename you send is only used to determine the file type (.png, .jpg or .jpeg). It is not stored: the server generates the stored value as logo-{uuid}.{extension} (for example logo-5f0c1c3e-8a52-4d1c-9c7a-2f6b0a1d9e44.png) and returns it in the response. Every upsert of a logo generates a new value, and the previously uploaded file is removed from storage.

POST /api/v1/contract_assets

Meta Description
upload_url When passing true, returns a temporary URL to upload the logo file. Only for asset_type logo.

Only valid with upsert request (POST).

Example request with meta:

POST /api/v1/contract_assets?meta[upload_url]=true

The response contains a presigned S3 POST (url and fields), valid for 60 seconds, with a maximum file size of 5 MB. The file is stored as accounts/{account_id}/contract_assets/{value}, using the generated value from the response. Upsert the logo first, then upload the file with the returned url and fields.

Example response:

{
"data": {
"id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93",
"type": "contract_asset",
"attributes": {
...
}
}
}

This endpoint deletes a contract asset.

DELETE /api/v1/contract_assets/:contract_asset_id

Parameter Description
contract_asset_id ID of the contract asset to delete