update onboarded carrier.md
Update Onboarded Carrier
Authentication
- Include your
Access-Tokenin the header of your requests. - Include your
x-api-keyThe API key provided by GenLogs. This header must be included in the request.
Permissions
The external-api-update-onboarded-carrier-contact permission is required to access this endpoint.
Endpoint
- URL:
https://api.genlogs.io/onboarded-carrier/contacts/{contact_id} - Method:
PATCH
Headers
- Access-Token: (string, required): Access token obtained from the "Create Access Token" endpoint.
- X-Api-Key (string, required): The API key provided by GenLogs.
Path Params
- contact_id (string, required): Existent contact ID, to be updated.
Request Body:
- name (string, optional): Contact name.
- phone (string, optional): Contact phone number
- email (string, optional): Contact email address.
Request Example:
curl --location --request PATCH 'https://api.genlogs.io/onboarded-carrier/contacts/ca387122-4153-418b-82df-03008cc9af9b' \
--header 'access-token: <your-api-access-token>' \
--header 'x-api-key: <your-x-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"email": "peter_parker@test_email.com",
"name": "Peter Parker",
"phone": "3432434234"
}'
Response:
- 200 OK: A JSON object containing updated information of carrier contact.
- 400 Bad Request: If required parameters are missing or invalid.
- 401 Unauthorized: If the authentication credentials (Access-Token) are missing or incorrect.
- 403 Forbidden: If the permission has not been added to your user.
- 404 Not Found: If the provided
contact_iddoesn't exist or is not created. - 500 Internal Server Error: If there is an issue on the server that prevents processing the request.
Response Body:
200 OK – Contact Created Successfully
{
"contact": {
"contact_id": "bd849e72-09f0-4d19-8b20-e227cd4ef455",
"name": "Peter Parker",
"phone": "3432434234",
"email": "peter.parker@marvel.com"
}
}
400 Bad Request
Returned when:
- All of
name,phone, andemailare null. - All of
name,phone, andemailare empty strings. - All the provided values are exactly the same as stored
{
"detail": "Value error, at least one of name, email, or phone must be provided for update."
}
401 Unauthorized
- When access-token is missing or expired
{
"detail": "Token is missing!"
}
403 Forbidden
{
"detail": "User not allowed to access this endpoint"
}
404 Not Found
{
"detail": "Preferred carrier contact not found."
}
Update an onboarded carrier contact
Updates an existing onboarded carrier contact for the authenticated customer. Requires a valid JWT token and the appropriate permission. Only the fields provided in the request body will be updated. USDOT updates are not supported by this endpoint; including
usdotin the PATCH body returns Bad Request before any persistence operation.
{"openapi":"3.0.3","info":{"title":"Onboarded Carrier Contacts API","version":"1.0.0"},"servers":[{"url":"https://api.genlogs.io"}],"security":[{"AccessTokenAuth":[],"ApiKeyAuth":[]}],"components":{"securitySchemes":{"AccessTokenAuth":{"type":"apiKey","in":"header","name":"Access-Token","description":"JWT provided directly in the Access-Token header. No \"Bearer\" prefix.\n"}},"paths":{"/onboarded-carrier/contacts/{contact_id}":{"patch":{"summary":"Update an onboarded carrier contact","description":"Updates an existing onboarded carrier contact for the authenticated customer. Requires a valid JWT token and the appropriate permission. Only the fields provided in the request body will be updated. USDOT updates are not supported by this endpoint; including `usdot` in the PATCH body returns Bad Request before any persistence operation.\n","tags":["Onboarded Carriers"],"parameters":[{"name":"contact_id","in":"path","required":true,"description":"Unique identifier of the contact to update.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Fields to update. At least one must be provided. `usdot` is not accepted in PATCH requests.\n","properties":{"name":{"type":"string","nullable":true,"description":"Contact name."},"email":{"type":"string","nullable":true,"description":"Contact email."},"phone":{"type":"string","nullable":true,"description":"Contact phone number."}},"minProperties":1}}}},"responses":{"200":{"description":"Contact updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}}}}}}},"400":{"description":"Bad Request – Missing or invalid fields.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}},"401":{"description":"Unauthorized – Invalid or missing Access-Token.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}},"403":{"description":"Forbidden – The user lacks required permission or does not own the contact.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}},"404":{"description":"Contact not found.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}},"500":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}}}}}}}