Uploading a ROM

    In order to use a Pokémon Gen 1 ROM as your data source, one must be provided.

    pkmnapi has been tested with Pokémon Red and Pokémon Blue. Other versions may not work as expected.

    Once a ROM is provided, it CANNOT be downloaded again. That would be tantamount to ROM distribution and would very much incur the wrath of Nintendo and/or Game Freak.

    Instead, patches (AKA just the changes to the ROM) may be downloaded and, since you have proven that you have the original ROM, you should be able patch your ROM manually. See the section on Downloading A Patch for more information.

    To upload a ROM, send a request to the POST /v1/roms endpoint:

    bash
    js
    curl \
        -X POST \
        -H 'Authorization: Bearer <access_token>' \
        --data-binary @path/to/rom.gb \
        https://api.pkmnapi.com/v1/roms
    

    Only one ROM may be uploaded at a time, so repeating the previous request will result in an error:

    {
        "data": "error_roms_rom_exists",
        "type": "errors",
        "attributes": {
            "message": "ROM already exists
        }
    }
    

    To delete an existing ROM, send a request to the DELETE /v1/roms endpoint:

    bash
    js
    curl \
        -X DELETE \
        -H 'Authorization: Bearer <access_token>' \
        -H 'If-Match: w/"abcdef0123456789abcdef0123456789"' \
        https://api.pkmnapi.com/v1/roms