Companies

Manage companies in Pact API v1

Companies

Get All Companies

shell
curl "https://api.pact.im/p1/companies"
  -H "X-Private-Api-Token: YOUR_API_TOKEN"

The above command returns JSON structured like this:

json
{
   "status":"ok",
   "data":{
      "companies":[
         {
            "external_id":1,
            "name":"COMPANY_NAME",
            "phone":null,
            "description":null,
            "webhook_url":null
         }
      ],
      "next_page": "fslkfg2lkdfmlwkmlmw4of94wg34lfkm34lg"
   }
}

This endpoint return list of all user companies.

HTTP Request

GET https://api.pact.im/p1/companies

Query Parameters

ParameterRequiredValidationsDescription
fromfalseMust be a String not more than 255 symbolsNext page token geted from last request. Not valid or empty token return first page
perfalseMust be a number between 1 and 100Number of elements per page. Default: 50
sort_directionfalseMust be a StringWe sort results by id. Change sorting direction. Avilable values: asc, desc. Default: asc.

Update company

shell
curl -X PUT "https://api.pact.im/p1/companies/ID"
  -H "X-Private-Api-Token: YOUR_API_TOKEN"
  -d "name=Test"

The above command returns JSON structured like this:

json
{
   "status":"updated",
   "data":{
      "external_id":2
   }
}

This endpoint updates specific company attributes.

HTTP Request

PUT https://api.pact.im/p1/companies/<ID>

URL Parameters

ParameterDescription
IDID of the company for update

Query Parameters

ParameterRequiredValidationsDescription
namefalseMust be a String not more than 255 symbolsCompany name
phonefalseMust be a StringOfficial company phone number or phone number of contact person
descriptionfalseMust be a StringCompany description
webhook_urlfalseMust be a StringEndpoint for webhooks
hiddenfalseMust be a BooleanHide/Show a company in the Pact web interface

Create new company

shell
curl -X POST "https://api.pact.im/p1/companies"
  -H "X-Private-Api-Token: YOUR_API_TOKEN"
  -d "name=Test"

The above command returns JSON structured like this:

json
{
   "status":"created",
   "data":{
      "external_id":2
   }
}

This endpoint creates a new company for user.

HTTP Request

POST https://api.pact.im/p1/companies

Query Parameters

ParameterRequiredValidationsDescription
nametrueMust be a String not more than 255 symbolsCompany name
phonefalseMust be a StringOfficial company phone number or phone number of contact person
descriptionfalseMust be a StringCompany description
webhook_urlfalseMust be a StringEndpoint in the Internet which can receive webhooks

Search…

Start typing to search