POST /organizations/objects/definitions

POST /organizations/objects/definitions

Create a new common resource. As an organization user, you can create fields at the organization and account level. 

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/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'Content-Type:application/json' \
  -d '{  
  "myResource":{  
    "fields":[  
      {  
        "path":"firstName",
        "type":"string"
      },
      {  
        "path":"lastName",
        "type":"string"
      }
    ],
    "level":"organization"
  }
}'

Example Response

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