Create a company

ProRead & write key

Available on the Pro and Enterprise plans (beta).

POST…/public/companies

Creates a new company in the business that owns the key and sends the company.created event to your webhooks. The response is the new record.

Request
curl https://app.reshta.ir/api/v1/public/companies \​  -X POST \​  -H "Authorization: Bearer $RESHTA_API_KEY" \​  -H "Idempotency-Key: 7f3c2b1e-4a5d-4c6f-9e1a-2b3c4d5e6f70" \​  -H "Content-Type: application/json" \​  -d '{"name":"پوشاک نیلا","domain":"example.com"}'​

Headers

AuthorizationstringrequiredBearer followed by the business API key (rk_live_…).
Idempotency-KeystringrequiredA unique ID for this operation, such as a fresh UUID; retrying with the same key does nothing twice.
Content-Typeapplication/jsonrequiredThe body is UTF-8 JSON.

Body parameters

namestringrequiredCompany name.
domainstring | nulloptionalWebsite domain.
industrystring | nulloptionalIndustry.
national_company_idstring | nulloptionalNational company ID.
economic_codestring | nulloptionalEconomic code.
registration_nostring | nulloptionalRegistration number.
owner_iduuid | nulloptionalOnly records owned by this teammate.
customobjectoptionaldefault: {}Custom fields, keyed by field key.

Responses and errors

201—Created; the body is the record.
400validation_errorInvalid body, or no Idempotency-Key; details names the field.
401unauthorizedThe key is missing, wrong or revoked, or its creator is no longer active.
403forbiddenThe key has no write access.
409conflictThis Idempotency-Key came with another body, or is still in progress.
429rate_limitedOver 120 requests per minute; Retry-After says how many seconds to wait.
Response
400
{​  "error": {​    "code": "validation_error",​    "message": "Idempotency-Key header is required",​    "details": [​      {​        "field": "idempotency_key",​        "message": "idempotency_key_required"​      }​    ]​  }​}​
Related webhook: company.created

Create an API key and send your first request

Keys are created in the Reshta app and shown once. The API and webhooks (beta) are on the Pro and Enterprise plans, and only a business admin can create a key.

  1. 1Sign in at app.reshta.ir
  2. 2Connection → Developer
  3. 3Create API key