Create Organization
POSThttps://sight.inspectorio.com/api/v1/organizations
Create Organization
Request​
- application/json
Body
addressstringrequired
Organization address line 1
Possible values: non-empty
Example:
5 Madison Avenue
address2string
Organization address line 2
Example:
Suite 101
billing_emailstringnullable
Billing email
Example:
email@test.com
citystringnullable
City where the organization locates
Example:
New York
contacts object[]required
countrystringrequired
ISO Alpha-2 country code
Example:
US
idstringrequired
Possible values: non-empty
linkedIdstringnullable
Default value:
null
Example:
123123
location objectnullable
namestringrequired
Name of the organization
Possible values: non-empty
Example:
Acme Corp
officeIdstringnullable
Office ID
Example:
office_123
phonestringrequired
Organization phone number
Possible values: non-empty
Example:
1505111222
postalstringnullable
Organization postal code
Example:
A1B2C3
provincestringnullable
Province where the organization locates
Example:
New York
typestringrequired
Support F(Factory) S(Supplier) B(Brand) R(Retailer) V(Vendor)
Possible values: non-empty
Example:
S
descriptionstringnullable
description of the local organization
Example:
This is a description
Responses​
- 201
- 400
- 401
- 422
- 429
- 500
Created
- application/json
- Schema
- Example (auto)
Schema
data object
{
"data": {
"address": "5 Madison Avenue",
"address2": "Suite 101",
"billing_email": "email@test.com",
"city": "New York",
"contacts": [
{
"email": "john@acme.com",
"firstName": "John",
"lastName": "Doe",
"phone": "1505123123",
"workPhone": "1505456456"
}
],
"country": "US",
"createdAt": "2021-06-02 12:34:02.861000+00:00",
"id": "string",
"linkedTo": "3111222",
"location": {
"latitude": 38.8951,
"longitude": -77.0364
},
"name": "Acme Corp",
"officeId": "office_123",
"phone": "1505111222",
"postal": "A1B2C3",
"province": "New York",
"type": "S",
"updatedAt": "2021-06-02 12:34:02.861000+00:00",
"description": "This is a description"
}
}
Bad request
- application/json
- Schema
- Example (auto)
Schema
errorCodestring
Example:
Generic
messagestring
Example:
Bad Request
{
"errorCode": "Generic",
"message": "Bad Request"
}
Unauthorized
- application/json
- Schema
- Example (auto)
Schema
errorCodestring
Example:
Generic
messagestring
Example:
Cannot retrieve session data because of expired token
{
"errorCode": "Generic",
"message": "Cannot retrieve session data because of expired token"
}
Validation Error
- application/json
- Schema
- Example (auto)
Schema
errorCodestring
Example:
Generic
errorsobject
Example:
{"type":["Input type is not valid"]}
messagestring
Example:
Validation error
{
"errorCode": "Generic",
"errors": {
"type": [
"Input type is not valid"
]
},
"message": "Validation error"
}
Rate-limiting Error
- application/json
- Schema
- Example (auto)
Schema
errorCodestring
Example:
Generic
messagestring
Example:
Too many requests
{
"errorCode": "Generic",
"message": "Too many requests"
}
Internal Error
- application/json
- Schema
- Example (auto)
Schema
errorCodestring
Example:
Generic
errorsobject
Example:
{"system":["Internal error detail message"]}
messagestring
Example:
Internal server error
{
"errorCode": "Generic",
"errors": {
"system": [
"Internal error detail message"
]
},
"message": "Internal server error"
}
Authorization: apiKey
name: apiKeytype: apiKeyin: header
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L 'https://sight.inspectorio.com/api/v1/organizations' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'apiKey: <apiKey>' \
--data-raw '{
"address": "5 Madison Avenue",
"address2": "Suite 101",
"billing_email": "email@test.com",
"city": "New York",
"contacts": [
{
"email": "john@acme.com",
"firstName": "John",
"lastName": "Doe",
"phone": "1505123123",
"workPhone": "1505456456"
}
],
"country": "US",
"id": "string",
"linkedId": "123123",
"location": {
"latitude": 38.8951,
"longitude": -77.0364
},
"name": "Acme Corp",
"officeId": "office_123",
"phone": "1505111222",
"postal": "A1B2C3",
"province": "New York",
"type": "S",
"description": "This is a description"
}'
ResponseClear