Create an API key
Step by step: create an Ur Next Door API key in Settings > API keys on the website or in the app, copy it once, and store it in UND_API_KEY.
You create API keys yourself, in your account settings, on the website or in the app. This page walks through both, then shows how to store the key so tools can use it without it ever appearing in your code.
Before you start
- You need an active Ur Next Door account. Any plan works, including Free.
- You can hold up to 5 active keys at a time. Revoked and expired keys do not count toward the 5.
- Decide which tool will use the key. Create one key per tool (for example one for Claude Code and one for Zapier), so you can revoke one without breaking the others.
Create a key on the website
- Sign in at urnextdoor.com.
- Open Settings, then the API keys tab. The direct address is
https://urnextdoor.com/settings/api-keys. - Select Create API key and fill in the dialog:
- Name. Something that tells you later where the key lives, for example
Claude Code on my laptoporZapier: weekly poll. - This key may. Tick only what the tool needs: Create content (scope
content), Upload images (media), Manage scheduled (schedule) and Read lookups (read). All four are ticked to start with. For an AI agent that writes posts with images, keep Create content, Upload images and Read lookups; keep Manage scheduled if it should also move or cancel scheduled items. See Scopes. - Expires. 30 days, 90 days (the default), 1 year, or never. Shorter is safer; you can always create a new key later.
- Name. Something that tells you later where the key lives, for example
- Select Create key. The dialog changes to Your new API key and shows the full key once, starting with
und_sk_. - Select Copy next to the key and keep it somewhere safe for the next step, then select Done. If you try to close the dialog without copying, it asks you to confirm. Ur Next Door stores only a fingerprint (a hash) of the key, so nobody, including support, can show it to you again.
Copy it now
If you close the dialog without copying the key, it cannot be recovered. Revoke it and create a new one.
After you create it, the key appears in your list with its name, the first characters (for example und_sk_7Hq2x), the last four characters, its scopes, its status, when it was created, when it was last used and when it expires. We also email you whenever a new key is created on your account, so you notice a key you did not make.
Create a key in the app
- Open the Ur Next Door app and sign in.
- Go to Settings and open the API keys tab.
- Fill in the same three fields: Name, Scopes and Expiry.
- Create the key and copy it with the copy control. It is shown only once.
- Send it to the computer that will use it in a way only you can read, for example a password manager. Avoid pasting it into chats, emails or notes apps that sync to other people.
Note
Keys made in the app and on the website are the same kind of key and appear in both lists. Revoking one in either place revokes it everywhere.
Store the key in UND_API_KEY
Every example in these docs reads the key from an environment variable named UND_API_KEY. That keeps the key out of your code, your prompts and your shell history.
macOS and Linux
# Paste the key when asked. It is not shown on screen and not saved in your history.
read -rs UND_API_KEY && export UND_API_KEY
# Check that it is set by printing only its first 12 characters
echo "${UND_API_KEY:0:12}..."This lasts until you close the terminal. To keep it, add a line export UND_API_KEY="und_sk_..." to your shell profile (~/.zshrc on macOS, ~/.bashrc on most Linux systems) with a text editor, and make the file readable only by you with chmod 600 ~/.zshrc. Open a new terminal afterwards.
Windows
- Press the Windows key and search for Edit environment variables for your account.
- Under User variables, choose New.
- Set the name to
UND_API_KEYand paste the key as the value. Save. - Close and reopen your terminal, editor or AI tool so it picks up the variable.
In PowerShell you can set it for the current window only:
$env:UND_API_KEY = Read-Host -Prompt "Paste your Ur Next Door API key"In a project folder
Many tools read a .env file in the project folder:
UND_API_KEY=und_sk_...Add .env to your .gitignore before you create the file, so the key is never committed.
Check that the key works
GET /api/v1/me works with any valid key and tells you which member and key you are using:
curl "https://urnextdoor.com/api/v1/me" \
-H "Authorization: Bearer $UND_API_KEY"const res = await fetch("https://urnextdoor.com/api/v1/me", {
headers: {
Authorization: `Bearer ${process.env.UND_API_KEY}`,
},
});
console.log(res.status, await res.json());import os
import requests
api_key = os.environ["UND_API_KEY"]
response = requests.get(
"https://urnextdoor.com/api/v1/me",
headers={
"Authorization": f"Bearer {api_key}",
},
timeout=30,
)
print(response.status_code, response.json())<?php
$apiKey = getenv('UND_API_KEY');
$ch = curl_init('https://urnextdoor.com/api/v1/me');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $body, PHP_EOL;Sample response: 200 OK
{
"ok": true,
"user": {
"id": 7,
"username": "aarav",
"display_name": "Aarav",
"plan": "free",
"profile_url": "https://urnextdoor.com/users/aarav"
},
"key": {
"id": 3,
"name": "Claude Code",
"prefix": "und_sk_7Hq2x",
"scopes": [
"content",
"media",
"schedule",
"read"
],
"created_at": "2026-10-15T09:00:00Z",
"expires_at": "2027-01-13T09:00:00Z"
},
"request_id": "9f8e7d6c5b4a3921"
}A 401 with missing_api_key means the header was not sent (usually the variable is empty in that terminal). A 401 with invalid_api_key means the key was mistyped, revoked or expired.
Manage, rotate and revoke keys
- Revoke a key from the API keys tab whenever you stop using it, or at once if you think it leaked. It stops working immediately.
- Rotate by creating a new key, updating
UND_API_KEYwhere it is used, checkingGET /api/v1/me, then revoking the old key. - Recent requests on the same tab lists each recent call: time, method, route, status, error code, the key prefix, the client and how long it took. Use it to confirm a tool is doing what you expect.
More in Keep your API key safe.
Frequently asked questions
I lost my key. Can I see it again?
No. Only a fingerprint of the key is stored, so it cannot be shown again. Revoke the lost key and create a new one.
How many keys can I have?
Up to 5 active keys at a time. Revoked and expired keys do not count.
What happens when a key expires?
Requests with it answer 401 with the code invalid_api_key. Create a new key and update the tool that used the old one.
Do my keys keep working after I reset my password?
No. Resetting your password revokes all of your API keys, in case the reset happened because your account was at risk. Create new keys afterwards.
Can I change the scopes of an existing key?
Create a new key with the scopes you want, switch your tool to it, and revoke the old key.
Next steps
- Make your first request with your new key.
- Connect it to an AI tool: Claude Code, Codex CLI or ChatGPT.
- Read Keep your API key safe.
Last updated