Folders

Rename a folder

PATCH https://u2l.ai/api/v1/folders/{folderId}

Authorizations

Authorizationstringrequired

Bearer authentication header of the form Bearer <token>, where <token> is your U2L API key (u2l_live_...). Create one in the dashboard under Settings > API.

Path Parameters

folderIdstringrequired

The folder's ID.

Body

namestringrequired

New folder name.

Response 200

idstring
namestring
messagestring

Errors

401 Missing or invalid API key.
404 The resource does not exist or is not yours.
422 The request body failed validation.
429 Rate limit exceeded. Check X-RateLimit-Reset for when the window resets.

See Rate Limits & Errors for the error envelope and per-plan limits.

curl -X PATCH https://u2l.ai/api/v1/folders/9f0c2f9e \
  -H "Authorization: Bearer u2l_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Q3 campaigns"
}'
const response = await fetch("https://u2l.ai/api/v1/folders/9f0c2f9e", {
  method: "PATCH",
  headers: {
    "Authorization": "Bearer u2l_live_your_api_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Q3 campaigns"
  }),
});

const data = await response.json();
console.log(data);
import requests

response = requests.patch(
    "https://u2l.ai/api/v1/folders/9f0c2f9e",
    headers={"Authorization": "Bearer u2l_live_your_api_key"},
    json={
      "name": "Q3 campaigns"
    },
)

print(response.json())
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "name": "Q3 campaigns"
}`)
	req, _ := http.NewRequest("PATCH", "https://u2l.ai/api/v1/folders/9f0c2f9e", body)
	req.Header.Set("Authorization", "Bearer u2l_live_your_api_key")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
{
  "id": "9f0c2f9e-3b7a-4c1d-8e5f-2a6b7c8d9e0f",
  "name": "Q3 campaigns",
  "message": "Folder renamed successfully"
}