---
title: Create a Field Plugin
description: This endpoint allows you to create a field type plugin.
url: https://storyblok.com/docs/api/management/field-plugins/create-a-field-plugin
---

# Create a Field Plugin

POST

```html
https://mapi.storyblok.com/v1/field_types
```

This endpoint allows you to create a field type plugin.

```bash
org_field_types/
```

```bash
partner_field_types/
```

## Request body properties

-   `field_type` (The Field Plugins Object)
    
    The [field plugin object](/docs/api/management/field-plugins/the-field-plugins-object)
    
    Show `The Field Plugins Object` child properties
    
    -   `name` (required) (string)
        
        Given name of your field plugin. Needs to be unique. A personal prefix is recommended (Example: my-geo-selector).
        
    -   `body` (string)
        
        The uncompiled JavaScript code of the field plugin.
        
    -   `compiled_body` (string)
        
        Used by the online code editor. Needs to be an empty string if using local plugin development.
        
    

## Response properties

-   `field_type` (The Field Plugins Object)
    
    Array of [field plugin object](/docs/api/management/field-plugins/the-field-plugins-object)
    

## Examples

-   cURL
    
    ```shellscript
    curl "https://mapi.storyblok.com/v1/field_types/" \
      -X POST \
      -H "Authorization: YOUR_OAUTH_TOKEN" \
      -H "Content-Type: application/json" \
      -d "{\"field_type\":{\"name\":\"my-geo-selector\"}}"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import Storyblok from "storyblok-js-client";
    
    const storyblok = new Storyblok({
      oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",
    });
    
    try {
      const response = await storyblok.post('field_types/', {
        "field_type": {
          "name": "my-geo-selector"
        }
      })
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
    
    $payload = ["field_type" => ["name" => "my-geo-selector"]];
    
    $client->post('field_types/', $payload)->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.post("https://mapi.storyblok.com/v1/field_types/")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_OAUTH_TOKEN")
      .body({"field_type":{"name":"my-geo-selector"}})
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://mapi.storyblok.com/v1/field_types/");
    var request = new RestRequest(Method.POST);
    
    request.AddHeader("Content-Type", "application/json");
    request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
    request.AddParameter("application/json", "{\"field_type\":{\"name\":\"my-geo-selector\"}}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://mapi.storyblok.com/v1/field_types/"
    
    querystring = {}
    
    payload = {"field_type":{"name":"my-geo-selector"}}
    headers = {
      'Content-Type': "application/json",
      'Authorization': "YOUR_OAUTH_TOKEN"
    }
    
    response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
    
    print(response.text)
    ```
    
-   Ruby
    
    ```ruby
    require 'storyblok'
    client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
    
    payload = {"field_type" => {"name" => "my-geo-selector"}}
    
    client.post('field_types/', payload)
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))
    var request = URLRequest(storyblok: storyblok, path: "field_types/")
    request.httpMethod = "POST"
    request.httpBody = try JSONSerialization.data(withJSONObject: [
        "field_type": [
            "name": "my-geo-selector",
        ],
    ])
    let (data, _) = try await storyblok.data(for: request)
    print(try JSONSerialization.jsonObject(with: data))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(MAPI)) {
            accessToken = OAuth("YOUR_OAUTH_TOKEN")
        }
    }
    
    val response = client.post("field_types/") {
        setBody(buildJsonObject {
            putJsonObject("field_type") {
                put("name", "my-geo-selector")
            }
        })
    }
    
    println(response.body<JsonElement>())
    ```

## Pagination

-   [Previous: Field Plugins](/docs/api/management/field-plugins)
-   [Next: Delete a Field Plugin](/docs/api/management/field-plugins/delete-a-field-plugin)
