Vincular o cartão compartilhado
Vincula o seu cartão de reserva (cartão compartilhado) a {workspaceId}: quando a carteira do próprio workspace não cobre uma cobrança da plataforma (renovação, números extras, linhas) e ele não tem cartão próprio, o seu cartão paga. A origem é o workspace que a equipe da Pilot Status configurou como o seu cartão de reserva. Sem corpo. Só o Proprietário de {workspaceId}. Idempotente: já vinculado à mesma origem → 200 com changed: false. Quando muda, o Histórico do workspace registra Cartão de reserva vinculado (sem e-mail).
Requer uma chave de conta (ps_account_, criada em Perfil → API). Chaves de workspace, de número e tokens OAuth/MCP recebem 403 ACCOUNT_KEY_REQUIRED. Enviado com Cache-Control: no-store.
curl --request PUT \
--url https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card"
headers = {"x-api-key": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card', 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://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"workspaceId": "cmh2a9z8y0002ws8example1q",
"sharedCard": {
"linked": true,
"sourceWorkspaceId": "cmh2a1b2c0001ws8example7k"
},
"changed": true
}ps_account_) e o papel de Proprietário. Veja Cartão compartilhado por workspace.Autorizações
Sua chave de API ps_
Parâmetros de caminho
Id do workspace, obtido em GET /v1/workspaces.
Esta página foi útil?
curl --request PUT \
--url https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card"
headers = {"x-api-key": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card', 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://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/shared-card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"workspaceId": "cmh2a9z8y0002ws8example1q",
"sharedCard": {
"linked": true,
"sourceWorkspaceId": "cmh2a1b2c0001ws8example7k"
},
"changed": true
}