Create authorization request
curl --request POST \
--url https://submit.hackclub.com/api/authorize \
--header 'Authorization: Bearer <token>'import requests
url = "https://submit.hackclub.com/api/authorize"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://submit.hackclub.com/api/authorize', 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://submit.hackclub.com/api/authorize",
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: Bearer <token>"
],
]);
$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://submit.hackclub.com/api/authorize"
req, _ := http.NewRequest("POST", url, nil)
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.post("https://submit.hackclub.com/api/authorize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://submit.hackclub.com/api/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"auth_id": "8eaa8b02-1018-4075-aec0-7872e5db18aa",
"popup_url": "https://submit.hackclub.com/popup/authorize/8eaa8b02-1018-4075-aec0-7872e5db18aa",
"status": "pending",
"expires_at": "2025-08-27T00:26:18.573Z"
}{
"error": "Invalid or inactive API key"
}API documentation
Create authorization request
Creates a new authorization request scoped to the program identified by the bearer API key. Returns a popup URL the end user must open to complete identity authorization. Requests expire after 15 minutes.
POST
/
api
/
authorize
Create authorization request
curl --request POST \
--url https://submit.hackclub.com/api/authorize \
--header 'Authorization: Bearer <token>'import requests
url = "https://submit.hackclub.com/api/authorize"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://submit.hackclub.com/api/authorize', 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://submit.hackclub.com/api/authorize",
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: Bearer <token>"
],
]);
$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://submit.hackclub.com/api/authorize"
req, _ := http.NewRequest("POST", url, nil)
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.post("https://submit.hackclub.com/api/authorize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://submit.hackclub.com/api/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"auth_id": "8eaa8b02-1018-4075-aec0-7872e5db18aa",
"popup_url": "https://submit.hackclub.com/popup/authorize/8eaa8b02-1018-4075-aec0-7872e5db18aa",
"status": "pending",
"expires_at": "2025-08-27T00:26:18.573Z"
}{
"error": "Invalid or inactive API key"
}- Creates a new authorization request for headless OAuth flows
- Returns a popup URL that users can visit to complete identity verification
- Requires Bearer token authentication with your program API key
- Authorization requests expire after 15 minutes
Authorizations
Program API key obtained from the admin dashboard
Response
Authorization request created successfully
Unique identifier for this authorization request
URL for the user to visit in a popup window to complete authorization
Current status of the authorization request
Available options:
pending When this authorization request expires (15 minutes from creation)
Was this page helpful?
⌘I