phpIPAM API reference

1.) Authentication

Method URL Description
GET /api/my_app/user/ Checks if token is still valid and returns expires value for token.
“phpipam-token” or "token" HTTP header must be present.
/api/my_app/user/token/ Returns token expiration date 1.3
/api/my_app/user/token_expires/ Returns token expiration date 1.3
/api/my_app/user/all/ Returns all users 1.3
rwa app permissions required
/api/my_app/user/admins/ Returns admin users 1.3
rwa app permissions required
POST /api/my_app/user/ Authenticates user through “authorization” header.
Successfull response contains “token” and “expires”.
This token must be included in each following interactions with API as “phpipam-token” HTTP header.
PATCH /api/my_app/user/ Same as GET, but it resets the expiration of token.
“phpipam-token” or "token" HTTP header must be present.
DELETE /api/my_app/user/ Removes (revokes) token.
“phpipam-token” or "token" HTTP header must be present.

2.) Sections controller

Method URL Description
GET /api/my_app/sections/ Returns all sections
/api/my_app/sections/{id}/ Returns specific section
/api/my_app/sections/{id}/subnets/ Returns all subnets in section
/api/my_app/sections/{name}/ Returns specific section by name
/api/my_app/sections/custom_fields/ Returns custom section fields
POST /api/my_app/sections/ Creates new section
PATCH /api/my_app/sections/ Updates section
DELETE /api/my_app/sections/ Deletes section with all belonging subnets and addresses

3.) Subnets controller

Method URL Description
GET /api/my_app/subnets/{id}/ Returns specific subnet by id
/api/my_app/subnets/{id}/usage/ Returns subnet usage
/api/my_app/subnets/{id}/first_free/ Returns first available IP address in subnet 1.3
/api/my_app/subnets/{id}/slaves/ Returns all immediate slave subnets
/api/my_app/subnets/{id}/slaves_recursive/ Returns all slave subnets recursive
/api/my_app/subnets/{id}/addresses/ Returns all addresses in subnet 1.3
/api/my_app/subnets/{id}/addresses/{ip}/ Returns IP address from subnet
/api/my_app/subnets/{id}/first_subnet/{mask}/ Returns first available subnet within selected for mask 1.3
/api/my_app/subnets/{id}/all_subnets/{mask}/ Returns all available subnets within selected for mask 1.3
/api/my_app/subnets/custom_fields/ Returns all subnet custom fields
/api/my_app/subnets/cidr/{subnet}/ Searches for subnet in CIDR format
/api/my_app/subnets/search/{subnet}/ Searches for subnet in CIDR format
POST /api/my_app/subnets/ Creates new subnet
/api/my_app/subnets/{id}/first_subnet/{mask}/ Creates new child subnet inside subnet with specified mask 1.3
PATCH /api/my_app/subnets/ Updates Subnet
/api/my_app/subnets/{id}/resize/ Resizes subnet to new mask
/api/my_app/subnets/{id}/split/ Splits subnet to smaller subnets
/api/my_app/subnets/{id}/permissions/ Sets subnet permissions (?grouname1=ro&groupname2=3&43=1) 1.3
DELETE /api/my_app/subnets/{id}/ Deletes Subnet
/api/my_app/subnets/{id}/truncate/ Removes all addresses from subnet
/api/my_app/subnets/{id}/permissions/ Removes all permissions 1.3

4.) Addresses controller

