POST /organizations/objects/{objectName}/definitions

POST /organizations/objects/{objectName}/definitions

Create a single new common resource by passing the name as a path parameter. 

POST /organizations/objects/{objectName}/definitions Path Parameters

objectName
The name of the common resource.

Request Body Parameters

objectName
The name of the common resource.
Required
fields
An object containing the field names and data types of the resource.
Required
path
The name of the field.
Required
type
The data type of the field.
Required
levelThe level at which the field exists, either organization, account, or instance. Organization users can create fields at any level, account users can create fields only at the accountor instance level.
Optional

Example Request

curl -X POST \
  https://api-us.integrate.sugarapps.com/elements/api-v2/organizations/objects/myResource2/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \
  -d '{
  "fields": [
    {
      "path": "address",
      "type": "string"
    }
  ]
}
'

Example Response

{
  "myResource": {
    "fields": [
      {
        "type": "string",
        "path": "address"
      }
    ],
    "level": "organization"
  }
}