How the ja.cat API Works

How to enable ja.cat API access and which actions you can run to automate creating and managing your short links.
The ja.cat API lets you integrate the tool directly into your application or automate the creation and management of links without accessing the control panel. In this guide we explain how to enable API access and what actions you can execute.
Step by step to start using the API
1. Log in to your ja.cat account.


2. Go to your control panel and find the API section.
Enable access and the system will automatically generate an access key: a 64-character alphanumeric password that only you know. You can regenerate it at any time.


3. Click «Consulta la documentació pública de l’API» to see all available actions and how to execute them.


4. To use the API, every request you send to the server must include your access key.
This allows the system to verify that it is you making the request. If you automate the process, you can add a function that includes the key automatically in every request.
5. In the «Referència ràpida» section you will find a summary of all available actions.
The «Funcions» section contains the specific instructions for executing each one.
What can you do with the API?
- List all your links (GET /urls): this function retrieves the identifiers of all your links. No special parameters are needed.
- Create a new short link (POST /url): this call uses two parameters. You need to provide the long URL (the destination page) and the short link that will appear after ja.cat/.
- Edit the long URL of an existing link (PUT /url): you need the identifier of the link you want to modify, and you must specify it in the call URL. To modify the link with identifier 1043, the call URL will be https://servei.ja.cat/url/1043. The call uses two parameters: the long URL (the new destination page) and whether you want the link to be active or not.
- Delete a link (DELETE /url): no parameters are needed. Just specify the identifier of the link you want to delete in the request URL. To delete link 1042: https://servei.ja.cat/url/1042.
- Enable or disable a link (PUT /estat): no parameters are needed. Just specify the identifier of the link you want to modify. To modify link 1041: https://servei.ja.cat/estat/1041.
- Check if a link name is available (GET /disponibilitat): no parameters are needed. Just add the short link at the end of the URL, after /disponibilitat. For example: https://servei.ja.cat/disponibilitat/20anysdomini.
Remember that you will find all this information in the ja.cat public API documentation, accessible from the API section of your control panel.



