/cost-centers/{costCenterId}
This endpoint updates information of an specific Cost Center identified by the {costCenterId} path parameter.
updateCostCenter
| Name | Type | Description |
|---|---|---|
costCenterId
required
|
string |
Cost Center ID |
Content-Type: application/json
name
string
Name for the Cost Center.
Example: AVAC Corretiva
code
string
Code for the Cost Center
Example: C.AVAC
responsible_name
string | null
Name for the person responsible for the Cost Center
Example: Luis
responsible_email
string | null
Email for the person responsible for the Cost Center
Example: luis@example.com
responsible_phone
string | null
Phone Number for the person responsible for the Cost Center
Example: +351912345678
responsible_cellphone
string | null
Cellphone Number for the person responsible for the Cost Center
Example: +351912345678
observation
string | null
User defined Observations for the Cost Center
Example: An observation regarding my cost center.
file
string (byte) | null
Image File to be attached to the Cost Center. Accepted extensions are: - `jpeg` - `bmp` - `png` - `jpg` - `gif` Maximum file size allowed: - `200.000 KB`
data
object
Cost Center resource structure details. Cost Centers in Infraspeak can be associated to Lines in Sales and Buy Orders, Failures (Work Orders) or Scheduled Works (Planned Job Orders).
id
string
read-only
Cost Center ID
type
string
read-only
Resource type
cost_center
attributes
object
name
string
Name for the Cost Center.
Example: AVAC Corretiva
code
string
Code for the Cost Center
Example: C.AVAC
responsible_name
string | null
Name for the person responsible for the Cost Center
Example: Luis
responsible_email
string | null
Email for the person responsible for the Cost Center
Example: luis@example.com
responsible_phone
string | null
Phone Number for the person responsible for the Cost Center
Example: +351912345678
responsible_cellphone
string | null
Cellphone Number for the person responsible for the Cost Center
Example: +351912345678
observation
string | null
User defined Observations for the Cost Center
Example: An observation regarding my cost center.
included
array<union>
Resources related to Cost Centers available when using the `expanded` parameter
id
string
required
read-only
ID of the File
type
string
required
read-only
Model type
file
attributes
object
required
file_id
integer
read-only
File Id
file_uuid
string
read-only
File UUID
related_to
string
Object which the File is related to
BUILDING
CATEGORY
CLIENT
ELEMENT
ELEMENT_REGISTRY
FAILURE
METERING_REGISTRY
OPERATOR
ORDER
QUOTE
QUOTE_REQUEST
RECEIVED_QUOTE
RECEIVED_QUOTE_REQUEST
REQUEST
SELL_ORDER
SUPPLIER
SCHEDULE_WORK
WORK
SCHEDULED_WORK
PURCHASE
PURCHASE_MATERIAL_LINE
PURCHASE_SERVICE_LINE
SALE
related_to_id
integer
Relations Id
related_type
string
read-only
Object which the File is related to
BUILDING
CATEGORY
CLIENT
ELEMENT
ELEMENT_REGISTRY
FAILURE
METERING_REGISTRY
OPERATOR
ORDER
QUOTE
QUOTE_REQUEST
RECEIVED_QUOTE
RECEIVED_QUOTE_REQUEST
REQUEST
SELL_ORDER
SUPPLIER
SCHEDULE_WORK
WORK
file_label_id
integer | null
File Label Id
name
string
File name
Example: my_example_file
thumb
string | null
read-only
URL to the thumbnail, in case the File is an image.
file_url
string (uri)
read-only
URL to the File
description
string | null
expire_date
string (date-time) | null
read-only
Example: 2020-08-28T17:12:00.000Z
has_reminder
boolean
read-only
file_type
string
read-only
Internal type of the file
cad
compressed
file
image
office
other
pdf
signature
video
permission_to_technician
boolean
permission_to_manager
boolean
permission_to_direct
boolean
extension
string
read-only
3gp
3gpp
bin
bmp
cad
csv
doc
docx
gif
jpeg
jpg
kmz
mov
mp4
odf
odp
pdf
png
ppt
pptx
qt
rar
txt
xls
xlsx
zip
network_status
string
Show the network status of the file.
SHARED
RECEIVED
NOT_SHARED
shared_with_supplier
boolean
Show if the file is currently in a shared status with the supplier.
shared_with_client
boolean
Show if the file is currently in a shared status with the client.
file_size
integer
read-only
created_at
string | null
read-only
Example: 2021-07-21 18:38:00
status
string
error
error
object
properties
object
Only present when related to property validation error
dev_message
string
Example: Property validation error. Check the "properties" section in the response.
http_code
integer
400
message
string
Example: Property validation error.
more_info
string
status
string
error
error
object
http_code
integer
401
message
string
Example: Authentication token invalid.
more_info
string
status
string
error
error
object
http_code
integer
404
message
string
Example: Resource not found
more_info
string | null
status
string
error
error
object
http_code
integer
429
message
string
Example: Too Many Requests.
more_info
string
status
string
error
error
object
http_code
integer
500
message
string
Example: An error has occurred during the request.
more_info
string
curl -X PATCH \
'https://api.sandbox.infraspeak.com/v3/cost-centers/{costCenterId}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"name": "AVAC Corretiva",
"code": "C.AVAC",
"responsible_name": "Luis",
"responsible_email": "luis@example.com",
"responsible_phone": "+351912345678",
"responsible_cellphone": "+351912345678",
"observation": "An observation regarding my cost center.",
"file": ""
}'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/cost-centers/{costCenterId}', {
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
"name": "AVAC Corretiva",
"code": "C.AVAC",
"responsible_name": "Luis",
"responsible_email": "luis@example.com",
"responsible_phone": "+351912345678",
"responsible_cellphone": "+351912345678",
"observation": "An observation regarding my cost center.",
"file": ""
}),
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->patch('https://api.sandbox.infraspeak.com/v3/cost-centers/{costCenterId}',
array (
'name' => 'AVAC Corretiva',
'code' => 'C.AVAC',
'responsible_name' => 'Luis',
'responsible_email' => 'luis@example.com',
'responsible_phone' => '+351912345678',
'responsible_cellphone' => '+351912345678',
'observation' => 'An observation regarding my cost center.',
'file' => '',
)
);
import requests
response = requests.patch(
'https://api.sandbox.infraspeak.com/v3/cost-centers/{costCenterId}',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
json={
{
"name": "AVAC Corretiva",
"code": "C.AVAC",
"responsible_name": "Luis",
"responsible_email": "luis@example.com",
"responsible_phone": "+351912345678",
"responsible_cellphone": "+351912345678",
"observation": "An observation regarding my cost center.",
"file": ""
}
},
)
data = response.json()