# Write api fields (url)

**URL:** <https://forum.builder.io/t/write-api-fields-url/2812>\
**Category:** Technical Questions\
**Created:** [October 28, 2022, 8:59pm UTC](https://forum.builder.io/t/write-api-fields-url/2812 "2022-10-28T20:59:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan-applied](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nathan-applied](https://forum.builder.io/u/nathan-applied)\
**Post date:** [October 28, 2022, 8:59pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/1 "2022-10-28T20:59:05Z")

</div>

I’m trying to use the write API to create pages dynamically. Unfortunately, the documentation is severely lacking, so I’ve had to guess at what field names should be. I’ve been able to determine the meta tags, title, description, but I cannot find what to use for the url / slug. Anyone had success with this or know where to find this information?

**Builder content link**

> **[Builder.io: Drag and drop Visual CMS](https://builder.io/content?model=109174e05be1415ba885ca1a1fccbb3c)**
>
> Build and optimize digital experiences for any tech stack, visually.

---

<div class="post-metadata">

**Author:** ![wikkes](https://avatars.discourse-cdn.com/v4/letter/w/7ba0ec/32.png) [@wikkes](https://forum.builder.io/u/wikkes)\
**Post date:** [October 31, 2022, 4:02pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/2 "2022-10-31T16:02:05Z")

</div>

@nathan-applied any news on this? i’m running into the same problems.

---

<div class="post-metadata">

**Author:** ![nicke920](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nicke920](https://forum.builder.io/u/nicke920)\
**Post date:** [October 31, 2022, 4:08pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/3 "2022-10-31T16:08:58Z")

</div>

Hi there,

Thank you for reaching out to support!

If you go to [builder.io/api-explorer](http://builder.io/api-explorer) and check a content object for any entry, you can [edit any field there](https://loom.com/i/b8e58ccc845e47f9b96e5d50ecb69724) and put it in the Write API and it should update in builder.

For the data that goes inside of the data object, these are typically found in the custom fields you set up when creating a model: [Loom | Free Screen & Video Recording Software | Loom](https://www.loom.com/share/baec2d428bdc4238a15cd90195703315)

Here’s a video of a sample post using the Write API and specifying the url path: [Loom | Free Screen & Video Recording Software | Loom](https://www.loom.com/share/547964fbb33d45e1abf4a5694a55cc4e)

Hope this was able to provide some clarification!

---

<div class="post-metadata">

**Author:** ![nathan-applied](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nathan-applied](https://forum.builder.io/u/nathan-applied)\
**Post date:** [October 31, 2022, 4:53pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/4 "2022-10-31T16:53:18Z")

</div>

Hi @nicke920 , thanks for the reply. When I inspect a style-page that was created it shows the url as data.url in the object. However if I try to create a page with that attribute it is left empty.  
This is a style-page object:

```auto
{
  "results": [
    {
      "createdDate": 1667233235611,
      "data": {
        "description": "adfasdf",
        "metaTags": "test,tag1",
        "target": "test123",
        "title": "Test PAGE",
        "url": "/test1234"
      },
      "id": "df85f31500e6406481ef8cc091fa9e86",
      "modelId": "109174e05be1415ba885ca1a1fccbb3c",
      "name": "TEST!",
      "published": "published",
      "target": {
        "urlPath": "test111"
      },
      "url": "/test123",
      "createdBy": "PfMzVdcytGZW3Cx5c0bt2wPcCan1",
      "lastUpdated": 1667234870129,
      "lastUpdatedBy": "PfMzVdcytGZW3Cx5c0bt2wPcCan1",
      "meta": {
        "kind": "page",
        "lastPreviewUrl": "https://site.fdc-dev.com/test1234?builder.space=16a0905ab0f6474197d24babc69e9bfc&builder.cachebust=true&builder.preview=style-page&builder.noCache=true& __builder_editing__ =true&builder.overrides.style-page=df85f31500e6406481ef8cc091fa9e86&builder.overrides.df85f31500e6406481ef8cc091fa9e86=df85f31500e6406481ef8cc091fa9e86"
      },
      "query": [
        {
          "@type": "@builder.io/core:Query",
          "operator": "is",
          "property": "urlPath",
          "value": "/test1234"
        }
      ],
      "testRatio": 1,
      "variations": {},
      "firstPublished": 1667233385545,
      "rev": "4n1w13u1j4"
    }
  ]
}

```

But if I post to the [Builder.io: Drag and drop Visual CMS](https://builder.io/api/v/write/style-page) endpoint with the following object, the url field is not populated. All other fields are:

```auto
{
   "name":"TEST!",
   "data":{
      "url":"/test12345",
      "title":"Test PAGE",
      "metaTags":"test,tag1",
      "description":"adfasdf"
   }
}

```

---

<div class="post-metadata">

**Author:** ![nathan-applied](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nathan-applied](https://forum.builder.io/u/nathan-applied)\
**Post date:** [October 31, 2022, 5:11pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/5 "2022-10-31T17:11:05Z")

</div>

Thank you for the video @nicke920. To clarify, the “Page url” or “Target” (as shown on list page) is what I’m having trouble creating via write API. The other fields are working.

---

<div class="post-metadata">

**Author:** ![nicke920](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nicke920](https://forum.builder.io/u/nicke920)\
**Post date:** [October 31, 2022, 8:20pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/6 "2022-10-31T20:20:00Z")

</div>

Hi Nathan,

In order to pass in properly the url, you’ll need to query the urlPath to update/create it. See: [Loom | Free Screen & Video Recording Software | Loom](https://www.loom.com/share/23a903d1e63b46298f8bec04fb7e7b0d)

To query, add this outside the data object, where the value is the url slug that you want to pass in:

```auto
"query": [
            {
              "property": "urlPath",
              "operator": "is", 
              "value": "/builder-demo-page" 
            }
          ],

```

Give the above a shot and please let me know how it goes.

---

<div class="post-metadata">

**Author:** ![nathan-applied](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nathan-applied](https://forum.builder.io/u/nathan-applied)\
**Post date:** [October 31, 2022, 9:01pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/7 "2022-10-31T21:01:40Z")

</div>

Hi @nicke920 , that worked! Thanks so much. I’m still a bit confused as to why the query is performing updates/inserts, but works for me.

---

<div class="post-metadata">

**Author:** ![nicke920](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nicke920](https://forum.builder.io/u/nicke920)\
**Post date:** [October 31, 2022, 10:37pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/8 "2022-10-31T22:37:32Z")

</div>

Hi @nathan-applied ,

That is great news!

The reason is because technically urlPath is not an input attribute like ‘title’, ‘description’ , and such. urlPath and device are what we call targeting attributes, and not an input attribute on the content itself.

I’ve linked below two pieces of documentation regarding targeting:

- [Targeting Content in Builder - Builder.io](https://www.builder.io/c/docs/targeting-with-builder)
- [Custom targeting attributes - Builder.io](https://www.builder.io/c/docs/custom-targeting-attributes)

---

<div class="post-metadata">

**Author:** ![wikkes](https://avatars.discourse-cdn.com/v4/letter/w/7ba0ec/32.png) [@wikkes](https://forum.builder.io/u/wikkes)\
**Post date:** [November 1, 2022, 8:27am UTC](https://forum.builder.io/t/write-api-fields-url/2812/9 "2022-11-01T08:27:24Z")

</div>

awesome! this worked for me also! thnx for the help

---

<div class="post-metadata">

**Author:** ![nicke920](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nicke920](https://forum.builder.io/u/nicke920)\
**Post date:** [November 1, 2022, 3:53pm UTC](https://forum.builder.io/t/write-api-fields-url/2812/10 "2022-11-01T15:53:06Z")

</div>

@wikkes That’s awesome to hear! I’m glad 🙂
