Registries
Create a container registry credential
Stores credentials for a private container registry. Credentials are write-only.
POST
/
v2
/
registries
Create a container registry credential
curl --request POST \
--url https://api.runpod.io/v2/registries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "dockerhub-private",
"username": "runpod-user",
"password": "correct-horse-battery-staple"
}
'import requests
url = "https://api.runpod.io/v2/registries"
payload = {
"name": "dockerhub-private",
"username": "runpod-user",
"password": "correct-horse-battery-staple"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'dockerhub-private',
username: 'runpod-user',
password: 'correct-horse-battery-staple'
})
};
fetch('https://api.runpod.io/v2/registries', 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://api.runpod.io/v2/registries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'dockerhub-private',
'username' => 'runpod-user',
'password' => 'correct-horse-battery-staple'
]),
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.runpod.io/v2/registries"
payload := strings.NewReader("{\n \"name\": \"dockerhub-private\",\n \"username\": \"runpod-user\",\n \"password\": \"correct-horse-battery-staple\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.runpod.io/v2/registries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"dockerhub-private\",\n \"username\": \"runpod-user\",\n \"password\": \"correct-horse-battery-staple\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runpod.io/v2/registries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"dockerhub-private\",\n \"username\": \"runpod-user\",\n \"password\": \"correct-horse-battery-staple\"\n}"
response = http.request(request)
puts response.read_body{
"id": "6n2k8v4d",
"name": "dockerhub-private"
}{
"title": "Bad Request",
"status": 400,
"detail": "request could not be processed"
}{
"title": "Unauthorized",
"status": 401,
"detail": "missing bearer token"
}{
"title": "Forbidden",
"status": 403,
"detail": "access denied"
}{
"title": "Unprocessable Entity",
"status": 422,
"detail": "Request validation failed."
}{
"title": "Too Many Requests",
"status": 429,
"detail": "rate limit exceeded for the minute window"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<string>"
]
}Authorizations
Runpod API key authentication. Generate an API key in the Runpod console and send it in the Authorization header as Bearer <api_key>. Keys are scoped to the permissions granted when created; requests may return 403 when a valid key lacks access to the requested resource or action.
Body
application/json
Was this page helpful?
Previous
Get a container registry credentialReturns a single container registry credential by ID. `username` and
`password` are never included in the response — credentials are
write-only, matching `createRegistry`.
Next
⌘I
Create a container registry credential
curl --request POST \
--url https://api.runpod.io/v2/registries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "dockerhub-private",
"username": "runpod-user",
"password": "correct-horse-battery-staple"
}
'import requests
url = "https://api.runpod.io/v2/registries"
payload = {
"name": "dockerhub-private",
"username": "runpod-user",
"password": "correct-horse-battery-staple"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'dockerhub-private',
username: 'runpod-user',
password: 'correct-horse-battery-staple'
})
};
fetch('https://api.runpod.io/v2/registries', 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://api.runpod.io/v2/registries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'dockerhub-private',
'username' => 'runpod-user',
'password' => 'correct-horse-battery-staple'
]),
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.runpod.io/v2/registries"
payload := strings.NewReader("{\n \"name\": \"dockerhub-private\",\n \"username\": \"runpod-user\",\n \"password\": \"correct-horse-battery-staple\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.runpod.io/v2/registries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"dockerhub-private\",\n \"username\": \"runpod-user\",\n \"password\": \"correct-horse-battery-staple\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runpod.io/v2/registries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"dockerhub-private\",\n \"username\": \"runpod-user\",\n \"password\": \"correct-horse-battery-staple\"\n}"
response = http.request(request)
puts response.read_body{
"id": "6n2k8v4d",
"name": "dockerhub-private"
}{
"title": "Bad Request",
"status": 400,
"detail": "request could not be processed"
}{
"title": "Unauthorized",
"status": 401,
"detail": "missing bearer token"
}{
"title": "Forbidden",
"status": 403,
"detail": "access denied"
}{
"title": "Unprocessable Entity",
"status": 422,
"detail": "Request validation failed."
}{
"title": "Too Many Requests",
"status": 429,
"detail": "rate limit exceeded for the minute window"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<string>"
]
}