Answers.Body: <p>Use CustomField - get method to get data for the select custom field who's options you want to edit. Note down the "option_group_id" value.</p>
  
  <p>Then use the OptionGroup and OptionValue API methods with the Option Group you just noted. With this you can add new options.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-10T04:47:38.187Z
Answers.Text: You can also use a chained API to do this in one call if necessary!  In Civi 4.7, I believe you can also use a joined API call here as well.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-08T14:33:03.377Z
Answers.LastActivityDate: 2016-02-08T14:33:03.377Z
Answers.UserDisplayName: James
Answers.Body: <p>As james mentioned, it's entity=optionvalue and action=create</p>
  
  <p>However, as opposed as what you shared for the getoption, it isn't possible to have the values you want to create as a get parameter, they have to be in post (for security reasons).</p>
  
  <p>So the easiest is to use post for everything, it works and avoid the issue of knowing if it's a destructive operation or not that you want to perform in the api.</p>
  
  <p>and depending of the language you use, we might already have a wrapper that hide all these details and take care of calling the right url with the right params</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-09T15:54:28.337Z
Answers.LastActivityDate: 2016-03-09T15:54:28.337Z
Answers.UserDisplayName: Xavier
Body: <p>Using the contact - getoptions method you can read the list of options for a custom field with select type.</p>
  
  <blockquote>
    <p>/civicrm/civicrm/extern/rest.php?entity=Contact&amp;action=getoptions&amp;api_key=userkey&amp;key=sitekey&amp;json={"sequential":1,"field":"custom_5"}</p>
  </blockquote>
  
  <p>But how can I create new options using the API?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-08T14:13:21.417Z
Comments.Text: Oh, I think it's OptionValue. Let me check ....
Comments.UserDisplayName: James
Tags: <api><custom-fields>
Title: REST API - how to write new options for a custom field with select type?
ThreadText: # REST API - how to write new options for a custom field with select type?
  
  (Asked by: username_0 on 2016-02-08)
  
  Using the contact - getoptions method you can read the list of options for a custom field with select type.
  
  > /civicrm/civicrm/extern/rest.php?entity=Contact&action=getoptions&api\_key=userkey&key=sitekey&json={"sequential":1,"field":"custom\_5"}
  
  But how can I create new options using the API?
  
  **Tags:** api, custom-fields
  
  > **Comments:**
  > **username_0**: Oh, I think it's OptionValue. Let me check ....  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-02-08. Score: 1 | Accepted answer
  
  Use CustomField - get method to get data for the select custom field who's options you want to edit. Note down the "option\_group\_id" value.
  
  Then use the OptionGroup and OptionValue API methods with the Option Group you just noted. With this you can add new options.
  
  > **Comments:**
  > **username_1**: You can also use a chained API to do this in one call if necessary!  In Civi 4.7, I believe you can also use a joined API call here as well.  
  
  ---
  
  ### Answer by username_2 on 2016-03-09. Score: 0
  
  As username_0 mentioned, it's entity=optionvalue and action=create
  
  However, as opposed as what you shared for the getoption, it isn't possible to have the values you want to create as a get parameter, they have to be in post (for security reasons).
  
  So the easiest is to use post for everything, it works and avoid the issue of knowing if it's a destructive operation or not that you want to perform in the api.
  
  and depending of the language you use, we might already have a wrapper that hide all these details and take care of calling the right url with the right params
  
  
  ---
  
  