Skip to content
TrapGod
Sign in Create profile

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.

FieldRequiredRule
handles or usersyesA list of 1 to 40 names. A name is a string, or an object with handle and optional external_id.
actionnoimport or release. Omitted means import.
external_idnoYour 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."}
  ]
}
statusMeaning
reservedThis app holds the name. Signup on TrapGod and OG Brokerage will refuse it with the minted message. Sending it again stays reserved.
mintedSomeone already has that name on TrapGod, OG Brokerage, a link-app mint, or another app's import.
releasedThis app dropped the hold.
not_heldRelease found no hold for this app.
invalidThe name or external id failed the format check.
capThis app already holds 400 names.
retryA 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

ConditionHTTPerror
Not POST405POST only.
Body is not JSON400Send JSON.
Body larger than 16384 bytes413That body is too large.
No application id, or no key401That webhook key was rejected.
Missing list, empty list, or more than 40400Send handles as a list. / Send at least one username. / Send at most 40 usernames.
action is not import or release400action 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.

Create a payment