curl --request PUT \
--url https://eu.phrase.com/styleguide/api/v2/styleguides/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://eu.phrase.com/styleguide/api/v2/styleguides/{id}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://eu.phrase.com/styleguide/api/v2/styleguides/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu.phrase.com/styleguide/api/v2/styleguides/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://eu.phrase.com/styleguide/api/v2/styleguides/{id}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://eu.phrase.com/styleguide/api/v2/styleguides/{id}")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/styleguide/api/v2/styleguides/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "018e1234-5678-7890-abcd-ef1234567890",
"name": "English Style Guide",
"description": "Style guide for English content",
"language": {
"bcpCode": "en-GB",
"description": "English (United Kingdom)",
"language": "cs",
"region": "gb",
"script": "LATN"
},
"isDefault": false,
"createdBy": {
"id": "0015oCjtouINgRCDIvQtjo",
"username": "john.doe",
"fullName": "John Doe",
"email": "john.doe@example.com",
"avatarUrl": "https://example.com/avatars/john-doe.png"
},
"lastModifiedBy": {
"id": "0015oCjtouINgRCDIvQtjo",
"username": "john.doe",
"fullName": "John Doe",
"email": "john.doe@example.com",
"avatarUrl": "https://example.com/avatars/john-doe.png"
},
"contentGroup": {
"id": "my-content-group"
},
"versions": [
{
"id": "018e1234-5678-7890-abcd-ef1234567890",
"versionNumber": 1,
"name": "English Style Guide v1",
"description": "Initial version of the style guide",
"changeNotes": "Updated grammar rules and added new terminology",
"fileName": "StyleGuide.md",
"fileSizeBytes": 1024,
"fileType": "text/markdown",
"createdAt": "2024-01-15T10:30:00Z",
"lastModifiedAt": "2024-01-15T10:30:00Z",
"lastModifiedBy": {
"id": "0015oCjtouINgRCDIvQtjo",
"username": "john.doe",
"fullName": "John Doe",
"email": "john.doe@example.com",
"avatarUrl": "https://example.com/avatars/john-doe.png"
},
"contentGroup": {
"id": "my-content-group"
}
}
],
"createdAt": "2024-01-15T10:30:00Z",
"lastModifiedAt": "2024-01-15T10:30:00Z",
"extractedRulesCount": 25
}{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}Update a Style Guide (v2)
Updates a Style Guide with a Content Group. When a new file is uploaded, returns 202 with a jobId; poll the Get update job status API for the final result. Metadata-only updates return 200 with the updated Style Guide. Content-Type can be omitted for metadata-only updates; use multipart/form-data when uploading a file.
curl --request PUT \
--url https://eu.phrase.com/styleguide/api/v2/styleguides/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://eu.phrase.com/styleguide/api/v2/styleguides/{id}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://eu.phrase.com/styleguide/api/v2/styleguides/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu.phrase.com/styleguide/api/v2/styleguides/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://eu.phrase.com/styleguide/api/v2/styleguides/{id}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://eu.phrase.com/styleguide/api/v2/styleguides/{id}")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/styleguide/api/v2/styleguides/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "018e1234-5678-7890-abcd-ef1234567890",
"name": "English Style Guide",
"description": "Style guide for English content",
"language": {
"bcpCode": "en-GB",
"description": "English (United Kingdom)",
"language": "cs",
"region": "gb",
"script": "LATN"
},
"isDefault": false,
"createdBy": {
"id": "0015oCjtouINgRCDIvQtjo",
"username": "john.doe",
"fullName": "John Doe",
"email": "john.doe@example.com",
"avatarUrl": "https://example.com/avatars/john-doe.png"
},
"lastModifiedBy": {
"id": "0015oCjtouINgRCDIvQtjo",
"username": "john.doe",
"fullName": "John Doe",
"email": "john.doe@example.com",
"avatarUrl": "https://example.com/avatars/john-doe.png"
},
"contentGroup": {
"id": "my-content-group"
},
"versions": [
{
"id": "018e1234-5678-7890-abcd-ef1234567890",
"versionNumber": 1,
"name": "English Style Guide v1",
"description": "Initial version of the style guide",
"changeNotes": "Updated grammar rules and added new terminology",
"fileName": "StyleGuide.md",
"fileSizeBytes": 1024,
"fileType": "text/markdown",
"createdAt": "2024-01-15T10:30:00Z",
"lastModifiedAt": "2024-01-15T10:30:00Z",
"lastModifiedBy": {
"id": "0015oCjtouINgRCDIvQtjo",
"username": "john.doe",
"fullName": "John Doe",
"email": "john.doe@example.com",
"avatarUrl": "https://example.com/avatars/john-doe.png"
},
"contentGroup": {
"id": "my-content-group"
}
}
],
"createdAt": "2024-01-15T10:30:00Z",
"lastModifiedAt": "2024-01-15T10:30:00Z",
"extractedRulesCount": 25
}{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"message": "<string>",
"detail": "<string>"
}Authorizations
JWT from IDM (Authorization: Bearer )
Path Parameters
Style Guide ID
Query Parameters
Updated name
50Updated description
250Optional description of the version change
250Whether to include versions in the response
Content Group identifier from the Content Group Service.
1Body
Optional new file to create a new version. Maximum size: 150 KiB.
Response
Metadata-only update completed synchronously
Style Guide information
Unique identifier of the Style Guide
"018e1234-5678-7890-abcd-ef1234567890"
Name of the Style Guide (latest version)
50"English Style Guide"
Description of the Style Guide (latest version)
250"Style guide for English content"
Language details
Show child attributes
Show child attributes
Whether this is the default Style Guide
false
User who created the Style Guide
Show child attributes
Show child attributes
User who last modified the Style Guide
Show child attributes
Show child attributes
Content group associated with this Style Guide
Show child attributes
Show child attributes
List of all versions of this Style Guide. Only present when includeVersions=true.
Show child attributes
Show child attributes
Timestamp when the Style Guide was created
"2024-01-15T10:30:00Z"
Timestamp when the Style Guide was last modified
"2024-01-15T10:30:00Z"
Number of rules extracted and linked to the content group during this create/update operation. Only present for create/update responses when a content group is set; absent otherwise.
25
Was this page helpful?