github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/paths/custom_metadata_properties/create.yaml (about) 1 --- 2 summary: Create a property 3 description: Create a new custom metadata property. 4 operationId: custom_metadata_property/create 5 tags: 6 - Custom Metadata 7 parameters: 8 - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" 9 - "$ref": "../../parameters.yaml#/account_id" 10 requestBody: 11 required: true 12 content: 13 application/json: 14 schema: 15 required: 16 - name 17 - data_type 18 type: object 19 title: custom_metadata_properties/create/parameters 20 properties: 21 name: 22 description: name of the property 23 example: Fruit 24 type: string 25 data_type: 26 "$ref": "../../schemas/custom_metadata_data_type.yaml#/data_type" 27 28 project_ids: 29 description: ids of projects that the property belongs to 30 type: array 31 example: 32 - abcd1234cdef1234abcd1234cdef1234 33 - abcd1234cdef1234abcd1234cdef4321 34 items: 35 type: string 36 description: 37 description: description of property 38 example: A healthy snack for all ages 39 type: string 40 value_options: 41 description: value options of property (only applies to single or multi select properties) 42 example: 43 - Apple 44 - Banana 45 - Coconut 46 type: array 47 items: 48 type: string 49 50 responses: 51 '200': 52 description: OK 53 content: 54 application/json: 55 schema: 56 "$ref": "../../schemas/custom_metadata_property.yaml#/custom_metadata_property" 57 headers: 58 X-Rate-Limit-Limit: 59 "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" 60 X-Rate-Limit-Remaining: 61 "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" 62 X-Rate-Limit-Reset: 63 "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" 64 '400': 65 "$ref": "../../responses.yaml#/400" 66 '404': 67 "$ref": "../../responses.yaml#/404" 68 '422': 69 "$ref": "../../responses.yaml#/422" 70 '429': 71 "$ref": "../../responses.yaml#/429" 72 x-code-samples: 73 - lang: Curl 74 source: |- 75 curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/properties" \ 76 -u USERNAME_OR_ACCESS_TOKEN \ 77 -X POST \ 78 -d '{"name":"Fruit","data_type":"multi_select","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \ 79 -H 'Content-Type: application/json' 80 - lang: CLI v2 81 source: |- 82 phrase custom_metadata_properties create \ 83 --account_id <account_id> \ 84 --data '{"name":"Fruit","data_type":"multi_select","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \ 85 --access_token <token> 86 x-cli-version: '2.9'