How To Create a Company API Route in Phin Security
The guide explains how to create a company API route in Phin Security that allows partners to add companies to their accounts by sending a JSON body with a required "name" string and an optional "industry" string from a specified list of allowed industries, detailing request body format, sample responses, and error codes such as 400 for bad requests, 403 for unauthorized access, and 500 for server errors.
How To Create a Company API Route in Phin Security
This API route allows partners to quickly create companies in their partner accounts.
Body Reference
| Field | Type | Example |
| name | string | CompanyName |
| industry(optional) | string | education |
Body Sample
{name: 'myCompanyName', industry: 'education'}
Allowed Industry Values
['healthcare', 'dental', 'legal', 'accounting-and-tax',\ 'financial-services', 'wealth-management-and-investment-advisory',\ 'insurance', 'manufacturing', 'construction-and-trades', 'real-estate-and-property-management', 'architecture-and-engineering', 'nonprofit',\ 'education', 'local-government-and-municipal', 'professional-services-and-consulting', 'technology-and-software', 'retail-and-ecommerce',\ 'hospitality-and-food-service', 'transportation-and-logistics',\ 'automotive-dealerships-and-service']
Response Sample
{name: 'myCompanyName', id: 'abc123'}
Error Reference
| Code | Causes |
| 500 | Server Error! If this error code persists, reach out to Phin support. |
| 403 | Unauthorized request! Ensure that your access token is correct, the URL contains your correct partnerId, and there are no typos in your request. |
| 400 | Bad Request! One or more of the attributes provided in the body of the request were incorrect types or malformed. Double check that there are no typos and that each field follows the reference above. If an invalid industry was provided, the response will contain the allowed values. |
Response Samples
{status: 500, message: 'Internal Server Error, if this persists please contact Phin Support!'}
{status: 400, message: 'Bad request. industry must be one of the allowed industry values.', allowedIndustries}
Was this article helpful?
YesNo