Skip to main content
PUT
/
tags
/
{id}
JavaScript
import Codeqr from '@codeqr/ts';

const client = new Codeqr({
  apiKey: process.env['CODEQR_API_KEY'], // This is the default and can be omitted
});

const tag = await client.tags.update('id', { name: 'x' });

console.log(tag.id);
curl --request PUT \
--url https://api.codeqr.io/tags/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'
import requests

url = "https://api.codeqr.io/tags/{id}"

payload = { "name": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.codeqr.io/tags/{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 => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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://api.codeqr.io/tags/{id}"

payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.codeqr.io/tags/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.codeqr.io/tags/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "name": "<string>"
}
{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#bad-request"
}
}
{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#forbidden"
}
}
{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#not-found"
}
}
{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#conflict"
}
}
{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#invite-expired"
}
}
{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#unprocessable-entity"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#rate-limit_exceeded"
}
}
{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://docs.codeqr.io/api-reference/errors#internal-server_error"
}
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Path Parameters

id
string
required

The ID of the tag to update.

Body

application/json
name
string
required
Minimum string length: 1
color
enum<string>

The color of the tag

Available options:
red,
yellow,
green,
blue,
purple,
pink,
brown

Response

The updated tag.

id
string
required

The unique ID of the tag.

name
string
required

The name of the tag.

color
enum<string>
required

The color of the tag.

Available options:
red,
yellow,
green,
blue,
purple,
pink,
brown