Box Developer Documentation

A beta version of the new Box developer documentation site is launching soon! Updated Developer Guides, modern API Reference, and AI-powered search are on the way to help you build with Box faster. Stay tuned for more updates.

Create Web Link

Create Web Link

To create a web link in Box, you will need to provide our API with a folder id and the url you want the web link to be linked to. The url must start with http:// or https://.

cURL
curl -i -X POST "https://api.box.com/2.0/web_links" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "name": "Cloud Content Management",
       "url": "https://box.com",
       "parent": {
         "id": "0"
       }
     }'
Node/TypeScript v10
await client.webLinks.createWebLink({
  url: 'https://www.box.com',
  parent: { id: parent.id } satisfies CreateWebLinkRequestBodyParentField,
  name: getUuid(),
  description: 'Weblink description',
} satisfies CreateWebLinkRequestBody);
Python v10
client.web_links.create_web_link(
    "https://www.box.com",
    CreateWebLinkParent(id=parent.id),
    name=get_uuid(),
    description="Weblink description",
)
.NET v10
await client.WebLinks.CreateWebLinkAsync(requestBody: new CreateWebLinkRequestBody(url: "https://www.box.com", parent: new CreateWebLinkRequestBodyParentField(id: parent.Id)) { Name = Utils.GetUUID(), Description = "Weblink description" });
Swift v10
try await client.webLinks.createWebLink(requestBody: CreateWebLinkRequestBody(url: "https://www.box.com", parent: CreateWebLinkRequestBodyParentField(id: parent.id), name: Utils.getUUID(), description: "Weblink description"))
Java v10
client.getWebLinks().createWebLink(new CreateWebLinkRequestBody.Builder(url, new CreateWebLinkRequestBodyParentField(parent.getId())).name(name).description(description).build())
.NET v6
await client.WebLinks.CreateWebLinkAsync(requestBody: new CreateWebLinkRequestBody(url: "https://www.box.com", parent: new CreateWebLinkRequestBodyParentField(id: parent.Id)) { Name = Utils.GetUUID(), Description = "Weblink description" });
Node v4
await client.webLinks.createWebLink({
  url: 'https://www.box.com',
  parent: { id: parent.id } satisfies CreateWebLinkRequestBodyParentField,
  name: getUuid(),
  description: 'Weblink description',
} satisfies CreateWebLinkRequestBody);