Method URL Description
GET /api/my_app/addresses/{id}/ Returns specific address
/api/my_app/addresses/{id}/ping/ Checks address status
/api/my_app/addresses/{ip}/{subnetId}/ Returns address from subnet by ip address 1.3
/api/my_app/addresses/search/{ip}/ searches for addresses in database, returns multiple if found
/api/my_app/addresses/search_hostname/{hostname}/ searches for addresses in database by hostname, returns multiple if found 1.3
/api/my_app/addresses/first_free/{subnetId}/ Returns first available address (subnetId can be provided with parameters) 1.3
/api/my_app/addresses/custom_fields/ Returns custom fields
/api/my_app/addresses/tags/ Returns all tags
/api/my_app/addresses/tags/{id}/ Returns specific tag
/api/my_app/addresses/tags/{id}/addresses/ Returns addresses for specific tag
POST /api/my_app/addresses/ Creates new address
/api/my_app/addresses/first_free/{subnetId}/ Creates new address in subnets – first available (subnetId can be provided with parameters) 1.3
PATCH /api/my_app/addresses/{id}/ Updates address
DELETE /api/my_app/addresses/{id}/ Deletes address
use 'remove_dns=1' parameter to remove all related DNS records 1.3
/api/my_app/addresses/{ip}/{subnetId}/ Deletes address by IP in specific subnet

5.) VLAN controller

Method URL Description
GET /api/my_app/vlan/ Returns all Vlans
/api/my_app/vlan/{id}/ Returns specific Vlan
/api/my_app/vlan/{id}/subnets/ Returns all subnets attached tovlan
/api/my_app/vlan/{id}/subnets/{sectionId}/ Returns all subnets attached to vlan in specific section
/api/my_app/vlan/{id}/custom_fields/ Returns custom VLAN fields
/api/my_app/vlan/{id}/search/{number}/ Searches for VLAN
POST /api/my_app/vlan/ Creates new VLAN
PATCH /api/my_app/vlan/ Updates VLAN
DELETE /api/my_app/vlan/ Deletes VLAN

6.) VLAN domains controller

Method URL Description
GET /api/my_app/l2domains/ Returns all L2 domains
/api/my_app/l2domains/{id}/ Returns specific L2 domain
/api/my_app/l2domains/{id}/vlans/ Returns all VLANs within L2 domain
/api/my_app/l2domains/custom_fields/ Returns all custom fields
POST /api/my_app/l2domains/ Creates new L2 domain
PATCH /api/my_app/l2domains/ Updates L2 domain
DELETE /api/my_app/l2domains/ Deletes L2 domain

7.) VRF controller

Method URL Description
GET /api/my_app/vrf/ Returns all VRFs
/api/my_app/vrf/{id}/ Returns specific VRF
/api/my_app/vrf/{id}/subnets/ Returns all subnets within VRF
/api/my_app/vrf/custom_fields/ Returns all custom fields
POST /api/my_app/vrf/ Creates new VRF
PATCH /api/my_app/vrf/ Updates VRF
DELETE /api/my_app/vrf/ Deletes VRF

8.) Tools controller

Method URL Description
GET /api/my_app/tools/{subcontroller}/ Returns all subcontroller objects
/api/my_app/tools/{subcontroller}/{identifier}/ Returns specific subcontroller object
POST /api/my_app/tools/{subcontroller}/ Creates new subcontroller object
PATCH /api/my_app/tools/{subcontroller}/{identifier}/ Updates subcontroller object
DELETE /api/my_app/tools/{subcontroller}/{identifier}/ Deletes subcontroller object

9.) Prefixes controller

Method URL Description
GET /api/my_app/prefix/{customer_type}/ Returns all subnets used to deliver new subnets
/api/my_app/prefix/{customer_type}/{ip_version}/ Returns all subnets used to deliver new subnets for specific IP version
* ip_version can be IPv4, IPv6, v4, v6
/api/my_app/prefix/{customer_type}/address/ Returns all subnets used to deliver new addresses
/api/my_app/prefix/{customer_type}/address/{ip_version}/ Returns all subnets used to deliver new addresses for specific IP version
/api/my_app/prefix/{customer_type}/{ip_version}/{mask}/ Returns first available subnet for ip version and requested mask
/api/my_app/prefix/{customer_type}/{ip_version}/address/ Returns first available address for ip version
POST /api/my_app/prefix/{customer_type}/{ip_version}/{mask}/ Creates first available subnet for ip version and requested mask
/api/my_app/prefix/{customer_type}/{ip_version}/address/ Creates first available address for ip version