TrapGod / Documentation / Import usernames
Import usernames
POST a list of usernames. Each result says reserved or that the name has been minted.
Import usernames
Import reserves usernames your app already uses. A reserved name cannot be claimed on TrapGod signup or OG Brokerage signup. The call does not create a TrapGod account, send mail, or store an email.
Send the same application id and TrapGod API key as the other calls. Up to 40 names per call. An app can hold 400 names. Send another call for the next batch. Each name comes back in results.
Request
POST https://trapgod.net/api/link_app_import.php
X-Trapgod-Application: tgaid_0123456789abcdef01234567
X-Trapgod-Key: TRAPGOD_KEY
Content-Type: application/json
{"action":"import","handles":["name_on_this_app",{"handle":"other_name","external_id":"user_42"}]}users is accepted in place of handles.
| Field | Required | Rule |
|---|---|---|
handles or users | yes | A list of 1 to 40 names. A name is a string, or an object with handle and optional external_id. |
action | no | import or release. Omitted means import. |
external_id | no | Your own id for that person. Letters, numbers, underscore, dot, colon, or hyphen. Max 40. Do not send an email. |
A username is 3 to 30 characters: letters, numbers, and underscores. A 20-character mix of letters and digits with no underscore is rejected as a random token.
Release uses the same headers:
{"action":"release","handles":["name_on_this_app"]}Release only drops a name this app reserved.
Results
HTTP 200. ok means the call was accepted. Read each row.
{
"ok": true,
"action": "import",
"results": [
{"handle":"name_on_this_app","ok":true,"status":"reserved"},
{"handle":"other_name","ok":false,"status":"minted","error":"This username isn't available because it has been minted."}
]
}| status | Meaning |
|---|---|
reserved | This app holds the name. Signup on TrapGod and OG Brokerage will refuse it with the minted message. Sending it again stays reserved. |
minted | Someone already has that name on TrapGod, OG Brokerage, a link-app mint, or another app's import. |
released | This app dropped the hold. |
not_held | Release found no hold for this app. |
invalid | The name or external id failed the format check. |
cap | This app already holds 400 names. |
retry | A name check could not reach OG Brokerage or TrapGod. Send that name again. |
The same minted sentence is what TrapGod and OG Brokerage show when someone tries to claim the name.
Errors
| Condition | HTTP | error |
|---|---|---|
| Not POST | 405 | POST only. |
| Body is not JSON | 400 | Send JSON. |
| Body larger than 16384 bytes | 413 | That body is too large. |
| No application id, or no key | 401 | That webhook key was rejected. |
| Missing list, empty list, or more than 40 | 400 | Send handles as a list. / Send at least one username. / Send at most 40 usernames. |
action is not import or release | 400 | action must be import or release. |
Failure JSON includes trace_id. The success body does not. The trace action is link_app.import or link_app.import_deny. Role on the trace is partner.
