Transfer your credits to the workspace
curl --request POST \
--url https://app.miget.com/api/v1/workspace/credits/transfer \
--header 'Authorization: <api-key>'import requests
url = "https://app.miget.com/api/v1/workspace/credits/transfer"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://app.miget.com/api/v1/workspace/credits/transfer', 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://app.miget.com/api/v1/workspace/credits/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <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://app.miget.com/api/v1/workspace/credits/transfer"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.miget.com/api/v1/workspace/credits/transfer")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/workspace/credits/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance_in_cents": 123,
"balance_formatted": "<string>",
"expiring_in_cents": 123,
"expires_at": "<string>",
"operations": [
{
"id": 123,
"amount_in_cents": 123,
"operation_type": "<string>",
"description": "<string>",
"program": "<string>",
"expires_at": "<string>",
"created_at": "<string>"
}
]
}Workspace
Transfer your credits to the workspace
Moves the authenticated user’s whole credit balance (GET /users/me/credits) into the workspace’s credits, for good: a transfer cannot be undone, and the credits stay with the workspace whoever owns it later. Requires workspace:billing, which a workspace API token cannot carry, so it takes a personal token. Refused with 422 when there is nothing to transfer, the workspace is on an enterprise plan, which does not use credits, or it is suspended for review. Answers the workspace’s credits.
POST
/
api
/
v1
/
workspace
/
credits
/
transfer
Transfer your credits to the workspace
curl --request POST \
--url https://app.miget.com/api/v1/workspace/credits/transfer \
--header 'Authorization: <api-key>'import requests
url = "https://app.miget.com/api/v1/workspace/credits/transfer"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://app.miget.com/api/v1/workspace/credits/transfer', 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://app.miget.com/api/v1/workspace/credits/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <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://app.miget.com/api/v1/workspace/credits/transfer"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.miget.com/api/v1/workspace/credits/transfer")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/workspace/credits/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance_in_cents": 123,
"balance_formatted": "<string>",
"expiring_in_cents": 123,
"expires_at": "<string>",
"operations": [
{
"id": 123,
"amount_in_cents": 123,
"operation_type": "<string>",
"description": "<string>",
"program": "<string>",
"expires_at": "<string>",
"created_at": "<string>"
}
]
}Authorizations
Response
Transfer your credits to the workspace
Api_V1_Entities_WorkspaceCredits model

