Answers.Body: <p>You can use the Api Explorer to fetch an existing case type with definition and inspect it.</p>
  
  <p><a href="https://i.sstatic.net/EeJRE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/EeJRE.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-30T15:07:16.110Z
Answers.Text: Thanks Coleman, pretty ad I did not think of that myself :-(
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-29T18:09:01.990Z
Answers.LastActivityDate: 2017-11-29T18:09:01.990Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>It's probably actually easiest to look at the code. CRM_Case_BAO_CaseType::convertDefinitionToXML() gives the list of array elements to set, e.g.</p>
  
  <pre><code>$definition = array(
    'activityTypes' =&gt; array(
      'key1' =&gt; 'value1',
      'key2' =&gt; 'value2',
    ),
  
    'statuses' =&gt; array(
      'blah1',
      'blah2',
    ),
  // etc...
  );
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-27T17:47:11.387Z
Answers.LastActivityDate: 2017-11-27T17:47:11.387Z
Answers.UserDisplayName: Demerit
Body: <p>I am trying to use the CaseType API to create a case_type but I can not find any documentation on how to set the <strong>definition</strong> parameter. Any hints or should I just dive into the code?</p>
  
Tags: <api><civicase>
Title: How to load the definition of a case type with the CaseType API
ThreadText: # How to load the definition of a case type with the CaseType API
  
  (Asked by: username_0 on 2017-11-27)
  
  I am trying to use the CaseType API to create a case\_type but I can not find any documentation on how to set the **definition** parameter. Any hints or should I just dive into the code?
  
  **Tags:** api, civicase
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-11-29. Score: 1
  
  You can use the Api Explorer to fetch an existing case type with definition and inspect it.
  
  [![enter image description here](https://i.sstatic.net/EeJRE.png)](https://i.sstatic.net/EeJRE.png)
  
  > **Comments:**
  > **username_0**: Thanks username_1, pretty ad I did not think of that myself :-(  
  
  ---
  
  ### Answer by username_2 on 2017-11-27. Score: 1
  
  It's probably actually easiest to look at the code. CRM_Case_BAO_CaseType::convertDefinitionToXML() gives the list of array elements to set, e.g.
  $definition = array(
    'activityTypes' => array(
      'key1' => 'value1',
      'key2' => 'value2',
    ),
  
    'statuses' => array(
      'blah1',
      'blah2',
    ),
  // etc...
  );
  
  
  ---
  
  