/api/clients (POST)
POST
/api/clients
const url = 'https://example.com/api/clients';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","notes":"example","defaultHourlyRate":1,"defaultIsBillable":true,"color":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/clients \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "notes": "example", "defaultHourlyRate": 1, "defaultIsBillable": true, "color": "example" }'Authorizations
Section intitulée « Authorizations »Request Body required
Section intitulée « Request Body required » Media type application/json
object
name
string
notes
string
defaultHourlyRate
number format: double
defaultIsBillable
boolean
color
string
Example generated
{ "name": "example", "notes": "example", "defaultHourlyRate": 1, "defaultIsBillable": true, "color": "example"}Responses
Section intitulée « Responses »OK