Aller au contenu

Créer un équipement (asset)

POST
/v1/assets
curl --request POST \
--url https://example.com/v1/assets \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "establishmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assetTypeId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "code": "example", "name": "example", "locationKind": "unit", "unitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "commonAreaId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "serialNumber": "example", "warrantyUntil": "2026-04-15", "notes": "example" }'
Media type application/json
object
establishmentId
required
string format: uuid
assetTypeId
required
string format: uuid
code
required
string
<= 50 characters
name
required
string
<= 200 characters
locationKind
required
string
Allowed values: unit common_area standalone
unitId
string format: uuid
nullable
commonAreaId
string format: uuid
nullable
serialNumber
string
nullable <= 100 characters
warrantyUntil
string format: date
nullable
notes
string
nullable <= 2000 characters

Asset créé

Media type application/json
object
data
required
object
assetId
required
string format: uuid
Example generated
{
"data": {
"assetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
}

Corps invalide

Media type application/json
object
code
required

Code machine de l’erreur

string
message
required

Message lisible

string
origin

Origine domaine de l’erreur (optionnel)

object
boundedContext
string
module
string
status
required
integer
traceId
required

Identifiant de corrélation pour le support

string
Example
{
"code": "RESERVATION_NOT_FOUND",
"message": "Réservation introuvable",
"status": 404
}

Non authentifié

Media type application/json
object
code
required

Code machine de l’erreur

string
message
required

Message lisible

string
origin

Origine domaine de l’erreur (optionnel)

object
boundedContext
string
module
string
status
required
integer
traceId
required

Identifiant de corrélation pour le support

string
Example
{
"code": "RESERVATION_NOT_FOUND",
"message": "Réservation introuvable",
"status": 404
}

Permission refusée

Media type application/json
object
code
required

Code machine de l’erreur

string
message
required

Message lisible

string
origin

Origine domaine de l’erreur (optionnel)

object
boundedContext
string
module
string
status
required
integer
traceId
required

Identifiant de corrélation pour le support

string
Example
{
"code": "RESERVATION_NOT_FOUND",
"message": "Réservation introuvable",
"status": 404
}